mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-18 19:03:16 +00:00
* **New Features** * Added a standalone LVGL module and enabled LVGL support in the simulator for richer local UI testing. * **Refactor** * HAL and LVGL split into distinct modules; startup and device attach/detach flows reorganized for clearer lifecycle management. * Public APIs tightened with clearer nullability/documentation. * **Bug Fixes** * More consistent LVGL start/stop and device attach/detach behavior for improved stability.
43 lines
871 B
C++
43 lines
871 B
C++
#include "Main.h"
|
|
#include <Tactility/Thread.h>
|
|
#include <Tactility/TactilityCore.h>
|
|
|
|
#include "FreeRTOS.h"
|
|
#include "task.h"
|
|
|
|
static const auto LOGGER = tt::Logger("FreeRTOS");
|
|
|
|
namespace simulator {
|
|
|
|
MainFunction mainFunction = nullptr;
|
|
|
|
void setMain(MainFunction newMainFunction) {
|
|
mainFunction = newMainFunction;
|
|
}
|
|
|
|
static void freertosMainTask(void* parameter) {
|
|
LOGGER.info("starting app_main()");
|
|
assert(simulator::mainFunction);
|
|
mainFunction();
|
|
LOGGER.info("returned from app_main()");
|
|
vTaskDelete(nullptr);
|
|
}
|
|
|
|
void freertosMain() {
|
|
BaseType_t task_result = xTaskCreate(
|
|
freertosMainTask,
|
|
"main",
|
|
8192,
|
|
nullptr,
|
|
static_cast<UBaseType_t>(tt::Thread::Priority::Normal),
|
|
nullptr
|
|
);
|
|
|
|
assert(task_result == pdTRUE);
|
|
|
|
// Blocks forever
|
|
vTaskStartScheduler();
|
|
}
|
|
|
|
} // namespace
|