diff --git a/pio-tools/cxx_flags.py b/pio-tools/cxx_flags.py deleted file mode 100644 index 74cf99e7c..000000000 --- a/pio-tools/cxx_flags.py +++ /dev/null @@ -1,4 +0,0 @@ -Import("env") - -# General options that are passed to the C++ compiler -env.Append(CXXFLAGS=["-fpermissive"]) \ No newline at end of file diff --git a/platformio_tasmota_cenv_sample.ini b/platformio_tasmota_cenv_sample.ini index 7fd6a3d9f..e48875231 100644 --- a/platformio_tasmota_cenv_sample.ini +++ b/platformio_tasmota_cenv_sample.ini @@ -90,8 +90,6 @@ build_flags = ${env:tasmota32_base.build_flags} -DUSE_BLE_ESP32 -DUSE_MI_ESP32 ;-DESP32_STAGE=true -extra_scripts = ${env:tasmota32_base.extra_scripts} - pre:pio-tools/cxx_flags.py lib_extra_dirs = lib/libesp32 lib/libesp32_div lib/libesp32_lvgl diff --git a/tasmota/support.ino b/tasmota/support.ino index 3c792c84e..fad51a83e 100644 --- a/tasmota/support.ino +++ b/tasmota/support.ino @@ -136,20 +136,20 @@ class TasAutoMutex { int maxWait; const char *name; public: - TasAutoMutex(void ** mutex, const char *name = "", int maxWait = 40, bool take=true); + TasAutoMutex(SemaphoreHandle_t* mutex, const char *name = "", int maxWait = 40, bool take=true); ~TasAutoMutex(); void give(); void take(); - static void init(void ** ptr); + static void init(SemaphoreHandle_t* ptr); }; ////////////////////////////////////////// -TasAutoMutex::TasAutoMutex(void **mutex, const char *name, int maxWait, bool take) { +TasAutoMutex::TasAutoMutex(SemaphoreHandle_t*mutex, const char *name, int maxWait, bool take) { if (mutex) { if (!(*mutex)){ TasAutoMutex::init(mutex); } - this->mutex = (SemaphoreHandle_t)*mutex; + this->mutex = *mutex; this->maxWait = maxWait; this->name = name; if (take) { @@ -172,9 +172,9 @@ TasAutoMutex::~TasAutoMutex() { } } -void TasAutoMutex::init(void ** ptr) { +void TasAutoMutex::init(SemaphoreHandle_t* ptr) { SemaphoreHandle_t mutex = xSemaphoreCreateRecursiveMutex(); - (*ptr) = (void *) mutex; + (*ptr) = mutex; // needed, else for ESP8266 as we will initialis more than once in logging // (*ptr) = (void *) 1; } @@ -2327,7 +2327,7 @@ bool NeedLogRefresh(uint32_t req_loglevel, uint32_t index) { #ifdef ESP32 // this takes the mutex, and will be release when the class is destroyed - // i.e. when the functon leaves You CAN call mutex.give() to leave early. - TasAutoMutex mutex(&TasmotaGlobal.log_buffer_mutex); + TasAutoMutex mutex((SemaphoreHandle_t *)&TasmotaGlobal.log_buffer_mutex); #endif // ESP32 // Skip initial buffer fill @@ -2349,7 +2349,7 @@ bool GetLog(uint32_t req_loglevel, uint32_t* index_p, char** entry_pp, size_t* l #ifdef ESP32 // this takes the mutex, and will be release when the class is destroyed - // i.e. when the functon leaves You CAN call mutex.give() to leave early. - TasAutoMutex mutex(&TasmotaGlobal.log_buffer_mutex); + TasAutoMutex mutex((SemaphoreHandle_t *)&TasmotaGlobal.log_buffer_mutex); #endif // ESP32 if (!index) { // Dump all @@ -2396,7 +2396,7 @@ void AddLogData(uint32_t loglevel, const char* log_data, const char* log_data_pa #ifdef ESP32 // this takes the mutex, and will be release when the class is destroyed - // i.e. when the functon leaves You CAN call mutex.give() to leave early. - TasAutoMutex mutex(&TasmotaGlobal.log_buffer_mutex); + TasAutoMutex mutex((SemaphoreHandle_t *)&TasmotaGlobal.log_buffer_mutex); #endif // ESP32 char mxtime[14]; // "13:45:21.999 " diff --git a/tasmota/xsns_62_esp32_mi_ble.ino b/tasmota/xsns_62_esp32_mi_ble.ino index 635204cb0..a0f0f0d31 100644 --- a/tasmota/xsns_62_esp32_mi_ble.ino +++ b/tasmota/xsns_62_esp32_mi_ble.ino @@ -343,7 +343,7 @@ std::vector MIBLEsensors; std::vector MIBLEbindKeys; std::vector MIBLEBlockList; -void *slotmutex = nullptr; +SemaphoreHandle_t slotmutex = (SemaphoreHandle_t) nullptr; /*********************************************************************************************\ * constants