mirror of
https://github.com/meshtastic/firmware.git
synced 2025-05-02 03:56:47 +00:00
Place PMU initialization before scanI2Cdevice
This commit is contained in:
parent
43f769ebac
commit
60fdf9fcb2
21
src/main.cpp
21
src/main.cpp
@ -246,6 +246,15 @@ void setup()
|
|||||||
digitalWrite(PIN_3V3_EN, 1);
|
digitalWrite(PIN_3V3_EN, 1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
// Currently only the tbeam has a PMU
|
||||||
|
// PMU initialization needs to be placed before scanI2Cdevice
|
||||||
|
power = new Power();
|
||||||
|
power->setStatusHandler(powerStatus);
|
||||||
|
powerStatus->observe(&power->newStatus);
|
||||||
|
power->setup(); // Must be after status handler is installed, so that handler gets notified of the initial configuration
|
||||||
|
|
||||||
|
|
||||||
#ifdef LILYGO_TBEAM_S3_CORE
|
#ifdef LILYGO_TBEAM_S3_CORE
|
||||||
// In T-Beam-S3-core, the I2C device cannot be scanned before power initialization, otherwise the device will be stuck
|
// In T-Beam-S3-core, the I2C device cannot be scanned before power initialization, otherwise the device will be stuck
|
||||||
// PCF8563 RTC in tbeam-s3 uses Wire1 to share I2C bus
|
// PCF8563 RTC in tbeam-s3 uses Wire1 to share I2C bus
|
||||||
@ -254,11 +263,10 @@ void setup()
|
|||||||
rtc_found = PCF8563_RTC;
|
rtc_found = PCF8563_RTC;
|
||||||
DEBUG_MSG("PCF8563 RTC found\n");
|
DEBUG_MSG("PCF8563 RTC found\n");
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
// We need to scan here to decide if we have a screen for nodeDB.init()
|
|
||||||
scanI2Cdevice();
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// We need to scan here to decide if we have a screen for nodeDB.init()
|
||||||
|
scanI2Cdevice();
|
||||||
|
|
||||||
#ifdef HAS_SDCARD
|
#ifdef HAS_SDCARD
|
||||||
setupSDCard();
|
setupSDCard();
|
||||||
@ -298,17 +306,12 @@ void setup()
|
|||||||
|
|
||||||
playStartMelody();
|
playStartMelody();
|
||||||
|
|
||||||
// Currently only the tbeam has a PMU
|
|
||||||
power = new Power();
|
|
||||||
power->setStatusHandler(powerStatus);
|
|
||||||
powerStatus->observe(&power->newStatus);
|
|
||||||
power->setup(); // Must be after status handler is installed, so that handler gets notified of the initial configuration
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Repeat the scanning for I2C devices after power initialization or look for 'latecomers'.
|
* Repeat the scanning for I2C devices after power initialization or look for 'latecomers'.
|
||||||
* Boards with an PMU need to be powered on to correctly scan to the device address, such as t-beam-s3-core
|
* Boards with an PMU need to be powered on to correctly scan to the device address, such as t-beam-s3-core
|
||||||
*/
|
*/
|
||||||
scanI2Cdevice();
|
// scanI2Cdevice();
|
||||||
|
|
||||||
// fixed screen override?
|
// fixed screen override?
|
||||||
if (config.display.oled != Config_DisplayConfig_OledType_OLED_AUTO)
|
if (config.display.oled != Config_DisplayConfig_OledType_OLED_AUTO)
|
||||||
|
Loading…
Reference in New Issue
Block a user