Skip to content

Commit 3333f01

Browse files
committed
init tweak
1 parent 17b5576 commit 3333f01

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/lgfx_user/M5Tab5.hpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class Tab5Display : public lgfx::LGFX_Device
103103
}
104104

105105

106-
bool init(bool use_reset)
106+
bool init()
107107
{
108108
static constexpr int_fast16_t in_i2c_port = 1;// I2C_NUM_1;
109109

@@ -114,15 +114,19 @@ class Tab5Display : public lgfx::LGFX_Device
114114
std::uint32_t id = lgfx::i2c::readRegister8(in_i2c_port, pi4io1_i2c_addr, 0x01).has_value()
115115
&& lgfx::i2c::readRegister8(in_i2c_port, pi4io2_i2c_addr, 0x01).has_value();
116116

117-
if( id == 0 ) return false;
117+
if( id == 0 )
118+
{
119+
ESP_LOGE("LGFX", "M5Tab5 detection failed");
120+
return false;
121+
}
122+
123+
ESP_LOGI("LGFX", "M5Tab5 detected: 0x%x", id);
118124

119125
i2c_write_register8_array(in_i2c_port, pi4io1_i2c_addr, reg_data_io1_1, 400000);
120126
i2c_write_register8_array(in_i2c_port, pi4io2_i2c_addr, reg_data_io2, 400000);
121127
i2c_write_register8_array(in_i2c_port, pi4io1_i2c_addr, reg_data_io1_2, 400000);
122128

123-
auto dev = (lgfx::Panel_Device*)this;
124-
125-
return dev->init(use_reset);
129+
return lgfx::LGFX_Device::init();
126130
}
127131

128132
};

0 commit comments

Comments
 (0)