This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

BLE stack 1.2 OSAL

Hey all,

i m trying to raise an event to the OSAL coming from the HAL.

Can someone plz help me with the arguments for invoke

osal_set_even(uint8, uint16)

I don't know which one is the first one...

10x in advanced!

RAN

  • Hi Ran,

    What you mean by "raising event to the OSAL"?

    Do you want to signal some other task about changes in one of the HAL modules?

  • hi Igor,

    More or less, i want to do something after 5 interrupts (coming from one of the HAL modules).

    For that, i need to invoke (after count the interrupts):

    osal_set_even(uint8, uint16)

    As far as i understood.

    I want the OSAL to treat my event (that osal_set_event set).

    I don't think it's other task, i think it's to raise ,the HAL event, to higher abstraction layer (OSAL) .

    Correct me if i wrong.

    10x in advance,

    RAN

  • ran greenberg said:
    I want the OSAL to treat my event (that osal_set_event set).

    OSAL treats the event in a way of signaling to another task that some event is pending for it.

    For example, you have a task named MY_TASK with MY_TASK_ID, and another HAL module

    that is counting interrupts, upon hitting count_limit this HAL module uses OSAL events mechanism

    to inform MY_TASK about this count_limit by calling osal_set_event(MY_TASK_ID, COUNT_LIMIT_HANDLE).

    The COUNT_LIMIT_HANDLE is an event handler in the MY_TASK, thus setting the COUNT_LIMIT_HANDLE

    with osal_set_event() will trigger MY_TASK and COUNT_LIMIT_HANDLE will be executed (if coded

    properly of course). :)
     

    Is it clears the fog a bit?

  • 10x Igor!

    I think that i missing something.

    As far as i understood, the event mechanism in OSAL is 2  dimensions array of "tasksEvents" that the 1st dimension is tasksEvents[task_id] (uint8) and the 2nd is event_flag,

    therefore, when osal_set_event() is set the relevant flag:

    tasksEvents[task_id] |= event_flag;

    and the OSAL (when getting time execution) by polling get to know the HAL layer raise an event for her and invoke to defined function "events = (tasksArr[idx])( idx, events );".

    the event_flag (COUNT_LIMIT_HANDLE in your explanation) is just a flag for the ProcessEvent to know which event it should handle (one of the 16 optional- uint16 the 2nd dimension).

    correct me if i wrong plz.

    so, after that short introduction,

    which arguments should i give to osal_set_event() to sign that the HAL raise an event and i want "SimpleBLECentral_ProcessEvent" will treat the event (i m usent the Central sample as u can see).

    10x in advance,

    Ran