main/brewboard.c

changeset 22
90f22a101fc6
parent 6
e84200edc852
child 23
0a1c1a8324a3
equal deleted inserted replaced
21:9e4cce24f6ff 22:90f22a101fc6
16 16
17 extern SemaphoreHandle_t xSemaphoreDS18B20; 17 extern SemaphoreHandle_t xSemaphoreDS18B20;
18 extern SemaphoreHandle_t xSemaphoreDriver; 18 extern SemaphoreHandle_t xSemaphoreDriver;
19 extern SemaphoreHandle_t xSemaphoreWiFi; 19 extern SemaphoreHandle_t xSemaphoreWiFi;
20 extern WIFI_State *wifi_state; 20 extern WIFI_State *wifi_state;
21
22 21
23 int Main_Screen = MAIN_MODE_UNKNOWN; ///< Screen number 22 int Main_Screen = MAIN_MODE_UNKNOWN; ///< Screen number
24 int Old_Screen = MAIN_MODE_UNKNOWN; ///< Previous screen number 23 int Old_Screen = MAIN_MODE_UNKNOWN; ///< Previous screen number
25 bool System_TimeOk = false; ///< System time status 24 bool System_TimeOk = false; ///< System time status
26 25
80 ESP_LOGI(TAG, "Partition size: %d, used: %d - %d%%", total, used, (used * 100) / total); 79 ESP_LOGI(TAG, "Partition size: %d, used: %d - %d%%", total, used, (used * 100) / total);
81 } 80 }
82 TFT_print("Ok\r\n", LASTX, LASTY); 81 TFT_print("Ok\r\n", LASTX, LASTY);
83 82
84 // Just to debug, list the /spiffs filesystem. 83 // Just to debug, list the /spiffs filesystem.
85 #if 1 84 #if 0
86 DIR *dir = opendir("/spiffs"); 85 DIR *dir = opendir("/spiffs");
87 struct dirent* de = readdir(dir); 86 struct dirent* de = readdir(dir);
88 while (de) { 87 while (de) {
89 if (de->d_type == DT_REG) { 88 if (de->d_type == DT_REG) {
90 printf("F "); 89 printf("F ");
130 xTaskCreate(&task_sound, "task_sound", 3072, NULL,15, &xTaskSound); 129 xTaskCreate(&task_sound, "task_sound", 3072, NULL,15, &xTaskSound);
131 xTaskCreate(&task_sdcard, "task_sdcard", 8192, NULL,10, &xTaskSDcard); 130 xTaskCreate(&task_sdcard, "task_sdcard", 8192, NULL,10, &xTaskSDcard);
132 /* lower the wifi logging level */ 131 /* lower the wifi logging level */
133 esp_log_level_set("wifi", ESP_LOG_ERROR); 132 esp_log_level_set("wifi", ESP_LOG_ERROR);
134 xTaskCreate(&task_wifi, "task_wifi", 4096, NULL, 3, &xTaskWifi); 133 xTaskCreate(&task_wifi, "task_wifi", 4096, NULL, 3, &xTaskWifi);
135 // Task for MQTT
136 TFT_print(" Ok\r\nConnecting ", LASTX, LASTY); 134 TFT_print(" Ok\r\nConnecting ", LASTX, LASTY);
137 135
138 int wait = 20; 136 int wait = 20;
139 while (wait) { 137 while (wait) {
140 vTaskDelay(500 / portTICK_PERIOD_MS); 138 vTaskDelay(500 / portTICK_PERIOD_MS);
141 TFT_print(".", LASTX, LASTY); 139 TFT_print(".", LASTX, LASTY);
142 if (xSemaphoreTake(xSemaphoreWiFi, 25) == pdTRUE) { 140 if (xSemaphoreTake(xSemaphoreWiFi, 25) == pdTRUE) {
143 if (wifi_state->STA_connected == true) 141 if (wifi_state->STA_online == true)
144 wait = 0; 142 wait = 0;
145 else 143 else
146 wait--; 144 wait--;
147 xSemaphoreGive(xSemaphoreWiFi); 145 xSemaphoreGive(xSemaphoreWiFi);
148 } 146 }

mercurial