P05 requires landed app_machine + hal_* headers. Those files are absent and P03 is still TODO. Record the block; do not invent public APIs.
3.7 KiB
BLOCKED: P03 artifacts missing on branch refactor/esp-idf-modular-ui @ 415c13a.
Required and absent:
- components/app_machine/ (include/app_machine.h, app_machine.c)
- components/hal_motor/include/hal_motor.h
- components/hal_temp/include/hal_temp.h
- components/hal_audio/include/hal_audio.h
Megaplan table still lists P03 STATUS=TODO. Protocol: P05 requires P03 APIs. Do not invent or change public HAL/app_machine APIs. Do not implement P01–P04 in this session. No device HAL, tasks, Arduino-as-component, or main.c cutover landed.
P05 — WROOM HAL motor / temp / audio
STATUS: BLOCKED
DEPENDS: P03
READ: this file, include/config.h, src/motor.cpp, src/temperature.cpp, src/sound.cpp, components/hal_*/include/*.h
OUT: rewriting app_ui / deleting menus; S3 motor pins; disabling WDT; vTaskDelete motor
FORBIDDEN: new Arduino libraries; tone() on machine task; blocking OneWire on UI task
IN
Device implementations of hal_motor, hal_temp, hal_audio for board_wroom. Arduino-as-component first allowed here.
Keep AccelStepper behind hal_motor. Inner step loop must sample stop_req every stepper.run() and exit. Motor task is immortal: wait on notification for next agitate_start.
Arduino component
main/idf_component.yml:
dependencies:
espressif/arduino-esp32: "~3.1.0"
If 3.1 conflicts with IDF 5.4, pin the combo that compiles; Notes the versions. Only WROOM firmware enables Arduino this phase; S3 may compile without motor SRCS via if(AUTOFILM_BOARD STREQUAL wroom).
AccelStepper: add as managed component or vendor components/third_party/AccelStepper (upstream 1.64). Prefer idf_component.yml git dep if it builds; else vendor the .cpp/.h used today.
OneWire + DallasTemperature: same policy. Keypad/LCD not this phase.
Pins (wroom only, from config)
| fn | gpio |
|---|---|
| STEP | 12 |
| DIR | 14 |
| EN active-low | 27 |
| DS18B20 | 13 |
| beep | 25 |
STEPS_PER_REV=4800 RPM=60 ACCEL=9600 TEMP_OFFSET=0.4f
motor_task
Priority high, core 0. Loop:
wait notify
while !stop_req && agitating:
move CW cw_revs (run loop checks stop_req)
if stop_req break
move CCW ccw_revs
hal_motor_enable(false)
hal_motor_request_stop: atomic stop_req=1; gpio_set_level(EN,1) immediately; notify. ISR-safe: no heap, no stepper API.
Never vTaskDelete.
temp_task
Low prio. Period: request conversion, vTaskDelay(750ms), read, add 0.4, app_machine_on_temp. On disconnect ok=false. Do not write LCD.
audio_task
Queue of {SHORT, ALARM, CANCEL}. SHORT: one 2 kHz 80–120 ms pulse (LEDC or Arduino tone in this task only). ALARM: 10× (2000 Hz 500 ms on / 250 ms off) abort immediately on CANCEL or STOP queued. Machine never delays for sound.
main.c (wroom)
hal_*_init, app_process_init, app_machine_init, create motor/temp/audio tasks. Do not start UI yet (P06). Optional: 1 Hz log remaining if RUNNING for bring-up.
S3 build: stub motor/temp/audio weak symbols or board-local no-ops so P01 S3 still links.
VERIFY
Host tests still pass.
WROOM idf.py build pass.
Manual on hardware (if unavailable, Notes=hw not flashed; still land code):
- Custom start (will need P06 for keypad — this phase may expose a 5 s auto-demo behind
#ifdef AUTOFILM_MOTION_SMOKEdefault off). Do not enable smoke in production sdkconfig. - Logic-analyzer optional. Minimum: compile + review EN init HIGH.
COMMITS
Add Arduino-as-component and WROOM motor HAL with cooperative stopAdd temp and audio tasks off the UI path
DoD
- EN HIGH at init and on stop
- stop_req checked inside step loop
- OneWire only in temp_task
- tone/LEDC only in audio_task
- STATUS→DONE