chEvtAddEvents(), I/S class versions please
Posted: Mon Sep 25, 2017 5:01 am
It would be good to have an S class versions of the chEvtAddEvents function. I usually use it in a context where I'm already in a chSysLock() state.
ChibiOS Web Boards
https://forum.chibios.org/
Code: Select all
eventmask_t chEvtGetAndClearEventsI(eventmask_t events) {
eventmask_t m;
m = currp->epending & events;
currp->epending &= ~events;
return m;
}
/**
* @brief Clears the pending events specified in the events mask.
*
* @param[in] events the events to be cleared
* @return The mask of pending events that were cleared.
*
* @api
*/
eventmask_t chEvtGetAndClearEvents(eventmask_t events) {
eventmask_t m;
chSysLock();
m = chEvtGetAndClearEventsI(events);
chSysUnlock();
return m;
}