From c448c4f27ca929acc7a408088e76f8c1ac63abf7 Mon Sep 17 00:00:00 2001 From: Stijn Tintel Date: Mon, 11 Sep 2023 22:40:41 +0300 Subject: [PATCH] treewide: add ESP32-S3-Box-3 support We now point to ESP-ADF using a tag. We must add a tag in our fork of ESP-ADF. If we don't, and we rebase on upstream/master, the commit hash will change, and the old hash will disappear on Github. If this happens, our builds will fail. Using a branch for every time we bump ESP-ADF in Willow will get ugly fast, so let's use tags for this. (cherry picked from commit 880691796babe2e0fe74086532967072a277658b) --- .github/workflows/build-willow.yml | 1 + Dockerfile | 2 +- main/display.c | 2 ++ main/slvgl.c | 2 ++ main/system.c | 3 +++ main/system.h | 3 ++- 6 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-willow.yml b/.github/workflows/build-willow.yml index ca5041ceb..d25d2365f 100644 --- a/.github/workflows/build-willow.yml +++ b/.github/workflows/build-willow.yml @@ -18,6 +18,7 @@ jobs: matrix: device: - ESP32_S3_BOX + - ESP32_S3_BOX_3 - ESP32_S3_BOX_LITE runs-on: ubuntu-22.04 container: diff --git a/Dockerfile b/Dockerfile index dcce7ad2a..a04b9ba90 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,7 +27,7 @@ COPY container.gitconfig /root/.gitconfig ENV PATH="$PATH:/willow/.local/bin" WORKDIR /willow -ENV ADF_VER="5cb9820cc1070e629d3439839f4449a61d3c53d6" +ENV ADF_VER="willow-release-v0_1-2023091800" RUN \ cd /opt/esp/idf && \ curl https://raw.githubusercontent.com/toverainc/esp-adf/$ADF_VER/idf_patches/idf_v4.4_freertos.patch | patch -p1 diff --git a/main/display.c b/main/display.c index 557af69c3..25473fecd 100644 --- a/main/display.c +++ b/main/display.c @@ -28,6 +28,8 @@ esp_err_t init_display(void) case WILLOW_HW_UNSUPPORTED: __attribute__((fallthrough)); case WILLOW_HW_ESP32_S3_BOX: + __attribute__((fallthrough)); + case WILLOW_HW_ESP32_S3_BOX_3: bl_duty_off = 0; bl_duty_on = config_get_int("lcd_brightness", DEFAULT_LCD_BRIGHTNESS); break; diff --git a/main/slvgl.c b/main/slvgl.c index b8cb6b7bb..a1a7e1534 100644 --- a/main/slvgl.c +++ b/main/slvgl.c @@ -126,6 +126,8 @@ esp_err_t init_lvgl_touch(void) switch (hw_type) { case WILLOW_HW_ESP32_S3_BOX: + __attribute__((fallthrough)); + case WILLOW_HW_ESP32_S3_BOX_3: break; default: ESP_LOGI(TAG, "%s does not have a touch screen, skipping init", str_hw_type(hw_type)); diff --git a/main/system.c b/main/system.c index 6c4d0583b..9477c4036 100644 --- a/main/system.c +++ b/main/system.c @@ -15,6 +15,7 @@ static const char *willow_hw_t[WILLOW_HW_MAX] = { [WILLOW_HW_UNSUPPORTED] = "Hardware not supported.", [WILLOW_HW_ESP32_S3_BOX] = "ESP32-S3-BOX", [WILLOW_HW_ESP32_S3_BOX_LITE] = "ESP32-S3-BOX-Lite", + [WILLOW_HW_ESP32_S3_BOX_3] = "ESP32-S3-BOX-3", }; const char *str_hw_type(int id) @@ -31,6 +32,8 @@ static void set_hw_type(void) hw_type = WILLOW_HW_ESP32_S3_BOX; #elif defined(CONFIG_ESP32_S3_BOX_LITE_BOARD) hw_type = WILLOW_HW_ESP32_S3_BOX_LITE; +#elif defined(CONFIG_ESP32_S3_BOX_3_BOARD) + hw_type = WILLOW_HW_ESP32_S3_BOX_3; #else hw_type = WILLOW_HW_UNSUPPORTED; #endif diff --git a/main/system.h b/main/system.h index 4ac797277..fbc00a40e 100644 --- a/main/system.h +++ b/main/system.h @@ -4,6 +4,7 @@ enum willow_hw_t { WILLOW_HW_UNSUPPORTED = 0, WILLOW_HW_ESP32_S3_BOX, WILLOW_HW_ESP32_S3_BOX_LITE, + WILLOW_HW_ESP32_S3_BOX_3, WILLOW_HW_MAX, // keep this last }; @@ -20,4 +21,4 @@ esp_periph_set_handle_t hdl_pset; const char *str_hw_type(int id); void init_system(void); -void restart_delayed(void); \ No newline at end of file +void restart_delayed(void);