diff options
Diffstat (limited to 'common/lightbar.c')
-rw-r--r-- | common/lightbar.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/common/lightbar.c b/common/lightbar.c index c0dd35e56b..11fe41a5aa 100644 --- a/common/lightbar.c +++ b/common/lightbar.c @@ -418,15 +418,16 @@ static inline int cycle_010(uint8_t i) * the latest one. */ static uint32_t pending_msg; /* And here's the task event that we use to trigger delivery. */ -#define PENDING_MSG 1 +#define PENDING_MSG TASK_EVENT_CUSTOM(BIT(0)) /* Interruptible delay. */ -#define WAIT_OR_RET(A) do { \ - uint32_t msg = task_wait_event(A); \ - uint32_t p_msg = pending_msg; \ - if (TASK_EVENT_CUSTOM(msg) == PENDING_MSG && \ - p_msg != st.cur_seq) \ - return p_msg; } while (0) +#define WAIT_OR_RET(A) \ + do { \ + uint32_t msg = task_wait_event(A); \ + uint32_t p_msg = pending_msg; \ + if (msg == PENDING_MSG && p_msg != st.cur_seq) \ + return p_msg; \ + } while (0) /******************************************************************************/ /* Here are the preprogrammed sequences. */ @@ -814,7 +815,7 @@ static uint32_t sequence_STOP(void) uint32_t msg; do { - msg = TASK_EVENT_CUSTOM(task_wait_event(-1)); + msg = task_wait_event(-1); CPRINTS("LB %s() got pending_msg %d", __func__, pending_msg); } while (msg != PENDING_MSG || ( pending_msg != LIGHTBAR_RUN && @@ -1657,9 +1658,7 @@ void lightbar_sequence_f(enum lightbar_sequence num, const char *f) CPRINTS("LB %s() requests %d %s", f, num, lightbar_cmds[num].string); pending_msg = num; - task_set_event(TASK_ID_LIGHTBAR, - TASK_EVENT_CUSTOM(PENDING_MSG), - 0); + task_set_event(TASK_ID_LIGHTBAR, PENDING_MSG, 0); } else CPRINTS("LB %s() requests %d - ignored", f, num); } |