Tactiliest/tactility/src/lvgl_init.c
Ken Van Hoeylandt 27730260e0
Project restructuring: add tactility-headless (#55)
- Created `tactility-headless` to support ESP32 firmwares that don't require graphics
- `tactility` subproject now contains both PC and ESP32 code (to avoid having to split up `tactility` and `tactility-headless` into separate projects, which would result in a very complex dependency tree)
- `tactility` subproject is now defined as component for ESP32 and as regular module for PC
- Improvements for dispatcher
- Added `project-structure.puml` to docs
- `Gui` service now depends on `Loader` service instead of the reverse
- Added `statusbar_updater` service for updating Wi-Fi and SD card icons
2024-08-31 17:56:28 +02:00

23 lines
820 B
C

#include "lvgl_init_i.h"
#include "preferences.h"
#include "lvgl.h"
void tt_lvgl_init(const HardwareConfig* config) {
SetBacklightDuty set_backlight_duty = config->display.set_backlight_duty;
if (set_backlight_duty != NULL) {
int32_t backlight_duty = 200;
if (!tt_preferences()->opt_int32("display", "backlight_duty", &backlight_duty)) {
tt_preferences()->put_int32("display", "backlight_duty", backlight_duty);
}
int32_t safe_backlight_duty = TT_MIN(backlight_duty, 255);
set_backlight_duty((uint8_t)safe_backlight_duty);
}
int32_t rotation;
if (tt_preferences()->opt_int32("display", "rotation", &rotation)) {
if (rotation != LV_DISPLAY_ROTATION_0) {
lv_disp_set_rotation(lv_disp_get_default(), rotation);
}
}
}