You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an ADC driver for which I wrote a shield that continuously performs ADC conversions. My main.c needs to retrieve the ADC values as soon as a conversion is complete.
The shield includes an ISR that is triggered when the conversion finishes. Immediately after that—outside the ISR—main.c should call adc_read() to fetch the result.
What would be an elegant and efficient way, in Zephyr style, to notify main.c that the conversion is complete?
Would a callback in main.c that starts a thread be a suitable approach? Or is it better to set a semaphore from the ISR?
I’m looking for a clean and fast solution, since the ADC values need to be retrieved with minimal delay.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I have an ADC driver for which I wrote a shield that continuously performs ADC conversions. My main.c needs to retrieve the ADC values as soon as a conversion is complete.
The shield includes an ISR that is triggered when the conversion finishes. Immediately after that—outside the ISR—main.c should call adc_read() to fetch the result.
What would be an elegant and efficient way, in Zephyr style, to notify main.c that the conversion is complete?
Would a callback in main.c that starts a thread be a suitable approach? Or is it better to set a semaphore from the ISR?
I’m looking for a clean and fast solution, since the ADC values need to be retrieved with minimal delay.
Beta Was this translation helpful? Give feedback.
All reactions