do i2cscan earlier in main.cpp

This commit is contained in:
Klaus K Wilting 2020-05-09 13:41:19 +02:00
parent c4c817828e
commit 2a7c020e1b

View File

@ -193,6 +193,9 @@ void setup() {
// read (and initialize on first run) runtime settings from NVRAM // read (and initialize on first run) runtime settings from NVRAM
loadConfig(); // includes initialize if necessary loadConfig(); // includes initialize if necessary
// now that we are powered, we scan i2c bus for devices
i2c_scan();
// initialize display // initialize display
#ifdef HAS_DISPLAY #ifdef HAS_DISPLAY
strcat_P(features, " OLED"); strcat_P(features, " OLED");
@ -201,9 +204,6 @@ void setup() {
dp_init(RTC_runmode == RUNMODE_POWERCYCLE ? true : false); dp_init(RTC_runmode == RUNMODE_POWERCYCLE ? true : false);
#endif #endif
// scan i2c bus for devices
i2c_scan();
#ifdef BOARD_HAS_PSRAM #ifdef BOARD_HAS_PSRAM
assert(psramFound()); assert(psramFound());
ESP_LOGI(TAG, "PSRAM found and initialized"); ESP_LOGI(TAG, "PSRAM found and initialized");