New logging and more (#446)

- `TT_LOG_*` macros are replaced by `Logger` via `#include<Tactility/Logger.h>`
- Changed default timezone to Europe/Amsterdam
- Fix for logic bug in unPhone hardware
- Fix for init/deinit in DRV2605 driver
- Other fixes
- Removed optimization that broke unPhone (disabled the moving of heap-related functions to flash)
This commit is contained in:
Ken Van Hoeylandt
2026-01-06 22:35:39 +01:00
committed by GitHub
parent 719f7bcece
commit f620255c41
188 changed files with 1973 additions and 1755 deletions
+15 -15
View File
@@ -1,13 +1,13 @@
#include "EspLcdDisplayV2.h"
#include "EspLcdDisplayDriver.h"
#include <assert.h>
#include <cassert>
#include <esp_lvgl_port_disp.h>
#include <Tactility/Check.h>
#include <Tactility/LogEsp.h>
#include <Tactility/Logger.h>
#include <Tactility/hal/touch/TouchDevice.h>
constexpr auto* TAG = "EspLcdDispV2";
static const auto LOGGER = tt::Logger("EspLcdDispV2");
inline unsigned int getBufferSize(const std::shared_ptr<EspLcdConfiguration>& configuration) {
if (configuration->bufferSize != DEFAULT_BUFFER_SIZE) {
@@ -25,17 +25,17 @@ EspLcdDisplayV2::~EspLcdDisplayV2() {
bool EspLcdDisplayV2::applyConfiguration() const {
if (esp_lcd_panel_reset(panelHandle) != ESP_OK) {
TT_LOG_E(TAG, "Failed to reset panel");
LOGGER.error("Failed to reset panel");
return false;
}
if (esp_lcd_panel_init(panelHandle) != ESP_OK) {
TT_LOG_E(TAG, "Failed to init panel");
LOGGER.error("Failed to init panel");
return false;
}
if (esp_lcd_panel_invert_color(panelHandle, configuration->invertColor) != ESP_OK) {
TT_LOG_E(TAG, "Failed to set panel to invert");
LOGGER.error("Failed to set panel to invert");
return false;
}
@@ -43,27 +43,27 @@ bool EspLcdDisplayV2::applyConfiguration() const {
int gap_x = configuration->swapXY ? configuration->gapY : configuration->gapX;
int gap_y = configuration->swapXY ? configuration->gapX : configuration->gapY;
if (esp_lcd_panel_set_gap(panelHandle, gap_x, gap_y) != ESP_OK) {
TT_LOG_E(TAG, "Failed to set panel gap");
LOGGER.error("Failed to set panel gap");
return false;
}
if (esp_lcd_panel_swap_xy(panelHandle, configuration->swapXY) != ESP_OK) {
TT_LOG_E(TAG, "Failed to swap XY ");
LOGGER.error("Failed to swap XY ");
return false;
}
if (esp_lcd_panel_mirror(panelHandle, configuration->mirrorX, configuration->mirrorY) != ESP_OK) {
TT_LOG_E(TAG, "Failed to set panel to mirror");
LOGGER.error("Failed to set panel to mirror");
return false;
}
if (esp_lcd_panel_invert_color(panelHandle, configuration->invertColor) != ESP_OK) {
TT_LOG_E(TAG, "Failed to set panel to invert");
LOGGER.error("Failed to set panel to invert");
return false;
}
if (esp_lcd_panel_disp_on_off(panelHandle, true) != ESP_OK) {
TT_LOG_E(TAG, "Failed to turn display on");
LOGGER.error("Failed to turn display on");
return false;
}
@@ -72,14 +72,14 @@ bool EspLcdDisplayV2::applyConfiguration() const {
bool EspLcdDisplayV2::start() {
if (!createIoHandle(ioHandle)) {
TT_LOG_E(TAG, "Failed to create IO handle");
LOGGER.error("Failed to create IO handle");
return false;
}
esp_lcd_panel_dev_config_t panel_config = createPanelConfig(configuration, configuration->resetPin);
if (!createPanelHandle(ioHandle, panel_config, panelHandle)) {
TT_LOG_E(TAG, "Failed to create panel handle");
LOGGER.error("Failed to create panel handle");
esp_lcd_panel_io_del(ioHandle);
ioHandle = nullptr;
return false;
@@ -111,7 +111,7 @@ bool EspLcdDisplayV2::stop() {
}
if (displayDriver != nullptr && displayDriver.use_count() > 1) {
TT_LOG_W(TAG, "DisplayDriver is still in use.");
LOGGER.warn("DisplayDriver is still in use.");
}
return true;
@@ -121,7 +121,7 @@ bool EspLcdDisplayV2::startLvgl() {
assert(lvglDisplay == nullptr);
if (displayDriver != nullptr && displayDriver.use_count() > 1) {
TT_LOG_W(TAG, "DisplayDriver is still in use.");
LOGGER.warn("DisplayDriver is still in use.");
}
auto lvgl_port_config = getLvglPortDisplayConfig(configuration, ioHandle, panelHandle);