Wed, 26 Jun 2024 21:48:49 +0200
Reverted gpio_pad_select_gpio() calls, added the correct include. Starting the unit works better now. Reverted some other small changes. In some parts the controller is very slow, possible spiffs issue?
CMakeLists.txt | file | annotate | diff | comparison | revisions | |
components/tft/tftspi.c | file | annotate | diff | comparison | revisions | |
main/automation.c | file | annotate | diff | comparison | revisions | |
main/config.h | file | annotate | diff | comparison | revisions | |
main/manual.c | file | annotate | diff | comparison | revisions | |
main/task_driver.c | file | annotate | diff | comparison | revisions | |
main/task_sound.c | file | annotate | diff | comparison | revisions | |
main/updates.c | file | annotate | diff | comparison | revisions | |
partitions.csv | file | annotate | diff | comparison | revisions |
--- a/CMakeLists.txt Mon Jun 24 20:55:35 2024 +0200 +++ b/CMakeLists.txt Wed Jun 26 21:48:49 2024 +0200 @@ -2,16 +2,11 @@ # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.16) -#project(brewboard VERSION 0.3.24) #find_package(EXPAT 2.6.2 MODULE REQUIRED) -#add_executable(brewboard -# hello.c -#) - -set(PROJECT_VER "0.3.24") +set(PROJECT_VER "0.4.0") set(PROJECT_NAME "brewboard")
--- a/components/tft/tftspi.c Mon Jun 24 20:55:35 2024 +0200 +++ b/components/tft/tftspi.c Wed Jun 26 21:48:49 2024 +0200 @@ -15,6 +15,7 @@ #include "freertos/task.h" #include "esp_heap_caps.h" #include "soc/spi_reg.h" +#include "rom/gpio.h" // ==================================================== // ==== Global variables, default values ============== @@ -863,11 +864,11 @@ void TFT_PinsInit() { // Route all used pins to GPIO control - esp_rom_gpio_pad_select_gpio(PIN_NUM_CS); - esp_rom_gpio_pad_select_gpio(PIN_NUM_MISO); - esp_rom_gpio_pad_select_gpio(PIN_NUM_MOSI); - esp_rom_gpio_pad_select_gpio(PIN_NUM_CLK); - esp_rom_gpio_pad_select_gpio(PIN_NUM_DC); + gpio_pad_select_gpio(PIN_NUM_CS); + gpio_pad_select_gpio(PIN_NUM_MISO); + gpio_pad_select_gpio(PIN_NUM_MOSI); + gpio_pad_select_gpio(PIN_NUM_CLK); + gpio_pad_select_gpio(PIN_NUM_DC); gpio_set_direction(PIN_NUM_MISO, GPIO_MODE_INPUT); gpio_set_pull_mode(PIN_NUM_MISO, GPIO_PULLUP_ONLY); @@ -877,17 +878,17 @@ gpio_set_direction(PIN_NUM_DC, GPIO_MODE_OUTPUT); gpio_set_level(PIN_NUM_DC, 0); #if USE_TOUCH - esp_rom_gpio_pad_select_gpio(PIN_NUM_TCS); + gpio_pad_select_gpio(PIN_NUM_TCS); gpio_set_direction(PIN_NUM_TCS, GPIO_MODE_OUTPUT); #endif #if PIN_NUM_BCKL - esp_rom_gpio_pad_select_gpio(PIN_NUM_BCKL); + gpio_pad_select_gpio(PIN_NUM_BCKL); gpio_set_direction(PIN_NUM_BCKL, GPIO_MODE_OUTPUT); gpio_set_level(PIN_NUM_BCKL, PIN_BCKL_OFF); #endif #if PIN_NUM_RST - esp_rom_gpio_pad_select_gpio(PIN_NUM_RST); + gpio_pad_select_gpio(PIN_NUM_RST); gpio_set_direction(PIN_NUM_RST, GPIO_MODE_OUTPUT); gpio_set_level(PIN_NUM_RST, 0); #endif
--- a/main/automation.c Mon Jun 24 20:55:35 2024 +0200 +++ b/main/automation.c Wed Jun 26 21:48:49 2024 +0200 @@ -11,7 +11,7 @@ char temp_buf[64]; ///< Temporary buffer char logline[128]; ///< Log line buffer char strftime_buf[64]; ///< Time buffer -bool a_loop; ///< Loop flag +bool loop; ///< Loop flag bool CoolBeep = false; ///< Did beep during cooling bool Resume = false; ///< Resume brew flag bool pumpRest = false; ///< Pump is resting @@ -138,10 +138,10 @@ Buttons_Add(200, 100, 80, 40, (char *)"Nee", 1); Buttons_Show(); SoundPlay(SOUND_Prompt); - a_loop = true; - while (a_loop) { + loop = true; + while (loop) { switch (Buttons_Scan()) { - case 0: a_loop = false; + case 0: loop = false; Resume = true; Main_Screen = runtime.StageResume; TimeLeft = runtime.StageTimeLeft; @@ -165,7 +165,7 @@ return true; break; - case 1: a_loop = false; + case 1: loop = false; Resume = false; break; @@ -436,7 +436,7 @@ /* - * Automation a_loop screens. Mostly non-blocking. + * Automation loop screens. Mostly non-blocking. */ bool Automation_Loop(void) { @@ -529,14 +529,14 @@ Buttons_Add(250, 210, 70, 30, (char *)"Start" , 1); Buttons[0].dark = true; Buttons_Show(); - a_loop = true; - while (a_loop) { + loop = true; + while (loop) { switch (Buttons_Scan()) { - case 0: a_loop = false; + case 0: loop = false; Main_Screen = MAIN_AUTO_ABORT; break; - case 1: a_loop = false; + case 1: loop = false; Main_Screen = MAIN_AUTO_INIT2; log_msg(TAG, "Brew `%s' on `%s'", recipe.Name, equipment.Name); break; @@ -558,13 +558,13 @@ Buttons_Add(200, 100, 80, 40, (char *)"Nee", 1); Buttons_Show(); SoundPlay(SOUND_Prompt); - a_loop = true; - while (a_loop) { + loop = true; + while (loop) { switch (Buttons_Scan()) { - case 0: a_loop = false; + case 0: loop = false; break; - case 1: a_loop = false; + case 1: loop = false; Main_Screen = MAIN_AUTO_ABORT; break; @@ -578,14 +578,14 @@ if ((equipment.SSR2 == SSR2_HLT_SHARE) || (equipment.SSR2 == SSR2_HLT_IND)) { TopMessage((char *)"Spoelwater aanwezig?"); SoundPlay(SOUND_Prompt); - a_loop = true; - while (a_loop) { + loop = true; + while (loop) { switch (Buttons_Scan()) { - case 0: a_loop = false; + case 0: loop = false; _UseHLT = true; break; - case 1: a_loop = false; + case 1: loop = false; break; default: break;
--- a/main/config.h Mon Jun 24 20:55:35 2024 +0200 +++ b/main/config.h Wed Jun 26 21:48:49 2024 +0200 @@ -47,6 +47,7 @@ #include "lwip/sockets.h" #include "lwip/dns.h" #include "lwip/netdb.h" +#include "rom/gpio.h" #include <expat.h>
--- a/main/manual.c Mon Jun 24 20:55:35 2024 +0200 +++ b/main/manual.c Wed Jun 26 21:48:49 2024 +0200 @@ -7,7 +7,6 @@ bool _ManualHLT = false; ///< Use Hot Liquer Tank bool _ManualMLT = false; ///< Use Mash/Boil kettle -bool loop; extern my_runtime_t runtime; extern my_equipment_t equipment; @@ -77,6 +76,8 @@ */ bool Manual_Loop(void) { + bool loop; + switch (Main_Screen) { case MAIN_MANUAL_INIT: _ManualHLT = _ManualMLT = false;
--- a/main/task_driver.c Mon Jun 24 20:55:35 2024 +0200 +++ b/main/task_driver.c Wed Jun 26 21:48:49 2024 +0200 @@ -208,14 +208,11 @@ /* * Configure IOMUX register. */ - gpio_reset_pin(SSR_MLT); - //gpio_pad_select_gpio(SSR_MLT); + gpio_pad_select_gpio(SSR_MLT); gpio_set_direction(SSR_MLT, GPIO_MODE_OUTPUT); - gpio_reset_pin(SSR_HLT); - //gpio_pad_select_gpio(SSR_HLT); + gpio_pad_select_gpio(SSR_HLT); gpio_set_direction(SSR_HLT, GPIO_MODE_OUTPUT); - gpio_reset_pin(SSR_PUMP); - //gpio_pad_select_gpio(SSR_PUMP); + gpio_pad_select_gpio(SSR_PUMP); gpio_set_direction(SSR_PUMP, GPIO_MODE_OUTPUT); // Prepare and then apply the LEDC PWM timer configuration
--- a/main/task_sound.c Mon Jun 24 20:55:35 2024 +0200 +++ b/main/task_sound.c Wed Jun 26 21:48:49 2024 +0200 @@ -95,9 +95,7 @@ ESP_LOGI(TAG, "Start sound"); -// gpio_pad_select_gpio(PIEZO_BUZZER); -// gpio_set_direction(PIEZO_BUZZER, GPIO_MODE_OUTPUT); - gpio_reset_pin(PIEZO_BUZZER); + gpio_pad_select_gpio(PIEZO_BUZZER); gpio_set_direction(PIEZO_BUZZER, GPIO_MODE_OUTPUT); xEventGroupSound = xEventGroupCreate();
--- a/main/updates.c Mon Jun 24 20:55:35 2024 +0200 +++ b/main/updates.c Wed Jun 26 21:48:49 2024 +0200 @@ -41,7 +41,7 @@ * Don't use https because it costs more then 100K memory. */ esp_http_client_config_t update = { - .url = "http://update.mbse.eu/ap1/fw/brewboard.bin", + .url = "http://update.mbse.eu/ap3/fw/brewboard.bin", }; esp_http_client_handle_t client = esp_http_client_init(&update); @@ -203,7 +203,7 @@ static char theurl[73], thefile[41]; FILE *f; - snprintf(theurl, 72, "http://update.mbse.eu/ap1/image/%s", filename); + snprintf(theurl, 72, "http://update.mbse.eu/ap3/image/%s", filename); snprintf(thefile, 40, "/spiffs/%s", filename); esp_http_client_config_t update = {
--- a/partitions.csv Mon Jun 24 20:55:35 2024 +0200 +++ b/partitions.csv Wed Jun 26 21:48:49 2024 +0200 @@ -3,7 +3,7 @@ nvs, data, nvs, 0x9000, 0x4000, otadata, data, ota, 0xd000, 0x2000 phy_init, data, phy, 0xf000, 0x1000, -factory, app, factory, 0x10000, 1M, -ota_0, 0, ota_0, 0x110000, 1M, -ota_1, 0, ota_1, 0x210000, 1M, -storage, data, spiffs, 0x310000, 0xf0000, +factory, app, factory, 0x10000, 0x120000, +ota_0, 0, ota_0, 0x130000, 0x120000, +ota_1, 0, ota_1, 0x250000, 0x120000, +storage, data, spiffs, 0x370000, 0x90000,