diff --git a/main/disp.cpp b/main/disp.cpp index bfbdad7..d26e31c 100644 --- a/main/disp.cpp +++ b/main/disp.cpp @@ -42,6 +42,7 @@ void vTaskDISP(void* pvParameters) OLED_DrawLogo(&U8G2_OLED); // draw logo u8g2_SendBuffer(&U8G2_OLED); vTaskDelay(2000); // allow 2sec for the user to see the logo + DISP_Page = Parameters.InitialPage; #endif #if defined(WITH_ST7789) || defined(WITH_ILI9341) // LCD_Start(); diff --git a/main/disp_oled.cpp b/main/disp_oled.cpp index fbfd83c..a11e6cf 100644 --- a/main/disp_oled.cpp +++ b/main/disp_oled.cpp @@ -23,6 +23,10 @@ #include "wifi.h" #endif +#ifdef WITH_AP +#include "wifi.h" +#endif + #ifdef WITH_BT_SPP #include "bt.h" #endif @@ -592,6 +596,11 @@ void OLED_DrawStatusBar(u8g2_t *OLED, GPS_Position *GPS) // status bar on top if(WIFI_isConnected()) { u8g2_SetFont(OLED, u8g2_font_open_iconic_all_1x_t); u8g2_DrawGlyph(OLED, 43, 11, 0x119); } // 0x50 +#endif +#ifdef WITH_AP + if(WIFI_isAP()) + { u8g2_SetFont(OLED, u8g2_font_open_iconic_all_1x_t); + u8g2_DrawGlyph(OLED, 43, 11, 0xF8); } // 0x50 #endif // u8g2_SetFont(OLED, u8g2_font_5x7_tr); // u8g2_SetFont(OLED, u8g2_font_5x8_tr); @@ -744,10 +753,10 @@ void OLED_DrawAltitudeAndSpeed(u8g2_t *OLED, GPS_Position *GPS) Line[Len]=0; u8g2_SetFont(OLED, u8g2_font_fub20_tr); uint8_t Altitude_width = u8g2_GetStrWidth(OLED, Line); - u8g2_DrawStr(OLED, 54-Altitude_width, 40, Line); + u8g2_DrawStr(OLED, 62-Altitude_width, 40, Line); u8g2_SetFont(OLED, u8g2_font_9x15_tr); - u8g2_DrawStr(OLED, 58, 40, "m"); + u8g2_DrawStr(OLED, 66, 40, "m"); u8g2_SetFont(OLED, u8g2_font_fub17_tr); if(GPS && GPS->isValid()) @@ -757,10 +766,10 @@ void OLED_DrawAltitudeAndSpeed(u8g2_t *OLED, GPS_Position *GPS) Len=Format_String(Line, "---"); Line[Len]=0; uint8_t Track_width = u8g2_GetStrWidth(OLED, Line); - u8g2_DrawStr(OLED, 116-Track_width, 40, Line); + u8g2_DrawStr(OLED, 118-Track_width, 40, Line); u8g2_SetFont(OLED, u8g2_font_6x12_tr); - u8g2_DrawStr(OLED, 120, 28, "o"); + u8g2_DrawStr(OLED, 122, 28, "o"); if(GPS && (GPS->hasBaro || GPS->isValid())) // if GPS has lock or just the pressure data { int16_t vario_value = GPS->ClimbRate; // [0.1m/s] climb rate diff --git a/main/http.cpp b/main/http.cpp index 8a6f38e..5ee7fc0 100644 --- a/main/http.cpp +++ b/main/http.cpp @@ -237,6 +237,13 @@ static void ParmForm_Other(httpd_req_t *Req) // produce HTML form for aircraft httpd_resp_sendstr_chunk(Req, "\">"); End_Control_Row(Req); + Begin_Control_Row(Req, "Initial Page"); + httpd_resp_sendstr_chunk(Req, ""); + End_Control_Row(Req); + httpd_resp_sendstr_chunk(Req, "
\n"); httpd_resp_sendstr_chunk(Req, "\n"); } @@ -608,6 +615,35 @@ static void Table_Batt(httpd_req_t *Req) httpd_resp_sendstr_chunk(Req, "\n"); } +// ------------------------------------------------------------------------------------------------------------- +#ifdef WITH_SPIFFS +static void Table_SPIFFS(httpd_req_t *Req) +{ char Line[128]; int Len; + + httpd_resp_sendstr_chunk(Req, "

SPIFFS

"); + httpd_resp_sendstr_chunk(Req, "\n"); + + size_t Total, Used; + if(SPIFFS_Info(Total, Used)==0) // get the SPIFFS usage summary + { + Len =Format_String(Line, "\n"); + httpd_resp_send_chunk(Req, Line, Len); + + Len =Format_String(Line, "\n"); + httpd_resp_send_chunk(Req, Line, Len); + + Len =Format_String(Line, "\n"); + httpd_resp_send_chunk(Req, Line, Len); + } + httpd_resp_sendstr_chunk(Req, "
Free"); + Len+=Format_UnsDec(Line+Len, (Total-Used)/1024); + Len+=Format_String(Line+Len, " kB
Used"); + Len+=Format_UnsDec(Line+Len, Used/1024); + Len+=Format_String(Line+Len, " kB
Total"); + Len+=Format_UnsDec(Line+Len, Total/1024); + Len+=Format_String(Line+Len, " kB
\n"); } +#endif + // ------------------------------------------------------------------------------------------------------------- static void Html_Start(httpd_req_t *Req, const char *Title, const uint8_t ActiveMenuIndex) @@ -738,6 +774,9 @@ static esp_err_t top_get_handler(httpd_req_t *Req) Table_GPS(Req); Table_RF(Req); Table_Batt(Req); +#ifdef WITH_SPIFFS + Table_SPIFFS(Req); +#endif #ifdef WITH_LOOKOUT Table_LookOut(Req); #endif diff --git a/main/parameters.h b/main/parameters.h index 8c014f8..47d43f1 100644 --- a/main/parameters.h +++ b/main/parameters.h @@ -125,6 +125,7 @@ class FlashParameters // char Category[16] uint32_t PageMask; // enable/disable individual pages on the LCD or OLED screen + uint8_t InitialPage; // the first page to show after boot #if defined(WITH_BT_SPP) || defined(WITH_BLE_SPP) char BTname[16]; @@ -261,6 +262,7 @@ uint16_t StratuxPort; FreqPlan = DEFAULT_FreqPlan; // [0..5] PPSdelay = DEFAULT_PPSdelay; // [ms] PageMask = 0xFF; + InitialPage = 0; for(uint8_t Idx=0; Idx