mirror of
https://github.com/MaJerle/lwmem.git
synced 2025-01-26 06:02:54 +08:00
Update cmsis_os function implementation
This commit is contained in:
parent
a3ac4c62e8
commit
a28203bc5c
@ -40,7 +40,7 @@
|
||||
uint8_t
|
||||
lwmem_sys_mutex_create(LWMEM_CFG_OS_MUTEX_HANDLE* m) {
|
||||
*m = osMutexNew(NULL);
|
||||
return 1;
|
||||
return lwmem_sys_mutex_isvalid(m);
|
||||
}
|
||||
|
||||
uint8_t
|
||||
@ -50,18 +50,12 @@ lwmem_sys_mutex_isvalid(LWMEM_CFG_OS_MUTEX_HANDLE* m) {
|
||||
|
||||
uint8_t
|
||||
lwmem_sys_mutex_wait(LWMEM_CFG_OS_MUTEX_HANDLE* m) {
|
||||
if (osMutexAcquire(*m, osWaitForever) != osOK) {
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
return osMutexAcquire(*m, osWaitForever) == osOK;
|
||||
}
|
||||
|
||||
uint8_t
|
||||
lwmem_sys_mutex_release(LWMEM_CFG_OS_MUTEX_HANDLE* m) {
|
||||
if (osMutexRelease(*m) != osOK) {
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
return osMutexRelease(*m) == osOK;
|
||||
}
|
||||
|
||||
#endif /* LWMEM_CFG_OS && !__DOXYGEN__ */
|
||||
|
Loading…
x
Reference in New Issue
Block a user