diff options
Diffstat (limited to 'os/hal/include/adc.h')
-rw-r--r-- | os/hal/include/adc.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/os/hal/include/adc.h b/os/hal/include/adc.h index 8bc013b38..b0d6d0938 100644 --- a/os/hal/include/adc.h +++ b/os/hal/include/adc.h @@ -124,9 +124,10 @@ typedef enum { */
#define _adc_wakeup_isr(adcp) { \
if ((adcp)->thread != NULL) { \
- Thread *tp = (adcp)->thread; \
- (adcp)->thread = NULL; \
+ Thread *tp; \
chSysLockFromIsr(); \
+ tp = (adcp)->thread; \
+ (adcp)->thread = NULL; \
tp->p_u.rdymsg = RDY_OK; \
chSchReadyI(tp); \
chSysUnlockFromIsr(); \
|