Version 0.4.2, some code cleanup.

Thu, 20 Apr 2023 14:01:29 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Thu, 20 Apr 2023 14:01:29 +0200
changeset 35
9827c5a08c63
parent 34
40231d010111
child 36
7b5c1fbeda7b

Version 0.4.2, some code cleanup.

CMakeLists.txt file | annotate | diff | comparison | revisions
main/task_wifi.c file | annotate | diff | comparison | revisions
--- 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)
--- 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();
 
 	    /*

mercurial