OSAL way to wait for an event?

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

Moderators: RoccoMarco, lbednarz, utzig, tfAteba, barthess

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

OSAL way to wait for an event?

Postby xiaomin » Fri Aug 18, 2017 5:23 pm

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

Re: OSAL way to wait for an event?

Postby Giovanni » Fri Aug 18, 2017 5:36 pm

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?

Postby xiaomin » Fri Aug 18, 2017 7:23 pm

Thanks.


Return to “General Support”

Who is online

Users browsing this forum: No registered users and 10 guests