OSAL way to wait for an event?

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
xiaomin
Posts: 6
Joined: Mon Jul 24, 2017 1:43 pm
Has thanked: 1 time

OSAL way to wait for an event?

Post by xiaomin »

I really like all the hal uses osal way to handle all things, so hal can work on "any" os platform. Like in uart / can hal driver, hal_lld will use osalEventBroadcastFlagsI to broadcast an event when an isr fires. I also want to write my application in osal way so it can be also easily moved to another os. But I don't know how to wait on the event in osal way. I only know how to wait for the event in chibios rt way. Is there any example around that I can study of?
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: OSAL way to wait for an event?

Post by Giovanni »

Hi,

OSAL is just an interface from HAL to the underlying OS so it does not need a functionally complete API, waiting for events is not part of it, drivers just generate events so wait is not required. Rationale is to keep OSAL as simple as possible, extra API mean extra effort when porting to another OS.

In your application it is better to use the native RTOS and HAL API.

Giovanni
xiaomin
Posts: 6
Joined: Mon Jul 24, 2017 1:43 pm
Has thanked: 1 time

Re: OSAL way to wait for an event?

Post by xiaomin »

Thanks.
Post Reply