Skip to content

Commit

Permalink
Update cmsis_os function implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
MaJerle committed Sep 18, 2020
1 parent 6dccd99 commit f733088
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion dev/VisualStudio/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ int n;
int
main(void) {
double num = 2123213213142.032;

lwprintf_init(lwprintf_output);

printf_run(NULL, "Precision: %3d, %.*g", 17, 17, 0.0001234567);
Expand Down
12 changes: 3 additions & 9 deletions lwprintf/src/system/lwprintf_sys_cmsis_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
uint8_t
lwprintf_sys_mutex_create(LWPRINTF_CFG_OS_MUTEX_HANDLE* m) {
*m = osMutexNew(NULL);
return 1;
return lwprintf_sys_mutex_isvalid(m);
}

uint8_t
Expand All @@ -50,18 +50,12 @@ lwprintf_sys_mutex_isvalid(LWPRINTF_CFG_OS_MUTEX_HANDLE* m) {

uint8_t
lwprintf_sys_mutex_wait(LWPRINTF_CFG_OS_MUTEX_HANDLE* m) {
if (osMutexAcquire(*m, osWaitForever) != osOK) {
return 0;
}
return 1;
return osMutexAcquire(*m, osWaitForever) == osOK;
}

uint8_t
lwprintf_sys_mutex_release(LWPRINTF_CFG_OS_MUTEX_HANDLE* m) {
if (osMutexRelease(*m) != osOK) {
return 0;
}
return 1;
return osMutexRelease(*m, osWaitForever) == osOK;
}

#endif /* LWPRINTF_CFG_OS && !__DOXYGEN__ */

0 comments on commit f733088

Please sign in to comment.