Page 1 of 1

Flasgs control

Posted: Sun Jan 21, 2018 10:25 am
by AlexNL
Hello. I spent a day but i don't understand - how can i monitor flags which sets by function:

Code: Select all

chnAddFlagsI(ip, flags)


For example (part of hal_serial_lld.h):

Code: Select all

/* Special case, LIN break detection.*/
  if (sr & USART_SR_LBD) {
    osalSysLockFromISR();
    chnAddFlagsI(sdp, SD_BREAK_DETECTED);
    u->SR = ~USART_SR_LBD;
    osalSysUnlockFromISR();
  }


Thanks a lot.

Re: Flasgs control

Posted: Sun Jan 21, 2018 1:40 pm
by Giovanni
Hi,

You need to register a thread waiting from events on that event source. The event listener structure contains those flags.

If you search the forum about events you will find examples.

Giovanni