Refactor/esp idf modular ui #4
@@ -3,3 +3,8 @@
|
||||
.vscode/c_cpp_properties.json
|
||||
.vscode/launch.json
|
||||
.vscode/ipch
|
||||
build/
|
||||
sdkconfig
|
||||
sdkconfig.old
|
||||
managed_components/
|
||||
dependencies.lock
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(autofilm)
|
||||
@@ -0,0 +1 @@
|
||||
idf_component_register(SRCS "board.c" INCLUDE_DIRS "include" REQUIRES driver)
|
||||
@@ -0,0 +1,16 @@
|
||||
#include "board.h"
|
||||
|
||||
const char *board_name(void)
|
||||
{
|
||||
return "jc4827w543";
|
||||
}
|
||||
|
||||
gpio_num_t board_pin_motor_en(void)
|
||||
{
|
||||
return GPIO_NUM_NC;
|
||||
}
|
||||
|
||||
int board_motor_en_disable_level(void)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
#pragma once
|
||||
#include "driver/gpio.h"
|
||||
const char *board_name(void);
|
||||
gpio_num_t board_pin_motor_en(void);
|
||||
int board_motor_en_disable_level(void);
|
||||
@@ -0,0 +1 @@
|
||||
idf_component_register(SRCS "board.c" INCLUDE_DIRS "include" REQUIRES driver)
|
||||
@@ -0,0 +1,16 @@
|
||||
#include "board.h"
|
||||
|
||||
const char *board_name(void)
|
||||
{
|
||||
return "wroom";
|
||||
}
|
||||
|
||||
gpio_num_t board_pin_motor_en(void)
|
||||
{
|
||||
return (gpio_num_t)27;
|
||||
}
|
||||
|
||||
int board_motor_en_disable_level(void)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
#pragma once
|
||||
#include "driver/gpio.h"
|
||||
const char *board_name(void);
|
||||
gpio_num_t board_pin_motor_en(void);
|
||||
int board_motor_en_disable_level(void);
|
||||
@@ -33,7 +33,7 @@ If blocked: stop, commit nothing broken, write `BLOCKED:` at top of the phase fi
|
||||
| ID | File | Session goal | STATUS |
|
||||
| --- | --- | --- | --- |
|
||||
| P00 | `refactor/P00-docs-lock.md` | Architecture docs already on branch | DONE |
|
||||
| P01 | `refactor/P01-idf-skeleton.md` | Dual-board IDF project compiles | TODO |
|
||||
| P01 | `refactor/P01-idf-skeleton.md` | Dual-board IDF project compiles | BLOCKED |
|
||||
| P02 | `refactor/P02-ui-cmd-process.md` | `ui_cmd` + `app_process` + golden tests | TODO |
|
||||
| P03 | `refactor/P03-machine-host.md` | `app_machine` + stub HAL + SM tests | TODO |
|
||||
| P04 | `refactor/P04-gitea-ci.md` | `.gitea/workflows/ci.yml` live | TODO |
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# P01 — IDF dual-board skeleton
|
||||
|
||||
STATUS: TODO
|
||||
STATUS: BLOCKED
|
||||
BLOCKED: no IDF (IDF_PATH unset; no idf.py; no docker.io/espressif/idf:v5.4). Sources landed; builds not run; no binaries faked.
|
||||
DEPENDS: P00
|
||||
READ: `AGENTS.md`, `docs/megaplans/REFACTOR-MEGAPLAN.md`, this file
|
||||
OUT: recipes, UI, motor, Arduino-as-component, Gitea workflow, touching `src/` behaviour
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
if(NOT DEFINED AUTOFILM_BOARD)
|
||||
set(AUTOFILM_BOARD wroom CACHE STRING "wroom|jc4827w543")
|
||||
endif()
|
||||
if(AUTOFILM_BOARD STREQUAL "wroom")
|
||||
set(BOARD_COMP board_wroom)
|
||||
elseif(AUTOFILM_BOARD STREQUAL "jc4827w543")
|
||||
set(BOARD_COMP board_jc4827w543)
|
||||
else()
|
||||
message(FATAL_ERROR "AUTOFILM_BOARD=${AUTOFILM_BOARD}")
|
||||
endif()
|
||||
idf_component_register(SRCS "main.c" INCLUDE_DIRS "." REQUIRES ${BOARD_COMP} driver)
|
||||
@@ -0,0 +1 @@
|
||||
dependencies: {}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
#include "board.h"
|
||||
#include "esp_log.h"
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/task.h"
|
||||
|
||||
static const char *TAG = "app";
|
||||
|
||||
void app_main(void)
|
||||
{
|
||||
ESP_LOGI(TAG, "board=%s", board_name());
|
||||
|
||||
gpio_num_t en_pin = board_pin_motor_en();
|
||||
if (en_pin != GPIO_NUM_NC) {
|
||||
gpio_config_t io = {
|
||||
.pin_bit_mask = 1ULL << en_pin,
|
||||
.mode = GPIO_MODE_OUTPUT,
|
||||
.pull_up_en = GPIO_PULLUP_DISABLE,
|
||||
.pull_down_en = GPIO_PULLDOWN_DISABLE,
|
||||
.intr_type = GPIO_INTR_DISABLE,
|
||||
};
|
||||
gpio_config(&io);
|
||||
gpio_set_level(en_pin, board_motor_en_disable_level());
|
||||
}
|
||||
|
||||
while (1) {
|
||||
vTaskDelay(pdMS_TO_TICKS(1000));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
CONFIG_ESP_TASK_WDT_EN=y
|
||||
CONFIG_ESP_TASK_WDT_TIMEOUT_S=10
|
||||
CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=y
|
||||
@@ -0,0 +1,4 @@
|
||||
CONFIG_IDF_TARGET="esp32s3"
|
||||
CONFIG_SPIRAM=y
|
||||
CONFIG_SPIRAM_MODE_OCT=y
|
||||
CONFIG_SPIRAM_SPEED_80M=y
|
||||
@@ -0,0 +1 @@
|
||||
CONFIG_IDF_TARGET="esp32"
|
||||
Reference in New Issue
Block a user