diff --git a/src/main.cpp b/src/main.cpp index f6e88b75..37d71674 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -232,21 +232,6 @@ void setup() { } #endif -// initialize bme -#ifdef HAS_BME - strcat_P(features, " BME"); - if (bme_init()) { - ESP_LOGI(TAG, "Starting BMEloop..."); - xTaskCreatePinnedToCore(bme_loop, // task function - "bmeloop", // name of task - 4096, // stack size of task - (void *)1, // parameter of the task - 0, // priority of the task - &BmeTask, // task handle - 1); // CPU core - } -#endif - // initialize sensors #ifdef HAS_SENSORS strcat_P(features, " SENS"); @@ -349,6 +334,22 @@ void setup() { &wifiSwitchTask, // task handle 0); // CPU core + // initialize bme +#ifdef HAS_BME + strcat_P(features, " BME"); + if (bme_init()) { + ESP_LOGI(TAG, "Starting BMEloop..."); + xTaskCreatePinnedToCore(bme_loop, // task function + "bmeloop", // name of task + 4096, // stack size of task + (void *)1, // parameter of the task + 0, // priority of the task + &BmeTask, // task handle + 1); // CPU core + } + delay(2000); // time for initializing i2c sensor +#endif + // start timer triggered interrupts ESP_LOGI(TAG, "Starting Interrupts..."); #ifdef HAS_DISPLAY