Various improvements (#32)

- Set DPI for Waveshare S3 board
- Cleanup whitespace in test
- Replace FreeRTOS semaphore in `Loader` to `Mutex`
This commit is contained in:
Ken Van Hoeylandt 2024-02-03 15:45:53 +01:00 committed by GitHub
parent 4f89918e91
commit 69165263f1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 5 additions and 9 deletions

View File

@ -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))

View File

@ -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

View File

@ -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) {

View File

@ -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];
};

View File

@ -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;