diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2017-11-04 19:23:04 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2017-11-04 19:23:04 +0000 |
commit | 6c18028a35db35c45c8c342d43abd74b13ef1605 (patch) | |
tree | 3593608d310f95a350ff3de0160c50b46a0e1412 /os/common | |
parent | ec1b4e72512e7e958a4168444a56182736218bff (diff) | |
download | ChibiOS-6c18028a35db35c45c8c342d43abd74b13ef1605.tar.gz ChibiOS-6c18028a35db35c45c8c342d43abd74b13ef1605.tar.bz2 ChibiOS-6c18028a35db35c45c8c342d43abd74b13ef1605.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10946 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/common')
-rw-r--r-- | os/common/abstractions/cmsis_os/cmsis_os.c | 24 | ||||
-rw-r--r-- | os/common/oslib/src/chfactory.c | 4 |
2 files changed, 14 insertions, 14 deletions
diff --git a/os/common/abstractions/cmsis_os/cmsis_os.c b/os/common/abstractions/cmsis_os/cmsis_os.c index a871b761f..a01ebc0e0 100644 --- a/os/common/abstractions/cmsis_os/cmsis_os.c +++ b/os/common/abstractions/cmsis_os/cmsis_os.c @@ -68,7 +68,7 @@ static void timer_cb(void const *arg) { timer_id->ptimer(timer_id->argument);
if (timer_id->type == osTimerPeriodic) {
chSysLockFromISR();
- chVTDoSetI(&timer_id->vt, MS2ST(timer_id->millisec),
+ chVTDoSetI(&timer_id->vt, TIME_MS2I(timer_id->millisec),
(vtfunc_t)timer_cb, timer_id);
chSysUnlockFromISR();
}
@@ -226,7 +226,7 @@ osStatus osTimerStart(osTimerId timer_id, uint32_t millisec) { return osErrorValue;
timer_id->millisec = millisec;
- chVTSet(&timer_id->vt, MS2ST(millisec), (vtfunc_t)timer_cb, timer_id);
+ chVTSet(&timer_id->vt, TIME_MS2I(millisec), (vtfunc_t)timer_cb, timer_id);
return osOK;
}
@@ -287,8 +287,8 @@ int32_t osSignalClear(osThreadId thread_id, int32_t signals) { */
osEvent osSignalWait(int32_t signals, uint32_t millisec) {
osEvent event;
- systime_t timeout = ((millisec == 0) || (millisec == osWaitForever)) ?
- TIME_INFINITE : MS2ST(millisec);
+ sysinterval_t timeout = ((millisec == 0) || (millisec == osWaitForever)) ?
+ TIME_INFINITE : TIME_MS2I(millisec);
if (signals == 0)
event.value.signals = (uint32_t)chEvtWaitAnyTimeout(ALL_EVENTS, timeout);
@@ -324,8 +324,8 @@ osSemaphoreId osSemaphoreCreate(const osSemaphoreDef_t *semaphore_def, * @brief Wait on a semaphore.
*/
int32_t osSemaphoreWait(osSemaphoreId semaphore_id, uint32_t millisec) {
- systime_t timeout = ((millisec == 0) || (millisec == osWaitForever)) ?
- TIME_INFINITE : MS2ST(millisec);
+ sysinterval_t timeout = ((millisec == 0) || (millisec == osWaitForever)) ?
+ TIME_INFINITE : TIME_MS2I(millisec);
msg_t msg = chSemWaitTimeout((semaphore_t *)semaphore_id, timeout);
switch (msg) {
@@ -380,8 +380,8 @@ osMutexId osMutexCreate(const osMutexDef_t *mutex_def) { * @brief Wait on a mutex.
*/
osStatus osMutexWait(osMutexId mutex_id, uint32_t millisec) {
- systime_t timeout = ((millisec == 0) || (millisec == osWaitForever)) ?
- TIME_INFINITE : MS2ST(millisec);
+ sysinterval_t timeout = ((millisec == 0) || (millisec == osWaitForever)) ?
+ TIME_INFINITE : TIME_MS2I(millisec);
msg_t msg = chBSemWaitTimeout((binary_semaphore_t *)mutex_id, timeout);
switch (msg) {
@@ -495,8 +495,8 @@ osStatus osMessagePut(osMessageQId queue_id, uint32_t info,
uint32_t millisec) {
msg_t msg;
- systime_t timeout = ((millisec == 0) || (millisec == osWaitForever)) ?
- TIME_INFINITE : MS2ST(millisec);
+ sysinterval_t timeout = ((millisec == 0) || (millisec == osWaitForever)) ?
+ TIME_INFINITE : TIME_MS2I(millisec);
if (port_is_isr_context()) {
@@ -522,8 +522,8 @@ osEvent osMessageGet(osMessageQId queue_id, uint32_t millisec) {
msg_t msg;
osEvent event;
- systime_t timeout = ((millisec == 0) || (millisec == osWaitForever)) ?
- TIME_INFINITE : MS2ST(millisec);
+ sysinterval_t timeout = ((millisec == 0) || (millisec == osWaitForever)) ?
+ TIME_INFINITE : TIME_MS2I(millisec);
event.def.message_id = queue_id;
diff --git a/os/common/oslib/src/chfactory.c b/os/common/oslib/src/chfactory.c index 74e80e528..6e187c929 100644 --- a/os/common/oslib/src/chfactory.c +++ b/os/common/oslib/src/chfactory.c @@ -56,8 +56,8 @@ #define F_LOCK() chMtxLock(&ch_factory.mtx)
#define F_UNLOCK() chMtxUnlock(&ch_factory.mtx)
#else
-#define F_LOCK() (void) chSemWait(ch_factory.sem)
-#define F_UNLOCK() chSemSignal(ch_factory.sem)
+#define F_LOCK() (void) chSemWait(&ch_factory.sem)
+#define F_UNLOCK() chSemSignal(&ch_factory.sem)
#endif
/*===========================================================================*/
|