chEvtAddEvents(), I/S class versions please Topic is solved

Use this forum for requesting small changes in ChibiOS. Large changes should be discussed in the development forum. This forum is NOT for support.
Post Reply
faisal
Posts: 382
Joined: Wed Jul 19, 2017 12:44 am
Has thanked: 45 times
Been thanked: 62 times

chEvtAddEvents(), I/S class versions please

Post 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.
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

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

Post by Giovanni »

Hi,

Added chEvtAddEventsI() to trunk.

Giovanni
faisal
Posts: 382
Joined: Wed Jul 19, 2017 12:44 am
Has thanked: 45 times
Been thanked: 62 times

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

Post by faisal »

Thanks!
faisal
Posts: 382
Joined: Wed Jul 19, 2017 12:44 am
Has thanked: 45 times
Been thanked: 62 times

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

Post 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;
}
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

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

Post by Giovanni »

Hi,

Committed in trunk.

Giovanni
Post Reply