From e06534dca10c5c7db61c18e89d8e98ef3ab79f3c Mon Sep 17 00:00:00 2001 From: Cole Roof Date: Thu, 26 Sep 2024 11:01:25 -0700 Subject: [PATCH 1/2] system/arduino/esp32 bugfixes & warnings - [BUG] fixed function typo for condvar from 'free' to 'drop' - this was breaking ring buffers on this platform - [WARN] added missing include header for z_random() calls - [WARN] explicit cast to (TaskHandle_t*) for FreeRTOS task creation --- src/system/arduino/esp32/system.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/system/arduino/esp32/system.c b/src/system/arduino/esp32/system.c index d7f356348..db4d33710 100644 --- a/src/system/arduino/esp32/system.c +++ b/src/system/arduino/esp32/system.c @@ -14,6 +14,7 @@ #include #include +#include #include #include @@ -70,7 +71,7 @@ z_result_t _z_task_init(_z_task_t *task, z_task_attr_t *attr, void *(*fun)(void if (z_arg != NULL) { z_arg->_fun = fun; z_arg->_arg = arg; - if (xTaskCreate((void *)z_task_wrapper, "", 5120, z_arg, configMAX_PRIORITIES / 2, task) != pdPASS) { + if (xTaskCreate((void *)z_task_wrapper, "", 5120, z_arg, configMAX_PRIORITIES / 2, (TaskHandle_t*)task) != pdPASS) { ret = -1; } } else { @@ -110,7 +111,7 @@ z_result_t _z_mutex_unlock(_z_mutex_t *m) { _Z_CHECK_SYS_ERR(pthread_mutex_unloc /*------------------ Condvar ------------------*/ z_result_t _z_condvar_init(_z_condvar_t *cv) { _Z_CHECK_SYS_ERR(pthread_cond_init(cv, NULL)); } -z_result_t _z_condvar_free(_z_condvar_t *cv) { _Z_CHECK_SYS_ERR(pthread_cond_destroy(cv)); } +z_result_t _z_condvar_drop(_z_condvar_t *cv) { _Z_CHECK_SYS_ERR(pthread_cond_destroy(cv)); } z_result_t _z_condvar_signal(_z_condvar_t *cv) { _Z_CHECK_SYS_ERR(pthread_cond_signal(cv)); } From fd1e64da9a982254cb74d049470d49c6de0eb42f Mon Sep 17 00:00:00 2001 From: Cole Roof <36613128+S3ckShUn21@users.noreply.github.com> Date: Fri, 27 Sep 2024 14:18:08 -0700 Subject: [PATCH 2/2] formatting changes Co-authored-by: Alexander Bushnev --- src/system/arduino/esp32/system.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/system/arduino/esp32/system.c b/src/system/arduino/esp32/system.c index db4d33710..29b81341f 100644 --- a/src/system/arduino/esp32/system.c +++ b/src/system/arduino/esp32/system.c @@ -71,7 +71,8 @@ z_result_t _z_task_init(_z_task_t *task, z_task_attr_t *attr, void *(*fun)(void if (z_arg != NULL) { z_arg->_fun = fun; z_arg->_arg = arg; - if (xTaskCreate((void *)z_task_wrapper, "", 5120, z_arg, configMAX_PRIORITIES / 2, (TaskHandle_t*)task) != pdPASS) { + if (xTaskCreate((void *)z_task_wrapper, "", 5120, z_arg, configMAX_PRIORITIES / 2, (TaskHandle_t *)task) != + pdPASS) { ret = -1; } } else {