Search found 264 matches

by faisal
Mon Oct 02, 2017 10:31 pm
Forum: Small Change Requests
Topic: chEvtAddEvents(), I/S class versions please Topic is solved
Replies: 4
Views: 1583

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

Another one: chEvtGetAndClearEvents, I class version please :) . 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] ...
by faisal
Wed Sep 27, 2017 1:35 am
Forum: Development and Feedback
Topic: [NOTE] Ideas for RT 5 and/or NIL 3
Replies: 11
Views: 5510

Re: [NOTE] Ideas for RT 5 and/or NIL 3

I am introducing a "factory" mechanism for both RT and NIL, it allows to fabricate objects like buffers, semaphores, mutexes, mailboxes etc and give them a name. The objects have a reference counter so the memory is freed when all object users have released their reference. This will allo...
by faisal
Wed Sep 27, 2017 1:30 am
Forum: Development and Feedback
Topic: [NOTE] Ideas for RT 5 and/or NIL 3
Replies: 11
Views: 5510

Re: [NOTE] Ideas for RT 5 and/or NIL 3

Memory pool object chain: Basically a dynamically sizable memory object, which can grow by allocating and appending new memory pool objects to a linked list, and shrink by deallocating memory pool objects and deleting them from the list. This is useful for all sorts of applications. Some helper meth...
by faisal
Mon Sep 25, 2017 5:01 am
Forum: Small Change Requests
Topic: chEvtAddEvents(), I/S class versions please Topic is solved
Replies: 4
Views: 1583

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

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.
by faisal
Mon Sep 25, 2017 4:08 am
Forum: Development and Feedback
Topic: GenericQueue with counter?
Replies: 8
Views: 2734

Re: GenericQueue with counter?

Just want to chime in with another vote for lock-less single producer single consumer queues. I was working on a high performance DSP application (on a relatively slow) processor a while back, and lock-less queues saved the day (given the assumption of a single producer, single consumer) along with ...
by faisal
Wed Sep 20, 2017 4:40 pm
Forum: ChibiOS/RT
Topic: Combine mailbox with events
Replies: 8
Views: 2578

Re: Combine mailbox with events

Giovanni wrote:From here: http://www.chibios.org/dokuwiki/doku.ph ... cles:start

"Articles" from the home page.

Giovanni


Thanks Giovanni!
by faisal
Tue Sep 19, 2017 4:29 pm
Forum: ChibiOS/RT
Topic: Combine mailbox with events
Replies: 8
Views: 2578

Re: Combine mailbox with events

I found this: http://www.chibios.org/dokuwiki/doku.php?id=chibios:kb:atomic , which describes it pretty well. What I can't find however, is where is that article linked from? I looked in the book (http://www.chibios.org/dokuwiki/doku.php?id=chibios:book:start), but couldn't find it there. From the l...
by faisal
Tue Sep 19, 2017 4:18 pm
Forum: ChibiOS/RT
Topic: Combine mailbox with events
Replies: 8
Views: 2578

Re: Combine mailbox with events

The operation are *not* atomic if written normally, you need to create an atomic construct this way: chSysLock(); chEvtSignalI(); chMBPostS(); chSysUnlock(); Note the I and the S after function names. You can have several I-class functions and a single final S-class must be present which reschedule...
by faisal
Tue Sep 19, 2017 3:03 pm
Forum: ChibiOS/RT
Topic: Combine mailbox with events
Replies: 8
Views: 2578

Re: Combine mailbox with events

Hi, You can wait for just events: send an event when posting into the mailbox, the two operations will be atomic. On the thread side wait for the two events (with timeout), when the mailbox event it received then "fetch" messages using TIME_IMMEDIATE until the mailbox is empty, this makes...

Go to advanced search