Refactor/esp idf modular ui #11
+22
-16
@@ -16,19 +16,15 @@ jobs:
|
||||
- name: Install host toolchain
|
||||
if: hashFiles('tests/host/CMakeLists.txt') != ''
|
||||
run: |
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
if command -v sudo >/dev/null 2>&1 && [ "$(id -u)" -ne 0 ]; then
|
||||
SUDO=sudo
|
||||
else
|
||||
SUDO=
|
||||
fi
|
||||
$SUDO apt-get update
|
||||
$SUDO apt-get install -y --no-install-recommends cmake gcc g++ make
|
||||
export DEBIAN_FRONTEND=noninteractive && \
|
||||
if command -v sudo >/dev/null 2>&1 && [ "$(id -u)" -ne 0 ]; then SUDO=sudo; else SUDO=; fi && \
|
||||
$SUDO apt-get update && \
|
||||
$SUDO apt-get install -y -q --no-install-recommends cmake gcc g++ make
|
||||
- name: Host unit tests
|
||||
if: hashFiles('tests/host/CMakeLists.txt') != ''
|
||||
run: |
|
||||
cmake -S tests/host -B build/host
|
||||
cmake --build build/host
|
||||
cmake -S tests/host -B build/host && \
|
||||
cmake --build build/host && \
|
||||
ctest --test-dir build/host --output-on-failure
|
||||
|
||||
firmware:
|
||||
@@ -47,21 +43,30 @@ jobs:
|
||||
target: esp32s3
|
||||
sdkconfig: sdkconfig.s3
|
||||
steps:
|
||||
- name: Install Node.js
|
||||
run: |
|
||||
export DEBIAN_FRONTEND=noninteractive && \
|
||||
export NEEDRESTART_MODE=a && \
|
||||
if command -v sudo >/dev/null 2>&1 && [ "$(id -u)" -ne 0 ]; then SUDO=sudo; else SUDO=; fi && \
|
||||
$SUDO apt-get update && \
|
||||
$SUDO apt-get install -y -q --no-install-recommends nodejs
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build
|
||||
if: hashFiles('CMakeLists.txt') != ''
|
||||
run: |
|
||||
git config --global --add safe.directory '*'
|
||||
idf.py -B build/${{ matrix.board }} set-target ${{ matrix.target }}
|
||||
. $IDF_PATH/export.sh && \
|
||||
git config --global --add safe.directory '*' && \
|
||||
idf.py -B build/${{ matrix.board }} set-target ${{ matrix.target }} && \
|
||||
idf.py -B build/${{ matrix.board }} \
|
||||
-D SDKCONFIG_DEFAULTS="sdkconfig.defaults;${{ matrix.sdkconfig }}" \
|
||||
-D AUTOFILM_BOARD=${{ matrix.board }} \
|
||||
build
|
||||
idf.py -B build/${{ matrix.board }} size | tee size-${{ matrix.board }}.txt
|
||||
build && \
|
||||
idf.py -B build/${{ matrix.board }} size | tee size-${{ matrix.board }}.txt && \
|
||||
cd build/${{ matrix.board }} && \
|
||||
python $IDF_PATH/components/esptool_py/esptool/esptool.py \
|
||||
--chip ${{ matrix.target }} merge_bin \
|
||||
-o autofilm-${{ matrix.board }}-${{ gitea.sha }}.bin \
|
||||
@build/${{ matrix.board }}/flash_args
|
||||
-o ../../autofilm-${{ matrix.board }}-${{ gitea.sha }}.bin \
|
||||
@flash_args
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: hashFiles('CMakeLists.txt') != ''
|
||||
with:
|
||||
@@ -74,3 +79,4 @@ jobs:
|
||||
build/${{ matrix.board }}/flasher_args.json
|
||||
build/${{ matrix.board }}/sdkconfig
|
||||
size-${{ matrix.board }}.txt
|
||||
|
||||
@@ -56,7 +56,7 @@ static void draw_program_select(void)
|
||||
|
||||
static void draw_step_select(const ui_evt_t *ev)
|
||||
{
|
||||
char line[21];
|
||||
char line[32];
|
||||
char mm[8];
|
||||
uint16_t ts = ev->time_s;
|
||||
fmt_mmss(mm, sizeof(mm), ts);
|
||||
@@ -71,7 +71,7 @@ static void draw_step_select(const ui_evt_t *ev)
|
||||
|
||||
static void draw_armed(const ui_evt_t *ev)
|
||||
{
|
||||
char line[21];
|
||||
char line[32];
|
||||
char mm[8];
|
||||
fmt_mmss(mm, sizeof(mm), ev->time_s);
|
||||
int pref = (int)(ev->temp_pref_c + (ev->temp_pref_c >= 0 ? 0.5f : -0.5f));
|
||||
@@ -84,7 +84,7 @@ static void draw_armed(const ui_evt_t *ev)
|
||||
|
||||
static void draw_running(const ui_evt_t *ev)
|
||||
{
|
||||
char line[21];
|
||||
char line[32];
|
||||
char mm[8];
|
||||
uint32_t rem_s = (ev->remaining_ms + 999u) / 1000u;
|
||||
fmt_mmss(mm, sizeof(mm), rem_s);
|
||||
@@ -98,7 +98,7 @@ static void draw_running(const ui_evt_t *ev)
|
||||
|
||||
static void draw_stopped(const ui_evt_t *ev)
|
||||
{
|
||||
char line[21];
|
||||
char line[32];
|
||||
char mm[8];
|
||||
uint32_t rem_s = (ev->remaining_ms + 999u) / 1000u;
|
||||
fmt_mmss(mm, sizeof(mm), rem_s);
|
||||
@@ -111,7 +111,7 @@ static void draw_stopped(const ui_evt_t *ev)
|
||||
|
||||
static void draw_complete(const ui_evt_t *ev)
|
||||
{
|
||||
char line[21];
|
||||
char line[32];
|
||||
hal_display_clear();
|
||||
snprintf(line, sizeof(line), "%-10.10s Done", step_name(ev->process_id, ev->step_index));
|
||||
hal_display_text(0, 0, line);
|
||||
|
||||
+2
-1
@@ -12,7 +12,8 @@ endif()
|
||||
idf_component_register(SRCS "main.c"
|
||||
INCLUDE_DIRS "."
|
||||
REQUIRES ${BOARD_COMP} driver app_process app_machine app_ui
|
||||
hal_motor hal_temp hal_audio hal_display hal_input)
|
||||
hal_motor hal_temp hal_audio hal_display hal_input
|
||||
PRIV_REQUIRES esp_timer)
|
||||
|
||||
if(IDF_TARGET STREQUAL "esp32")
|
||||
target_compile_definitions(${COMPONENT_LIB} PRIVATE AUTOFILM_BOARD_WROOM=1)
|
||||
|
||||
Reference in New Issue
Block a user