Skip to content

Commit

Permalink
treewide: add ESP32-S3-Box-3 support
Browse files Browse the repository at this point in the history
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 8806917)
  • Loading branch information
stintel committed Sep 18, 2023
1 parent f565b7c commit c448c4f
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-willow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
matrix:
device:
- ESP32_S3_BOX
- ESP32_S3_BOX_3
- ESP32_S3_BOX_LITE
runs-on: ubuntu-22.04
container:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions main/display.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions main/slvgl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
3 changes: 3 additions & 0 deletions main/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion main/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
};

Expand All @@ -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);
void restart_delayed(void);

0 comments on commit c448c4f

Please sign in to comment.