Files
AutoFilm-ESP32/docs/megaplans/refactor/P08-idf-debt.md
gronod 32af44a702
ci / test (pull_request) Successful in 1m22s
ci / firmware (wroom, sdkconfig.wroom, esp32) (pull_request) Failing after 33s
ci / firmware (jc4827w543, sdkconfig.s3, esp32s3) (pull_request) Failing after 37s
ci / test (push) Successful in 1m19s
ci / firmware (wroom, sdkconfig.wroom, esp32) (push) Failing after 30s
ci / firmware (jc4827w543, sdkconfig.s3, esp32s3) (push) Failing after 32s
Drop espressif/arduino-esp32 from IDF firmware
2026-09-16 14:34:25 +00:00

43 lines
2.2 KiB
Markdown

# P08 — Arduino debt burn-down
STATUS: DONE
DEPENDS: P06 (behaviour parity). P07 optional.
READ: this file, `components/hal_motor/**`, HAL headers from P03
OUT: recipe edits; UI redesign; LVGL-by-default
FORBIDDEN: behaviour change of times/stop/resume; dropping cooperative stop
## IN
Replace Arduino libs with IDF peripherals **behind the same HAL**. Remove Arduino-as-component from the S3 image first, then WROOM.
Order (one commit each, tests+builds green after each):
1. **Audio:** LEDC / `ledc_timer` tones; delete `tone()`.
2. **Motor:** RMT TX pulse train for STEP, GPIO DIR/EN. `hal_motor_request_stop` aborts RMT + EN HIGH. Delete AccelStepper. Same 4800 steps/rev, 60 RPM, accel ≈9600 (RMT may use a short ramp table).
3. **Temp:** RMT or `onewire_bus` IDF component; keep +0.4 °C offset. Delete Dallas/OneWire Arduino.
4. **Keypad:** GPIO matrix scan in `hal_input` (no Keypad lib). Same keymap.
5. **LCD 2004:** IDF I2C + HD44780 nibble commands (or `esp_lcd` panel io i2c). Delete LiquidCrystal_I2C.
6. Drop `espressif/arduino-esp32` from `idf_component.yml` when nothing includes Arduino.h.
Do not change `hal_*` public headers except adding RMT-specific internals in `.c`.
## VERIFY
Host tests pass (stubs unchanged).
Both boards build without Arduino component.
Hardware WROOM: Custom 10 s, Esc mid-step EN off, Resume remaining, temp display, beep Stop/Resume, complete alarm cancellable.
## COMMITS
Per numbered item above, e.g. `Replace AccelStepper with RMT step pulse HAL`.
## DoD
- [x] `rg -n "Arduino.h|AccelStepper|LiquidCrystal|DallasTemperature|#include <Keypad.h>|#include <OneWire.h>"` empty in `main/` and live `components/hal_*` / `main` (vendor copies remain unlinked under `components/third_party/`)
- [x] Stop still EN-off first (`hal_motor_request_stop` EN HIGH then RMT abort)
- [x] STATUS→DONE
Notes: audio was already LEDC; converted to C. Motor RMT copy-encoder batches + short accel table. Temp `espressif/onewire_bus` + skip-ROM scratchpad, +0.4 °C. Keypad GPIO scan, same 5x4 map. LCD PCF8574 nibble HD44780 on I2C0. Dropped `espressif/arduino-esp32` and `initArduino()`. Host ctest green. Local `idf.py` not run (no IDF_PATH). Hw unflashed.