Revision 880a8dde middleware/apps_urtosal.c

View differences:

middleware/apps_urtosal.c
34 34
/* CONDITION VARIABLE                                                         */
35 35
/*============================================================================*/
36 36

  
37
#if (URT_CFG_OSAL_CONDVAR_TIMEOUT == true) || defined(__DOXYGEN__)
37 38
/**
38 39
 * @details Due to limitations of ChibiOS, the 'mutex' argument is ignored in
39 40
 *          this implementation. Instead, the mutex, which was locked by the
......
61 62
      return URT_CONDVAR_WAITSTATUS_TIMEOUT;
62 63
  }
63 64
}
65
#else
66
urt_osCondvarWaitStatus_t urtCondvarWait(urt_osCondvar_t* condvar, urt_osMutex_t* mutex)
67
{
68
  aosDbgCheck(condvar != NULL);
69
  aosDbgCheck(mutex != NULL);
70
  aosDbgCheck(chMtxGetNextMutexX() == mutex); // due to limitation of ChibiOS
71

  
72
  (void)mutex;
73

  
74
  switch (chCondWait(condvar)) {
75
    case MSG_OK:
76
      return URT_CONDVAR_WAITSTATUS_SIGNAL;
77
    case MSG_RESET:
78
      return URT_CONDVAR_WAITSTATUS_BROADCAST;
79
    default:
80
      chSysHalt(__func__);
81
      return URT_CONDVAR_WAITSTATUS_TIMEOUT;
82
  }
83
}
84
#endif
64 85

  
65 86
/*============================================================================*/
66 87
/* EVENTS                                                                     */

Also available in: Unified diff