From 5bccc189b5447bcabe0624caa712c6dae99b6cfd Mon Sep 17 00:00:00 2001 From: Pawel Jalocha Date: Tue, 27 Oct 2020 23:45:07 +0000 Subject: [PATCH] Prepare for more regular WiFi code --- main/{wifi.cpp => aprs.cpp} | 6 +++--- main/{wifi.h => aprs.h} | 2 +- main/main.cpp | 8 ++++---- main/parameters.h | 12 ++++++------ 4 files changed, 14 insertions(+), 14 deletions(-) rename main/{wifi.cpp => aprs.cpp} (99%) rename main/{wifi.h => aprs.h} (75%) diff --git a/main/wifi.cpp b/main/aprs.cpp similarity index 99% rename from main/wifi.cpp rename to main/aprs.cpp index 8139e38..fa340be 100644 --- a/main/wifi.cpp +++ b/main/aprs.cpp @@ -11,7 +11,7 @@ #include "proc.h" -#ifdef WITH_WIFI +#ifdef WITH_APRS #define DEBUG_PRINT @@ -205,7 +205,7 @@ int APRS_RxMsg(const char *Msg) return 0; } extern "C" -void vTaskWIFI(void* pvParameters) +void vTaskAPRS(void* pvParameters) { esp_err_t Err; vTaskDelay(1000); @@ -369,5 +369,5 @@ void vTaskWIFI(void* pvParameters) } } -#endif // WITH_WIFI +#endif // WITH_APRS diff --git a/main/wifi.h b/main/aprs.h similarity index 75% rename from main/wifi.h rename to main/aprs.h index 4d63598..c8bee01 100644 --- a/main/wifi.h +++ b/main/aprs.h @@ -6,5 +6,5 @@ bool APRS_isConnected(void); #ifdef __cplusplus extern "C" #endif - void vTaskWIFI(void* pvParameters); + void vTaskAPRS(void* pvParameters); diff --git a/main/main.cpp b/main/main.cpp index e5b440a..129585a 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -28,8 +28,8 @@ #include "stratux.h" #endif -#ifdef WITH_WIFI -#include "wifi.h" // WIFI task +#ifdef WITH_APRS +#include "aprs.h" // APRS task #endif extern "C" @@ -113,8 +113,8 @@ void app_main(void) #ifdef WITH_AERO xTaskCreate(vTaskAERO, "AERO", 2048, 0, tskIDLE_PRIORITY+3, 0); #endif -#ifdef WITH_WIFI - xTaskCreate(vTaskWIFI, "WIFI", 4096, 0, tskIDLE_PRIORITY+2, 0); +#ifdef WITH_APRS + xTaskCreate(vTaskAPRS, "APRS", 4096, 0, tskIDLE_PRIORITY+2, 0); #endif #ifdef WITH_STRATUX xTaskCreate(vTaskSTX, "STX", 4096, 0, tskIDLE_PRIORITY+3, 0); diff --git a/main/parameters.h b/main/parameters.h index 275e7c4..84889ea 100644 --- a/main/parameters.h +++ b/main/parameters.h @@ -117,7 +117,7 @@ class FlashParameters int8_t StratuxTxPwr; #endif -#ifdef WITH_WIFI +#ifdef WITH_APRS static const uint8_t WIFInameLen = 32; static const uint8_t WIFIpassLen = 64; static const uint8_t WIFIsets = 10; @@ -137,7 +137,7 @@ class FlashParameters uint32_t CheckSum; -#ifdef WITH_WIFI +#ifdef WITH_APRS const char *getWIFIpass(const char *NetName) const { for(uint8_t Idx=0; Idx=80) TxPwr=80; StratuxTxPwr=TxPwr; return 1; } #endif -#ifdef WITH_WIFI +#ifdef WITH_APRS if(strcmp(Name, "WIFIname")==0) return Read_String(WIFIname[0], Value, WIFInameLen)<=0; if(strcmp(Name, "WIFIpass")==0) return Read_String(WIFIpass[0], Value, WIFIpassLen)<=0; if( (memcmp(Name, "WIFIname", 8)==0) && (strlen(Name)==9) ) @@ -709,7 +709,7 @@ class FlashParameters Write_Float1(Line, "StratuxTxPwr" , (int32_t)10*StratuxTxPwr/4); strcat(Line, " # [ dBm]\n"); if(fputs(Line, File)==EOF) return EOF; Write_SignDec(Line, "StratuxMinSig", (int32_t)StratuxMinSig); strcat(Line, " # [ dBm]\n"); if(fputs(Line, File)==EOF) return EOF; #endif -#ifdef WITH_WIFI +#ifdef WITH_APRS for(uint8_t Idx=0; Idx