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