diff --git a/docs/ideas.md b/docs/ideas.md index 81c73f0a..f40c5de1 100644 --- a/docs/ideas.md +++ b/docs/ideas.md @@ -1,9 +1,7 @@ # TODOs - Update `view_port` to use `ViewPort` as handle externally and `ViewPortData` internally -- Replace FreeRTOS semaphore from `Loader` with internal `Mutex` - Create more unit tests for `tactility-core` and `tactility` (PC-only for now) - Have a way to deinit LVGL drivers that are created from `HardwareConfig` -- Set DPI in sdkconfig for Waveshare display - Show a warning screen if firmware encryption or secure boot are off when saving WiFi credentials. - Show a warning screen when a user plugs in the SD card on a device that only supports mounting at boot. - Try out Waveshare S3 120MHz mode for PSRAM (see "enabling 120M PSRAM is necessary" in [docs](https://www.waveshare.com/wiki/ESP32-S3-Touch-LCD-4.3#Other_Notes)) diff --git a/sdkconfig.board.waveshare_s3_touch b/sdkconfig.board.waveshare_s3_touch index 5134c4b3..0634bd6d 100644 --- a/sdkconfig.board.waveshare_s3_touch +++ b/sdkconfig.board.waveshare_s3_touch @@ -28,4 +28,4 @@ CONFIG_SPIRAM_SPEED_80M=y CONFIG_LV_COLOR_16_SWAP=n CONFIG_LV_DISP_DEF_REFR_PERIOD=17 CONFIG_LV_INDEV_DEF_READ_PERIOD=17 -CONFIG_LV_DPI_DEF=139 +CONFIG_LV_DPI_DEF=216 diff --git a/tactility/src/services/loader/loader.c b/tactility/src/services/loader/loader.c index 8d62ec5f..ccd45dd0 100644 --- a/tactility/src/services/loader/loader.c +++ b/tactility/src/services/loader/loader.c @@ -33,7 +33,7 @@ static Loader* loader_alloc() { &loader_main, NULL ); - loader_singleton->mutex = xSemaphoreCreateRecursiveMutex(); + loader_singleton->mutex = tt_mutex_alloc(MutexTypeRecursive); loader_singleton->app_stack_index = -1; memset(loader_singleton->app_stack, 0, sizeof(App) * APP_STACK_SIZE); return loader_singleton; @@ -51,13 +51,13 @@ static void loader_free() { void loader_lock() { tt_assert(loader_singleton); tt_assert(loader_singleton->mutex); - tt_check(xSemaphoreTakeRecursive(loader_singleton->mutex, portMAX_DELAY) == pdPASS); + tt_check(tt_mutex_acquire(loader_singleton->mutex, TtWaitForever) == TtStatusOk); } void loader_unlock() { tt_assert(loader_singleton); tt_assert(loader_singleton->mutex); - tt_check(xSemaphoreGiveRecursive(loader_singleton->mutex) == pdPASS); + tt_check(tt_mutex_release(loader_singleton->mutex) == TtStatusOk); } LoaderStatus loader_start_app(const char* id, bool blocking, Bundle* _Nullable bundle) { diff --git a/tactility/src/services/loader/loader_i.h b/tactility/src/services/loader/loader_i.h index 6626c4a4..605dc949 100644 --- a/tactility/src/services/loader/loader_i.h +++ b/tactility/src/services/loader/loader_i.h @@ -22,8 +22,7 @@ struct Loader { Thread* thread; PubSub* pubsub; MessageQueue* queue; - // TODO: replace with Mutex - SemaphoreHandle_t mutex; + Mutex mutex; int8_t app_stack_index; App app_stack[APP_STACK_SIZE]; }; diff --git a/tests/tactility-core/timer_test.cpp b/tests/tactility-core/timer_test.cpp index 95ea914c..140c1131 100644 --- a/tests/tactility-core/timer_test.cpp +++ b/tests/tactility-core/timer_test.cpp @@ -2,7 +2,6 @@ #include "tactility_core.h" #include "timer.h" - void* timer_callback_context = NULL; static void timer_callback_with_context(void* context) { timer_callback_context = context;