I2C improvements and fixes (#201)

- Show I2C device name in I2C Scanner app
- Register various I2C devices from board implementations
- Fix M5Stack Core2 power status
- Fix pre-allocation issue in `hal::Device`
This commit is contained in:
Ken Van Hoeylandt
2025-02-02 17:54:36 +01:00
committed by GitHub
parent 2e61aea93c
commit c0f4738abe
13 changed files with 133 additions and 59 deletions
+6 -6
View File
@@ -223,7 +223,7 @@ bool UnPhoneFeatures::init() {
void UnPhoneFeatures::printInfo() const {
esp_io_expander_print_state(ioExpander);
batteryManagement.printInfo();
batteryManagement->printInfo();
bool backlight_power;
const char* backlight_power_state = getBacklightPower(backlight_power) && backlight_power ? "on" : "off";
TT_LOG_I(TAG, "Backlight: %s", backlight_power_state);
@@ -282,12 +282,12 @@ void UnPhoneFeatures::turnPeripheralsOff() const {
bool UnPhoneFeatures::setShipping(bool on) const {
if (on) {
TT_LOG_W(TAG, "setShipping: on");
batteryManagement.setWatchDogTimer(Bq24295::WatchDogTimer::Disabled);
batteryManagement.setBatFetOn(false);
batteryManagement->setWatchDogTimer(Bq24295::WatchDogTimer::Disabled);
batteryManagement->setBatFetOn(false);
} else {
TT_LOG_W(TAG, "setShipping: off");
batteryManagement.setWatchDogTimer(Bq24295::WatchDogTimer::Enabled40s);
batteryManagement.setBatFetOn(true);
batteryManagement->setWatchDogTimer(Bq24295::WatchDogTimer::Enabled40s);
batteryManagement->setBatFetOn(true);
}
return true;
}
@@ -297,5 +297,5 @@ void UnPhoneFeatures::wakeOnPowerSwitch() const {
}
bool UnPhoneFeatures::isUsbPowerConnected() const {
return batteryManagement.isUsbPowerConnected();
return batteryManagement->isUsbPowerConnected();
}