19 extern SemaphoreHandle_t xSemaphoreWiFi; |
19 extern SemaphoreHandle_t xSemaphoreWiFi; |
20 extern WIFI_State *wifi_state; |
20 extern WIFI_State *wifi_state; |
21 |
21 |
22 int Main_Screen = MAIN_MODE_UNKNOWN; ///< Screen number |
22 int Main_Screen = MAIN_MODE_UNKNOWN; ///< Screen number |
23 int Old_Screen = MAIN_MODE_UNKNOWN; ///< Previous screen number |
23 int Old_Screen = MAIN_MODE_UNKNOWN; ///< Previous screen number |
|
24 int Sub_Screen = 0; ///< Subscreen during mash |
24 bool System_TimeOk = false; ///< System time status |
25 bool System_TimeOk = false; ///< System time status |
25 |
26 const esp_app_desc_t *app_desc = NULL; |
26 |
27 |
27 |
28 |
28 void app_main() |
29 void app_main() |
29 { |
30 { |
30 int tempy; |
31 int tempy; |
34 init_tft_display(); |
35 init_tft_display(); |
35 |
36 |
36 TFT_setFont(DEJAVU24_FONT, NULL); |
37 TFT_setFont(DEJAVU24_FONT, NULL); |
37 _fg = TFT_YELLOW; |
38 _fg = TFT_YELLOW; |
38 tempy = TFT_getfontheight() + 4; |
39 tempy = TFT_getfontheight() + 4; |
39 sprintf(temp, "BrewBoard %s", VERSION); |
40 app_desc = esp_ota_get_app_description(); |
|
41 sprintf(temp, "BrewBoard %s", app_desc->version); |
40 TFT_print(temp, CENTER, 4); |
42 TFT_print(temp, CENTER, 4); |
41 |
43 |
42 TFT_setFont(DEJAVU18_FONT, NULL); |
44 TFT_setFont(DEJAVU18_FONT, NULL); |
43 _fg = TFT_CYAN; |
45 _fg = TFT_CYAN; |
44 TFT_print("Mount /spiffs ", 0, LASTY+tempy); |
46 TFT_print("Mount /spiffs ", 0, LASTY+tempy); |
146 } |
148 } |
147 TFT_print(" Ok\r\n", LASTX, LASTY); |
149 TFT_print(" Ok\r\n", LASTX, LASTY); |
148 SoundPlay(SOUND_StartUp); |
150 SoundPlay(SOUND_StartUp); |
149 |
151 |
150 /* Do not write to the TFT during VNC startup to avoid race conditions */ |
152 /* Do not write to the TFT during VNC startup to avoid race conditions */ |
151 VncStartup(); |
153 // VncStartup(); |
152 start_http_websocket(); |
154 start_http_websocket(); |
153 vTaskDelay(1000 / portTICK_PERIOD_MS); |
155 vTaskDelay(1000 / portTICK_PERIOD_MS); |
154 Main_Screen = MAIN_MODE_FREE; |
156 Main_Screen = MAIN_MODE_FREE; |
155 |
157 |
156 // static char cBuffer[ 1024 ]; |
158 // static char cBuffer[ 1024 ]; |