Flasgs control

Discussions and support about ChibiOS/HAL, the MCU Hardware Abstraction Layer.
AlexNL
Posts: 1
Joined: Sun Jan 21, 2018 10:19 am

Flasgs control

Postby AlexNL » Sun Jan 21, 2018 10:25 am

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.

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: Flasgs control

Postby Giovanni » Sun Jan 21, 2018 1:40 pm

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


Return to “ChibiOS/HAL”

Who is online

Users browsing this forum: No registered users and 10 guests