Page 1 of 1

chEvtAddEvents(), I/S class versions please

Posted: Mon Sep 25, 2017 5:01 am
by faisal
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.

Re: chEvtAddEvents(), I/S class versions please

Posted: Mon Sep 25, 2017 8:24 am
by Giovanni
Hi,

Added chEvtAddEventsI() to trunk.

Giovanni

Re: chEvtAddEvents(), I/S class versions please

Posted: Wed Sep 27, 2017 1:22 am
by faisal
Thanks!

Re: chEvtAddEvents(), I/S class versions please

Posted: Mon Oct 02, 2017 10:31 pm
by faisal
Another one: chEvtGetAndClearEvents, I class version please :) .

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;
}

Re: chEvtAddEvents(), I/S class versions please

Posted: Wed Oct 04, 2017 9:12 am
by Giovanni
Hi,

Committed in trunk.

Giovanni