# HG changeset patch # User Michiel Broek # Date 1681992089 -7200 # Node ID 9827c5a08c63f252d8c3d63a7851c67a72c291a8 # Parent 40231d010111f47c2f4186bf8a7d5191be64ff7a Version 0.4.2, some code cleanup. diff -r 40231d010111 -r 9827c5a08c63 CMakeLists.txt --- a/CMakeLists.txt Wed Apr 19 15:38:42 2023 +0200 +++ b/CMakeLists.txt Thu Apr 20 14:01:29 2023 +0200 @@ -4,7 +4,7 @@ # CMakeLists in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.16) -set(PROJECT_VER "0.4.1") +set(PROJECT_VER "0.4.2") set(PROJECT_NAME "iotbalkon") set(EXTRA_COMPONENT_DIRS esp-idf-lib/components) diff -r 40231d010111 -r 9827c5a08c63 main/task_wifi.c --- a/main/task_wifi.c Wed Apr 19 15:38:42 2023 +0200 +++ b/main/task_wifi.c Thu Apr 20 14:01:29 2023 +0200 @@ -55,7 +55,6 @@ } - static void wifi_event_handler(void* arg, esp_event_base_t event_base, int32_t event_id, void* event_data) { switch (event_id) { @@ -75,7 +74,7 @@ wifi_ap_record_t ap_info; esp_wifi_sta_get_ap_info(&ap_info); ESP_LOGI(TAG, "Event STA connected rssi=%d", ap_info.rssi); - if (xSemaphoreTake(xSemaphoreWiFi, 35) == pdTRUE) { + if (xSemaphoreTake(xSemaphoreWiFi, 25) == pdTRUE) { wifi_state->STA_connected = true; wifi_state->STA_rssi = ap_info.rssi; xSemaphoreGive(xSemaphoreWiFi); @@ -222,8 +221,6 @@ void task_wifi( void * pvParameters ) { -// uint64_t starttime = 0; - ESP_LOGI(TAG, "Starting WiFi task"); esp_log_level_set("wifi", ESP_LOG_ERROR); @@ -252,8 +249,7 @@ /* * Actions that can trigger: request a connection or a disconnection */ - uxBits = xEventGroupWaitBits(xEventGroupWifi, TASK_WIFI_REQUEST_STA_CONNECT | TASK_WIFI_REQUEST_STA_DISCONNECT, - pdFALSE, pdFALSE, portMAX_DELAY ); + uxBits = xEventGroupWaitBits(xEventGroupWifi, TASK_WIFI_REQUEST_STA_CONNECT | TASK_WIFI_REQUEST_STA_DISCONNECT, pdFALSE, pdFALSE, portMAX_DELAY ); if (uxBits & TASK_WIFI_REQUEST_STA_DISCONNECT) { /* @@ -267,12 +263,10 @@ * Finally: release the request bit */ xEventGroupClearBits(xEventGroupWifi, TASK_WIFI_REQUEST_STA_DISCONNECT); -// ESP_LOGI(TAG, "Connection time %llu", (esp_timer_get_time() / 1000) - starttime); } else if (uxBits & TASK_WIFI_REQUEST_STA_CONNECT) { ESP_LOGI(TAG, "Request STA connect `%s' `%s'", ESP_WIFI_SSID, ESP_WIFI_PASS); -// starttime = esp_timer_get_time() / 1000; wifi_connect(); /*