This commit is contained in:
Ken Van Hoeylandt 2026-01-13 08:45:17 +01:00
parent 939aebfcc3
commit e73b5f317f
4 changed files with 8 additions and 6 deletions

View File

@ -61,5 +61,5 @@ std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
}); });
const auto display = std::make_shared<Jd9165Display>(configuration); const auto display = std::make_shared<Jd9165Display>(configuration);
return std::reinterpret_pointer_cast<tt::hal::display::DisplayDevice>(display); return std::static_pointer_cast<tt::hal::display::DisplayDevice>(display);
} }

View File

@ -68,7 +68,7 @@ static bool initBoot() {
constexpr auto IO_EXPANDER2_ADDRESS = 0x44; constexpr auto IO_EXPANDER2_ADDRESS = 0x44;
if (!i2c::masterWriteRegisterArray(I2C_NUM_0, IO_EXPANDER2_ADDRESS, reg_data_io2, sizeof(reg_data_io2))) { if (!i2c::masterWriteRegisterArray(I2C_NUM_0, IO_EXPANDER2_ADDRESS, reg_data_io2, sizeof(reg_data_io2))) {
LOGGER.error("IO expander 1 init failed in phase 2"); LOGGER.error("IO expander 2 init failed");
return false; return false;
} }
@ -77,7 +77,7 @@ static bool initBoot() {
tt::kernel::delayTicks(10); tt::kernel::delayTicks(10);
if (!i2c::masterWriteRegisterArray(I2C_NUM_0, IO_EXPANDER1_ADDRESS, reg_data_io1_2, sizeof(reg_data_io1_2))) { if (!i2c::masterWriteRegisterArray(I2C_NUM_0, IO_EXPANDER1_ADDRESS, reg_data_io1_2, sizeof(reg_data_io1_2))) {
LOGGER.error("IO expander 2 init failed"); LOGGER.error("IO expander 1 init failed in phase 2");
return false; return false;
} }

View File

@ -60,5 +60,5 @@ std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
}); });
const auto display = std::make_shared<Ili9881cDisplay>(configuration); const auto display = std::make_shared<Ili9881cDisplay>(configuration);
return std::reinterpret_pointer_cast<tt::hal::display::DisplayDevice>(display); return std::static_pointer_cast<tt::hal::display::DisplayDevice>(display);
} }

View File

@ -88,7 +88,8 @@ esp_lcd_panel_dev_config_t Ili9881cDisplay::createPanelConfig(std::shared_ptr<Es
bool Ili9881cDisplay::createPanelHandle(esp_lcd_panel_io_handle_t ioHandle, const esp_lcd_panel_dev_config_t& panelConfig, esp_lcd_panel_handle_t& panelHandle) { bool Ili9881cDisplay::createPanelHandle(esp_lcd_panel_io_handle_t ioHandle, const esp_lcd_panel_dev_config_t& panelConfig, esp_lcd_panel_handle_t& panelHandle) {
// Based on BSP: https://github.com/espressif/esp-bsp/blob/master/bsp/m5stack_tab5/README.md // Based on BSP: https://github.com/espressif/esp-bsp/blob/master/bsp/m5stack_tab5/README.md
static const esp_lcd_dpi_panel_config_t dpi_config = { // TODO: undo static
static esp_lcd_dpi_panel_config_t dpi_config = {
.virtual_channel = 0, .virtual_channel = 0,
.dpi_clk_src = MIPI_DSI_DPI_CLK_SRC_DEFAULT, .dpi_clk_src = MIPI_DSI_DPI_CLK_SRC_DEFAULT,
.dpi_clock_freq_mhz = 60, .dpi_clock_freq_mhz = 60,
@ -113,7 +114,8 @@ bool Ili9881cDisplay::createPanelHandle(esp_lcd_panel_io_handle_t ioHandle, cons
} }
}; };
ili9881c_vendor_config_t vendor_config = { // TODO: undo static
static ili9881c_vendor_config_t vendor_config = {
.init_cmds = disp_init_data, .init_cmds = disp_init_data,
.init_cmds_size = std::size(disp_init_data), .init_cmds_size = std::size(disp_init_data),
.mipi_config = { .mipi_config = {