diff options
Diffstat (limited to 'os/hal/src')
-rw-r--r-- | os/hal/src/mac.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/os/hal/src/mac.c b/os/hal/src/mac.c index 66f10131f..82446267d 100644 --- a/os/hal/src/mac.c +++ b/os/hal/src/mac.c @@ -81,10 +81,10 @@ void macObjectInit(MACDriver *macp) { macp->state = MAC_STOP;
macp->config = NULL;
- chSemObjectInit(&macp->tdsem, 0);
- chSemObjectInit(&macp->rdsem, 0);
+ osalThreadQueueObjectInit(&macp->tdqueue);
+ osalThreadQueueObjectInit(&macp->rdqueue);
#if MAC_USE_EVENTS
- chEvtObjectInit(&macp->rdevent);
+ osalEventObjectInit(&macp->rdevent);
#endif
}
@@ -160,7 +160,8 @@ msg_t macWaitTransmitDescriptor(MACDriver *macp, (time > 0)) {
osalSysLock();
now = osalOsGetSystemTimeX();
- if ((msg = chSemWaitTimeoutS(&macp->tdsem, time)) == MSG_TIMEOUT) {
+ msg = osalThreadEnqueueTimeoutS(&macp->tdqueue, time);
+ if (msg == MSG_TIMEOUT) {
osalSysUnlock();
break;
}
@@ -218,7 +219,8 @@ msg_t macWaitReceiveDescriptor(MACDriver *macp, (time > 0)) {
osalSysLock();
now = osalOsGetSystemTimeX();
- if ((msg = chSemWaitTimeoutS(&macp->rdsem, time)) == MSG_TIMEOUT) {
+ msg = osalThreadEnqueueTimeoutS(&macp->rdqueue, time);
+ if (msg == MSG_TIMEOUT) {
osalSysUnlock();
break;
}
|