cvra / platform-abstraction

Platform abstraction layer for microcontrollers
3 stars 6 forks source link

Abstraction for uC/OS OS_EVENT? #10

Open msplr opened 10 years ago

msplr commented 10 years ago

Will OS_EVENT's be used?

antoinealb commented 10 years ago

Well OS_EVENT is a generic type used for mutex, semaphore and various other features. So what do you mean ?

froj commented 10 years ago

Well OS_EVENT is a generic type used for mutex, semaphore and various other features. So what do you mean ?

Not anymore in uC/OS-III. But still: Could you elaborate?

msplr commented 10 years ago

Well OS_EVENT is a generic type used for mutex, semaphore and various other features.

right. I meant OSEventPendMulti(). Being able to wait for multiple "events" at once is sometimes very useful, but it is probably difficult to abstract and test this.

Not anymore in uC/OS-III.

ok, didn't know. I was looking at uC/OS-II documentation.

froj commented 10 years ago

Not anymore in uC/OS-III.

ok, didn't know. I was looking at uC/OS-II documentation.

They started to make actual types like OS_MUTEX and OS_SEM.

OSEventPendMulti() seems really useful to me, too.

The new API.

antoinealb commented 10 years ago

This seems pretty useful and could be abstracted into something like this maybe (function name not appropriate) :

semaphore_t *os_semaphore_take_many(semaphore_t *semaphores[], size_t count);

The function would return the semaphore that was accepted. Now if we want to add message queues into the mix, we probably should define an abstraction for message queues first.