From 7f066f338fa16d519ce5d2e021d77a5a961de70a Mon Sep 17 00:00:00 2001 From: Klaus K Wilting Date: Wed, 26 Dec 2018 13:00:32 +0100 Subject: [PATCH] changed init order of BME loop --- src/main.cpp | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) 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