Tactility/Platforms/platform-posix/freertos/freertos_task_hooks.c
Ken Van Hoeylandt f8172446fd
App loading improvements and more (#675)
- External apps can opt into automatic cleanup when they exit, including tracked tasks, threads, files, directories, and memory.
- App-relative file paths resolve against the app’s working directory, with `.` and `..` normalized.
- The shell identifies ELF binaries that cannot be executed instead of treating them as scripts.
- Shared icon fonts now offer distinct default and large sizes, with updated icons across the interface.
- ESP32 apps can load additional ELF formats when address mirroring is enabled.
- Terminal colors render clearly on monochrome displays, and toolbar buttons have cleaner styling.
- GPS settings safely refresh their device list when their window is hidden or its widgets are destroyed.
2026-10-06 07:45:58 +02:00

26 lines
976 B
C

// SPDX-License-Identifier: Apache-2.0
#include "freertos_task_hooks.h"
static FreeRtosTaskCreateHook create_hook = NULL;
static FreeRtosTaskDeleteHook delete_hook = NULL;
void freertos_set_task_hooks(FreeRtosTaskCreateHook create, FreeRtosTaskDeleteHook delete_task) {
create_hook = create;
delete_hook = delete_task;
}
BaseType_t xTaskCreate(TaskFunction_t function, const char* const name, const configSTACK_DEPTH_TYPE stack_depth, void* const parameter, UBaseType_t priority, TaskHandle_t* const out_handle) {
if (create_hook != NULL) {
return create_hook(__builtin_return_address(0), function, name, stack_depth, parameter, priority, out_handle);
}
return freertos_real_xTaskCreate(function, name, stack_depth, parameter, priority, out_handle);
}
void vTaskDelete(TaskHandle_t handle) {
if (delete_hook != NULL) {
delete_hook(__builtin_return_address(0), handle);
return;
}
freertos_real_vTaskDelete(handle);
}