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:
committed by
GitHub
parent
719f7bcece
commit
f620255c41
@@ -1,6 +1,6 @@
|
||||
#include "Ssd1306Display.h"
|
||||
|
||||
#include <Tactility/Log.h>
|
||||
#include <Tactility/Logger.h>
|
||||
#include <esp_lcd_panel_commands.h>
|
||||
#include <esp_lcd_panel_dev.h>
|
||||
#include <esp_lcd_panel_ssd1306.h>
|
||||
@@ -10,7 +10,7 @@
|
||||
#include <freertos/FreeRTOS.h>
|
||||
#include <freertos/task.h>
|
||||
|
||||
#define TAG "ssd1306_display"
|
||||
static const auto LOGGER = tt::Logger("Ssd1306Display");
|
||||
|
||||
// SSD1306 commands
|
||||
#define SSD1306_CMD_SET_CHARGE_PUMP 0x8D
|
||||
@@ -31,7 +31,7 @@ static bool ssd1306_i2c_send_cmd(i2c_port_t port, uint8_t addr, uint8_t cmd) {
|
||||
uint8_t data[2] = {0x00, cmd}; // 0x00 = command mode
|
||||
esp_err_t ret = i2c_master_write_to_device(port, addr, data, sizeof(data), pdMS_TO_TICKS(1000));
|
||||
if (ret != ESP_OK) {
|
||||
TT_LOG_E(TAG, "Failed to send command 0x%02X: %d", cmd, ret);
|
||||
LOGGER.error("Failed to send command 0x{:02X}: {}", cmd, ret);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -49,7 +49,7 @@ bool Ssd1306Display::createIoHandle(esp_lcd_panel_io_handle_t& ioHandle) {
|
||||
};
|
||||
|
||||
if (esp_lcd_new_panel_io_i2c((esp_lcd_i2c_bus_handle_t)configuration->port, &io_config, &ioHandle) != ESP_OK) {
|
||||
TT_LOG_E(TAG, "Failed to create IO handle");
|
||||
LOGGER.error("Failed to create IO handle");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ bool Ssd1306Display::createPanelHandle(esp_lcd_panel_io_handle_t ioHandle, esp_l
|
||||
#endif
|
||||
|
||||
if (esp_lcd_new_panel_ssd1306(ioHandle, &panel_config, &panelHandle) != ESP_OK) {
|
||||
TT_LOG_E(TAG, "Failed to create panel");
|
||||
LOGGER.error("Failed to create panel");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ bool Ssd1306Display::createPanelHandle(esp_lcd_panel_io_handle_t ioHandle, esp_l
|
||||
auto port = configuration->port;
|
||||
auto addr = configuration->deviceAddress;
|
||||
|
||||
TT_LOG_I(TAG, "Sending Heltec V3 custom init sequence");
|
||||
LOGGER.info("Sending Heltec V3 custom init sequence");
|
||||
|
||||
// Display off while configuring
|
||||
ssd1306_i2c_send_cmd(port, addr, 0xAE);
|
||||
@@ -170,7 +170,7 @@ bool Ssd1306Display::createPanelHandle(esp_lcd_panel_io_handle_t ioHandle, esp_l
|
||||
|
||||
vTaskDelay(pdMS_TO_TICKS(100)); // Let display stabilize
|
||||
|
||||
TT_LOG_I(TAG, "Heltec V3 display initialized successfully");
|
||||
LOGGER.info("Heltec V3 display initialized successfully");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user