102 */ |
102 */ |
103 TFT_print("Ophalen configuratie ", LASTX, LASTY); |
103 TFT_print("Ophalen configuratie ", LASTX, LASTY); |
104 read_config(); |
104 read_config(); |
105 read_equipment(config.EquipmentRec); |
105 read_equipment(config.EquipmentRec); |
106 read_runtime(); |
106 read_runtime(); |
107 // unlink("/spiffs/etc/recipe.conf"); |
|
108 read_recipe(config.RecipeRec); |
107 read_recipe(config.RecipeRec); |
109 TFT_print("Ok\r\n", LASTX, LASTY); |
108 TFT_print("Ok\r\n", LASTX, LASTY); |
110 |
109 |
111 // Set the Touchscreen calibration/ |
110 // Set the Touchscreen calibration/ |
112 TS_set_calibration(config.ts_xleft, config.ts_xright, config.ts_ytop, config.ts_ybottom); |
111 TS_set_calibration(config.ts_xleft, config.ts_xright, config.ts_ytop, config.ts_ybottom); |
124 TFT_print("Starten taken ", LASTX, LASTY); |
123 TFT_print("Starten taken ", LASTX, LASTY); |
125 xTaskCreate(&task_tft, "task_tft", 6144, NULL, 4, &xTaskTFT); |
124 xTaskCreate(&task_tft, "task_tft", 6144, NULL, 4, &xTaskTFT); |
126 vTaskDelay(400 / portTICK_PERIOD_MS); |
125 vTaskDelay(400 / portTICK_PERIOD_MS); |
127 xTaskCreate(&task_ds18b20, "task_ds18b20", 2560, NULL, 8, &xTaskDS18B20); |
126 xTaskCreate(&task_ds18b20, "task_ds18b20", 2560, NULL, 8, &xTaskDS18B20); |
128 xTaskCreate(&task_driver, "task_driver", 2560, NULL, 8, &xTaskDriver); |
127 xTaskCreate(&task_driver, "task_driver", 2560, NULL, 8, &xTaskDriver); |
129 xTaskCreate(&task_sound, "task_sound", 3072, NULL,15, &xTaskSound); |
128 xTaskCreate(&task_sound, "task_sound", 2048, NULL,15, &xTaskSound); |
130 xTaskCreate(&task_sdcard, "task_sdcard", 8192, NULL,10, &xTaskSDcard); |
129 xTaskCreate(&task_sdcard, "task_sdcard", 8192, NULL,10, &xTaskSDcard); |
131 /* lower the wifi logging level */ |
130 /* lower the wifi logging level */ |
132 esp_log_level_set("wifi", ESP_LOG_ERROR); |
131 esp_log_level_set("wifi", ESP_LOG_ERROR); |
133 xTaskCreate(&task_wifi, "task_wifi", 4096, NULL, 3, &xTaskWifi); |
132 xTaskCreate(&task_wifi, "task_wifi", 4096, NULL, 3, &xTaskWifi); |
134 TFT_print(" Ok\r\nConnecting ", LASTX, LASTY); |
133 TFT_print(" Ok\r\nConnecting ", LASTX, LASTY); |
143 else |
142 else |
144 wait--; |
143 wait--; |
145 xSemaphoreGive(xSemaphoreWiFi); |
144 xSemaphoreGive(xSemaphoreWiFi); |
146 } |
145 } |
147 } |
146 } |
148 |
|
149 Main_Screen = MAIN_MODE_FREE; |
|
150 TFT_print(" Ok\r\n", LASTX, LASTY); |
147 TFT_print(" Ok\r\n", LASTX, LASTY); |
151 SoundPlay(SOUND_StartUp); |
148 SoundPlay(SOUND_StartUp); |
152 |
149 |
153 /* Do not write to the TFT during VNC startup to avoid race conditions */ |
150 /* Do not write to the TFT during VNC startup to avoid race conditions */ |
154 VncStartup(); |
151 VncStartup(); |
155 start_http_websocket(); |
152 start_http_websocket(); |
156 vTaskDelay(1000 / portTICK_PERIOD_MS); |
153 vTaskDelay(1000 / portTICK_PERIOD_MS); |
157 |
154 Main_Screen = MAIN_MODE_FREE; |
158 /* |
|
159 * A small useless delay |
|
160 */ |
|
161 vTaskDelay(1000 / portTICK_PERIOD_MS); |
|
162 |
155 |
163 // static char cBuffer[ 1024 ]; |
156 // static char cBuffer[ 1024 ]; |
164 |
157 |
165 /* |
158 /* |
166 * Main application loop. |
159 * Main application loop. |