Compare commits
3
Commits
adff1d963b
...
8f7db974fa
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8f7db974fa | ||
|
|
02d226b949 | ||
|
|
d71e28c85d |
@@ -194,7 +194,7 @@ void app_machine_init(void)
|
|||||||
s_deadline_ms = 0;
|
s_deadline_ms = 0;
|
||||||
s_have_deadline = false;
|
s_have_deadline = false;
|
||||||
s_resume_pending = false;
|
s_resume_pending = false;
|
||||||
s_auto_advance = false;
|
s_auto_advance = true;
|
||||||
|
|
||||||
if (s_evtq == NULL) {
|
if (s_evtq == NULL) {
|
||||||
s_evtq = xQueueCreate(UI_EVT_QUEUE_LEN, sizeof(ui_evt_t));
|
s_evtq = xQueueCreate(UI_EVT_QUEUE_LEN, sizeof(ui_evt_t));
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ The branch was cut with uncommitted `components/app_machine/app_machine.c` chang
|
|||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- |
|
||||||
| A00 | `audit/A00-docs.md` | Land audit doc + megaplan + phase files | DONE |
|
| A00 | `audit/A00-docs.md` | Land audit doc + megaplan + phase files | DONE |
|
||||||
| A01 | `audit/A01-machine-timing-queue.md` | Deadline fix + FreeRTOS event queue + host queue shim | DONE |
|
| A01 | `audit/A01-machine-timing-queue.md` | Deadline fix + FreeRTOS event queue + host queue shim | DONE |
|
||||||
| A02 | `audit/A02-auto-advance.md` | Restore auto-arm after step complete + test rework | TODO |
|
| A02 | `audit/A02-auto-advance.md` | Restore auto-arm after step complete + test rework | DONE |
|
||||||
| A03 | `audit/A03-task-wdt.md` | Explicit TWDT init/reconfigure + `add()` failure logging | TODO |
|
| A03 | `audit/A03-task-wdt.md` | Explicit TWDT init/reconfigure + `add()` failure logging | TODO |
|
||||||
| A04 | `audit/A04-temp-nonblocking.md` | OPTIONAL: non-blocking DS18B20 conversion | TODO |
|
| A04 | `audit/A04-temp-nonblocking.md` | OPTIONAL: non-blocking DS18B20 conversion | TODO |
|
||||||
|
|
||||||
|
|||||||
@@ -52,6 +52,8 @@ P07 Notes: custom NV3041A QSPI + GT911; shared app_ui text grid + colour softkey
|
|||||||
|
|
||||||
P08 Notes: LEDC audio; RMT STEP + GPIO DIR/EN; onewire_bus DS18B20 +0.4; GPIO keypad; IDF I2C 2004. Arduino-as-component removed. third_party trees unlinked. host ctest green. idf.py not run here (no IDF_PATH). hw unflashed.
|
P08 Notes: LEDC audio; RMT STEP + GPIO DIR/EN; onewire_bus DS18B20 +0.4; GPIO keypad; IDF I2C 2004. Arduino-as-component removed. third_party trees unlinked. host ctest green. idf.py not run here (no IDF_PATH). hw unflashed.
|
||||||
|
|
||||||
|
AUDIT A02 Notes: supersedes the frozen `auto_advance` default-false constraint — `s_auto_advance = true` restores the legacy auto-ARM chain (audit item 3, owner-approved); auto-ARM only, never auto-run.
|
||||||
|
|
||||||
## Dependency
|
## Dependency
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
# A02 — restore auto-advance (auto-arm next step after complete)
|
# A02 — restore auto-advance (auto-arm next step after complete)
|
||||||
|
|
||||||
STATUS: TODO
|
STATUS: DONE
|
||||||
DEPENDS: A01
|
DEPENDS: A01
|
||||||
|
Notes: `stop_disables_motor_and_resume` final assertion updated to `ST_ARMED` — the "unchanged" list cannot hold once auto-advance is on (resume-to-complete auto-arms step 1).
|
||||||
|
|
||||||
**READ:** this file, `docs/megaplans/AUDIT-MEGAPLAN.md`, `docs/audit_remediation_plan.md` item 3, `docs/CURRENT_STATE.md` §Runtime behaviour, `components/app_machine/app_machine.c`, `tests/host/test_machine.c`
|
**READ:** this file, `docs/megaplans/AUDIT-MEGAPLAN.md`, `docs/audit_remediation_plan.md` item 3, `docs/CURRENT_STATE.md` §Runtime behaviour, `components/app_machine/app_machine.c`, `tests/host/test_machine.c`
|
||||||
|
|
||||||
@@ -34,9 +35,9 @@ All green, including the new `auto_advance_last_step_goes_idle`. Firmware builds
|
|||||||
2. `Update machine tests for auto-advance`
|
2. `Update machine tests for auto-advance`
|
||||||
|
|
||||||
**DoD checkboxes:**
|
**DoD checkboxes:**
|
||||||
- [ ] `s_auto_advance = true`; auto-ARM only, never auto-run.
|
- [x] `s_auto_advance = true`; auto-ARM only, never auto-run.
|
||||||
- [ ] Last step completes → `ST_IDLE` + `EVT_PROCESS_IDLE`.
|
- [x] Last step completes → `ST_IDLE` + `EVT_PROCESS_IDLE`.
|
||||||
- [ ] `ST_COMPLETE` + `CMD_STOP` branch retained.
|
- [x] `ST_COMPLETE` + `CMD_STOP` branch retained.
|
||||||
- [ ] REFACTOR-MEGAPLAN supersede note added.
|
- [x] REFACTOR-MEGAPLAN supersede note added.
|
||||||
- [ ] Host ctest green.
|
- [x] Host ctest green.
|
||||||
- [ ] STATUS → DONE here and in the megaplan table.
|
- [x] STATUS → DONE here and in the megaplan table.
|
||||||
|
|||||||
+17
-17
@@ -145,12 +145,10 @@ static void arm_start_complete_custom_10s(void)
|
|||||||
app_machine_tick(9999);
|
app_machine_tick(9999);
|
||||||
expect_int((int)app_machine_state(), ST_RUNNING, "custom tick9999");
|
expect_int((int)app_machine_state(), ST_RUNNING, "custom tick9999");
|
||||||
app_machine_tick(10000);
|
app_machine_tick(10000);
|
||||||
expect_int((int)app_machine_state(), ST_COMPLETE, "custom complete");
|
expect_int((int)app_machine_state(), ST_ARMED, "custom auto-armed next");
|
||||||
|
expect_int((int)app_machine_step_index(), 1, "custom auto-advance step");
|
||||||
expect_int(stub_motor_enabled ? 1 : 0, 0, "custom motor off complete");
|
expect_int(stub_motor_enabled ? 1 : 0, 0, "custom motor off complete");
|
||||||
expect_int(stub_alarm_count >= 1 ? 1 : 0, 1, "custom alarm");
|
expect_int(stub_alarm_count >= 1 ? 1 : 0, 1, "custom alarm");
|
||||||
/* default auto_advance false */
|
|
||||||
app_machine_tick(10001);
|
|
||||||
expect_int((int)app_machine_state(), ST_COMPLETE, "auto_advance stays complete");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void stop_disables_motor_and_resume(void)
|
static void stop_disables_motor_and_resume(void)
|
||||||
@@ -182,7 +180,7 @@ static void stop_disables_motor_and_resume(void)
|
|||||||
expect_int(stub_beep_count >= beeps + 1 ? 1 : 0, 1, "resume beep");
|
expect_int(stub_beep_count >= beeps + 1 ? 1 : 0, 1, "resume beep");
|
||||||
app_machine_tick(1000);
|
app_machine_tick(1000);
|
||||||
app_machine_tick(1000 + rem);
|
app_machine_tick(1000 + rem);
|
||||||
expect_int((int)app_machine_state(), ST_COMPLETE, "resume then complete");
|
expect_int((int)app_machine_state(), ST_ARMED, "resume then auto-armed");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void return_from_stopped(void)
|
static void return_from_stopped(void)
|
||||||
@@ -208,23 +206,23 @@ static void return_from_stopped(void)
|
|||||||
expect_int((int)app_process_get(PROC_CUSTOM)->steps[0].time_s, 10, "const still 10");
|
expect_int((int)app_process_get(PROC_CUSTOM)->steps[0].time_s, 10, "const still 10");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void stop_during_complete_cancels_alarm(void)
|
static void auto_advance_last_step_goes_idle(void)
|
||||||
{
|
{
|
||||||
app_machine_init();
|
app_machine_init();
|
||||||
ui_cmd_t c = cmd_select(PROC_CUSTOM);
|
ui_cmd_t c = cmd_select(PROC_CUSTOM);
|
||||||
app_machine_handle_cmd(&c);
|
app_machine_handle_cmd(&c);
|
||||||
ui_cmd_t arm = cmd_arm(0);
|
ui_cmd_t arm = cmd_arm(3);
|
||||||
app_machine_handle_cmd(&arm);
|
app_machine_handle_cmd(&arm);
|
||||||
ui_cmd_t start = cmd_start(0);
|
ui_cmd_t start = cmd_start(3);
|
||||||
app_machine_handle_cmd(&start);
|
app_machine_handle_cmd(&start);
|
||||||
app_machine_tick(0);
|
app_machine_tick(0);
|
||||||
app_machine_tick(10000);
|
app_machine_tick(10000);
|
||||||
expect_int((int)app_machine_state(), ST_COMPLETE, "complete before stop");
|
expect_int((int)app_machine_state(), ST_IDLE, "last step goes idle");
|
||||||
int cancels = stub_alarm_cancel_count;
|
ui_evt_id_t ids[8];
|
||||||
ui_cmd_t stop = cmd_id(CMD_STOP);
|
int n = pop_ids(ids, 8);
|
||||||
app_machine_handle_cmd(&stop);
|
if (!has_id(ids, n, EVT_PROCESS_IDLE)) {
|
||||||
expect_int((int)app_machine_state(), ST_STEP_SELECT, "stop from complete");
|
fail("last step idle event");
|
||||||
expect_int(stub_alarm_cancel_count >= cancels + 1 ? 1 : 0, 1, "alarm cancel");
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ecn2_remjet_zero_time(void)
|
static void ecn2_remjet_zero_time(void)
|
||||||
@@ -246,7 +244,8 @@ static void ecn2_remjet_zero_time(void)
|
|||||||
expect_int(stub_motor_enabled ? 1 : 0, 0, "remjet no enable");
|
expect_int(stub_motor_enabled ? 1 : 0, 0, "remjet no enable");
|
||||||
expect_int(stub_agitate_start_count, starts, "remjet no agitate");
|
expect_int(stub_agitate_start_count, starts, "remjet no agitate");
|
||||||
app_machine_tick(0);
|
app_machine_tick(0);
|
||||||
expect_int((int)app_machine_state(), ST_COMPLETE, "remjet complete next tick");
|
expect_int((int)app_machine_state(), ST_ARMED, "remjet auto-armed next");
|
||||||
|
expect_int((int)app_machine_step_index(), 2, "remjet auto-advance step");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void stop_ignored_meaningless_in_idle(void)
|
static void stop_ignored_meaningless_in_idle(void)
|
||||||
@@ -275,7 +274,8 @@ static void c41_clock(void)
|
|||||||
app_machine_tick(179999);
|
app_machine_tick(179999);
|
||||||
expect_int((int)app_machine_state(), ST_RUNNING, "c41 tick179999");
|
expect_int((int)app_machine_state(), ST_RUNNING, "c41 tick179999");
|
||||||
app_machine_tick(180000);
|
app_machine_tick(180000);
|
||||||
expect_int((int)app_machine_state(), ST_COMPLETE, "c41 tick180000");
|
expect_int((int)app_machine_state(), ST_ARMED, "c41 auto-armed next");
|
||||||
|
expect_int((int)app_machine_step_index(), 1, "c41 auto-advance step");
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
@@ -285,7 +285,7 @@ int main(void)
|
|||||||
arm_start_complete_custom_10s();
|
arm_start_complete_custom_10s();
|
||||||
stop_disables_motor_and_resume();
|
stop_disables_motor_and_resume();
|
||||||
return_from_stopped();
|
return_from_stopped();
|
||||||
stop_during_complete_cancels_alarm();
|
auto_advance_last_step_goes_idle();
|
||||||
ecn2_remjet_zero_time();
|
ecn2_remjet_zero_time();
|
||||||
stop_ignored_meaningless_in_idle();
|
stop_ignored_meaningless_in_idle();
|
||||||
c41_clock();
|
c41_clock();
|
||||||
|
|||||||
Reference in New Issue
Block a user