palWaitLineTimeout does not respect his API (no return value) Topic is solved

Report here problems in any of ChibiOS components. This forum is NOT for support.
User avatar
alex31
Posts: 374
Joined: Fri May 25, 2012 10:23 am
Location: toulouse, france
Has thanked: 38 times
Been thanked: 61 times
Contact:

palWaitLineTimeout does not respect his API (no return value)  Topic is solved

Postby alex31 » Sat Feb 17, 2018 11:12 am

Hello,

In current stable (18.2),

palWaitLineTimeout should return msg_t (OK, TIMEOUT, RESET), but as it is implemented, it return nothing.


Code: Select all

#define palWaitLineTimeout(line, timeout)                                   \
  do {                                                                      \
    osalSysLock();                                                          \
    palWaitLineTimeoutS(line, timeout);                                     \
    osalSysUnlock();                                                        \
  } while (false)
#endif /* PAL_USE_WAIT == TRUE */


could be resolved using static inline function instead of macro

Code: Select all

  static inline  msg_t palWaitLineTimeout(const ioline_t line, const sysinterval_t timeout)
  {                           \
    osalSysLock();                     \
    msg_t status = palWaitLineTimeoutS(line, timeout);         \
    osalSysUnlock();
    return status;               \
  }


Alexandre

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: palWaitLineTimeout does not respect his API (no return value)

Postby Giovanni » Fri Feb 23, 2018 11:36 am

Hi,

Fixed as bug #921.

Giovanni


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 25 guests