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.
faisal
Posts: 374
Joined: Wed Jul 19, 2017 12:44 am
Has thanked: 44 times
Been thanked: 60 times

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

Postby faisal » 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.

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

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

Postby Giovanni » Mon Sep 25, 2017 8:24 am

Hi,

Added chEvtAddEventsI() to trunk.

Giovanni

faisal
Posts: 374
Joined: Wed Jul 19, 2017 12:44 am
Has thanked: 44 times
Been thanked: 60 times

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

Postby faisal » Wed Sep 27, 2017 1:22 am

Thanks!

faisal
Posts: 374
Joined: Wed Jul 19, 2017 12:44 am
Has thanked: 44 times
Been thanked: 60 times

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

Postby faisal » Mon Oct 02, 2017 10:31 pm

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: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

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

Postby Giovanni » Wed Oct 04, 2017 9:12 am

Hi,

Committed in trunk.

Giovanni


Return to “Small Change Requests”

Who is online

Users browsing this forum: No registered users and 6 guests