Replaced Logger usage with LOG_x (#548)
This commit is contained in:
committed by
GitHub
parent
ecad2248d9
commit
9d5993930d
@@ -1,14 +1,14 @@
|
||||
#include "Detect.h"
|
||||
|
||||
#include <Tactility/Logger.h>
|
||||
#include <tactility/device.h>
|
||||
#include <tactility/drivers/i2c_controller.h>
|
||||
#include <tactility/log.h>
|
||||
#include <esp_lcd_touch_gt911.h>
|
||||
#include <esp_lcd_touch_st7123.h>
|
||||
#include <freertos/FreeRTOS.h>
|
||||
#include <freertos/task.h>
|
||||
|
||||
static const auto LOGGER = tt::Logger("Tab5Detect");
|
||||
constexpr auto* TAG = "Tab5Detect";
|
||||
|
||||
Tab5Variant detectVariant() {
|
||||
// Allow time for touch IC to fully boot after expander reset in initBoot().
|
||||
@@ -27,19 +27,19 @@ Tab5Variant detectVariant() {
|
||||
// It may also appear at 0x14 (backup) if the pin happened to be driven low
|
||||
if (i2c_controller_has_device_at_address(i2c0, ESP_LCD_TOUCH_IO_I2C_GT911_ADDRESS, PROBE_TIMEOUT) == ERROR_NONE ||
|
||||
i2c_controller_has_device_at_address(i2c0, ESP_LCD_TOUCH_IO_I2C_GT911_ADDRESS_BACKUP, PROBE_TIMEOUT) == ERROR_NONE) {
|
||||
LOGGER.info("Detected GT911 touch — using ILI9881C display");
|
||||
LOG_I(TAG, "Detected GT911 touch — using ILI9881C display");
|
||||
return Tab5Variant::Ili9881c_Gt911;
|
||||
}
|
||||
|
||||
// Probe for ST7123 touch (new variant)
|
||||
if (i2c_controller_has_device_at_address(i2c0, ESP_LCD_TOUCH_IO_I2C_ST7123_ADDRESS, PROBE_TIMEOUT) == ERROR_NONE) {
|
||||
LOGGER.info("Detected ST7123 touch — using ST7123 display");
|
||||
LOG_I(TAG, "Detected ST7123 touch — using ST7123 display");
|
||||
return Tab5Variant::St7123;
|
||||
}
|
||||
|
||||
vTaskDelay(pdMS_TO_TICKS(100));
|
||||
}
|
||||
|
||||
LOGGER.warn("No known touch controller detected, defaulting to ST7123");
|
||||
LOG_W(TAG, "No known touch controller detected, defaulting to ST7123");
|
||||
return Tab5Variant::St7123;
|
||||
}
|
||||
|
||||
@@ -6,14 +6,14 @@
|
||||
|
||||
#include <Gt911Touch.h>
|
||||
#include <PwmBacklight.h>
|
||||
#include <Tactility/Logger.h>
|
||||
#include <Tactility/hal/gpio/Gpio.h>
|
||||
#include <tactility/check.h>
|
||||
#include <tactility/device.h>
|
||||
#include <tactility/log.h>
|
||||
#include <freertos/FreeRTOS.h>
|
||||
#include <freertos/task.h>
|
||||
|
||||
static const auto LOGGER = tt::Logger("Tab5Display");
|
||||
constexpr auto* TAG = "Tab5Display";
|
||||
|
||||
// LCD reset is wired to the PI4IOE5V6408 IO expander (io_expander0, bit 4), pulsed in
|
||||
// Configuration.cpp's initExpander0() before display creation - not a direct SoC GPIO.
|
||||
@@ -55,7 +55,7 @@ static std::shared_ptr<tt::hal::touch::TouchDevice> createSt7123Touch() {
|
||||
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
|
||||
// Initialize PWM backlight
|
||||
if (!driver::pwmbacklight::init(LCD_PIN_BACKLIGHT, 5000, LEDC_TIMER_1, LEDC_CHANNEL_0)) {
|
||||
LOGGER.warn("Failed to initialize backlight");
|
||||
LOG_W(TAG, "Failed to initialize backlight");
|
||||
}
|
||||
|
||||
Tab5Variant variant = detectVariant();
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#include "Ili9881cDisplay.h"
|
||||
#include "ili9881_init_data.h"
|
||||
|
||||
#include <Tactility/Logger.h>
|
||||
#include <esp_lcd_ili9881c.h>
|
||||
#include <tactility/log.h>
|
||||
|
||||
static const auto LOGGER = tt::Logger("ILI9881C");
|
||||
constexpr auto* TAG = "ILI9881C";
|
||||
|
||||
Ili9881cDisplay::~Ili9881cDisplay() {
|
||||
// TODO: This should happen during ::stop(), but this isn't currently exposed
|
||||
@@ -30,11 +30,11 @@ bool Ili9881cDisplay::createMipiDsiBus() {
|
||||
};
|
||||
|
||||
if (esp_ldo_acquire_channel(&ldo_mipi_phy_config, &ldoChannel) != ESP_OK) {
|
||||
LOGGER.error("Failed to acquire LDO channel for MIPI DSI PHY");
|
||||
LOG_E(TAG, "Failed to acquire LDO channel for MIPI DSI PHY");
|
||||
return false;
|
||||
}
|
||||
|
||||
LOGGER.info("Powered on");
|
||||
|
||||
LOG_I(TAG, "Powered on");
|
||||
|
||||
// Create bus
|
||||
// TODO: use MIPI_DSI_PHY_CLK_SRC_DEFAULT() in future ESP-IDF 6.0.0 update with esp_lcd_jd9165 library version 2.x
|
||||
@@ -46,13 +46,13 @@ bool Ili9881cDisplay::createMipiDsiBus() {
|
||||
};
|
||||
|
||||
if (esp_lcd_new_dsi_bus(&bus_config, &mipiDsiBus) != ESP_OK) {
|
||||
LOGGER.error("Failed to create bus");
|
||||
LOG_E(TAG, "Failed to create bus");
|
||||
esp_ldo_release_channel(ldoChannel);
|
||||
ldoChannel = nullptr;
|
||||
return false;
|
||||
}
|
||||
|
||||
LOGGER.info("Bus created");
|
||||
LOG_I(TAG, "Bus created");
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ bool Ili9881cDisplay::createIoHandle(esp_lcd_panel_io_handle_t& ioHandle) {
|
||||
esp_lcd_dbi_io_config_t dbi_config = ILI9881C_PANEL_IO_DBI_CONFIG();
|
||||
|
||||
if (esp_lcd_new_panel_io_dbi(mipiDsiBus, &dbi_config, &ioHandle) != ESP_OK) {
|
||||
LOGGER.error("Failed to create panel IO");
|
||||
LOG_E(TAG, "Failed to create panel IO");
|
||||
esp_lcd_del_dsi_bus(mipiDsiBus);
|
||||
mipiDsiBus = nullptr;
|
||||
esp_ldo_release_channel(ldoChannel);
|
||||
@@ -135,11 +135,11 @@ bool Ili9881cDisplay::createPanelHandle(esp_lcd_panel_io_handle_t ioHandle, cons
|
||||
mutable_panel_config.vendor_config = &vendor_config;
|
||||
|
||||
if (esp_lcd_new_panel_ili9881c(ioHandle, &mutable_panel_config, &panelHandle) != ESP_OK) {
|
||||
LOGGER.error("Failed to create panel");
|
||||
LOG_E(TAG, "Failed to create panel");
|
||||
return false;
|
||||
}
|
||||
|
||||
LOGGER.info("Panel created successfully");
|
||||
LOG_I(TAG, "Panel created successfully");
|
||||
// Defer reset/init to base class applyConfiguration to avoid double initialization
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#include "St7123Display.h"
|
||||
#include "st7123_init_data.h"
|
||||
|
||||
#include <Tactility/Logger.h>
|
||||
#include <esp_lcd_st7123.h>
|
||||
#include <tactility/log.h>
|
||||
|
||||
static const auto LOGGER = tt::Logger("St7123");
|
||||
constexpr auto* TAG = "St7123";
|
||||
|
||||
St7123Display::~St7123Display() {
|
||||
// TODO: This should happen during ::stop(), but this isn't currently exposed
|
||||
@@ -30,11 +30,11 @@ bool St7123Display::createMipiDsiBus() {
|
||||
};
|
||||
|
||||
if (esp_ldo_acquire_channel(&ldo_mipi_phy_config, &ldoChannel) != ESP_OK) {
|
||||
LOGGER.error("Failed to acquire LDO channel for MIPI DSI PHY");
|
||||
LOG_E(TAG, "Failed to acquire LDO channel for MIPI DSI PHY");
|
||||
return false;
|
||||
}
|
||||
|
||||
LOGGER.info("Powered on");
|
||||
LOG_I(TAG, "Powered on");
|
||||
|
||||
const esp_lcd_dsi_bus_config_t bus_config = {
|
||||
.bus_id = 0,
|
||||
@@ -44,13 +44,13 @@ bool St7123Display::createMipiDsiBus() {
|
||||
};
|
||||
|
||||
if (esp_lcd_new_dsi_bus(&bus_config, &mipiDsiBus) != ESP_OK) {
|
||||
LOGGER.error("Failed to create bus");
|
||||
LOG_E(TAG, "Failed to create bus");
|
||||
esp_ldo_release_channel(ldoChannel);
|
||||
ldoChannel = nullptr;
|
||||
return false;
|
||||
}
|
||||
|
||||
LOGGER.info("Bus created");
|
||||
LOG_I(TAG, "Bus created");
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ bool St7123Display::createIoHandle(esp_lcd_panel_io_handle_t& ioHandle) {
|
||||
};
|
||||
|
||||
if (esp_lcd_new_panel_io_dbi(mipiDsiBus, &dbi_config, &ioHandle) != ESP_OK) {
|
||||
LOGGER.error("Failed to create panel IO");
|
||||
LOG_E(TAG, "Failed to create panel IO");
|
||||
esp_lcd_del_dsi_bus(mipiDsiBus);
|
||||
mipiDsiBus = nullptr;
|
||||
esp_ldo_release_channel(ldoChannel);
|
||||
@@ -130,11 +130,11 @@ bool St7123Display::createPanelHandle(esp_lcd_panel_io_handle_t ioHandle, const
|
||||
mutable_panel_config.vendor_config = &vendor_config;
|
||||
|
||||
if (esp_lcd_new_panel_st7123(ioHandle, &mutable_panel_config, &panelHandle) != ESP_OK) {
|
||||
LOGGER.error("Failed to create panel");
|
||||
LOG_E(TAG, "Failed to create panel");
|
||||
return false;
|
||||
}
|
||||
|
||||
LOGGER.info("Panel created successfully");
|
||||
LOG_I(TAG, "Panel created successfully");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#include "St7123Touch.h"
|
||||
|
||||
#include <Tactility/Logger.h>
|
||||
#include <tactility/drivers/esp32_i2c_master.h>
|
||||
#include <tactility/log.h>
|
||||
#include <esp_lcd_touch_st7123.h>
|
||||
#include <esp_err.h>
|
||||
|
||||
static const auto LOGGER = tt::Logger("ST7123Touch");
|
||||
constexpr auto* TAG = "ST7123Touch";
|
||||
|
||||
bool St7123Touch::createIoHandle(esp_lcd_panel_io_handle_t& outHandle) {
|
||||
esp_lcd_panel_io_i2c_config_t io_config = ESP_LCD_TOUCH_IO_I2C_ST7123_CONFIG();
|
||||
|
||||
Reference in New Issue
Block a user