Fix standalone mode button trigger on non-PM5 platforms

The 1-second button hold that launches a standalone mode has been a
no-op on every platform except PM5 since e3511c535 ("Used HAL layer").

That commit repurposed the long press as a power-off gesture for PM5,
but commented out the RunMod() call unconditionally while guarding only
the new power-off code with #ifdef PM5. On PM3 builds the BUTTON_HOLD
branch therefore compiles down to an empty block, leaving CMD_STANDALONE
(the client's `hw standalone` command) as the only remaining entry point
to a standalone mode -- which defeats their purpose, since standalone
modes exist to run without a host attached.

Restore the call under #ifndef PM5 and move the PM5 power-off code to
the #else branch, matching the guard style used elsewhere in the same
commit.

Verified: PM3RDV4 and PM3GENERIC images now have two RunMod call sites
(AppMain + CMD_STANDALONE); PM5 still has one and retains its power-off
path.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Shaw Innes
2026-08-28 14:16:02 +02:00
committed by Philippe Teuwen
co-authored by Claude Opus 5
parent bd52734774
commit b6e9d48a35
2 changed files with 6 additions and 5 deletions
+1
View File
@@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file.
This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log...
## [unreleased][unreleased]
- Fixed standalone modes - the one second button hold trigger was a no-op on all non-PM5 platforms, leaving `hw standalone` over USB as the only entry point (@ShawInnes)
- Added `sim022.bin` - enabled burst mode transfers, which allows us to do TA1=96 in speeds (@iceman1001)
- Fixed `hf felica liteauth` - empty long option names for `-c` and `-k` made argtable read past the string (found by ASAN on `--fulltext`) (@Msprg)
- Added `sim020.bin` - v4.60 of sim module firmware, better T=0 handling and clock etu handling (@iceman1001)
+5 -5
View File
@@ -3907,11 +3907,11 @@ void __attribute__((noreturn)) AppMain(void) {
* So this is the trigger to execute a standalone mod. Generic entrypoint by following the standalone/standalone.h headerfile
* All standalone mod "main loop" should be the RunMod() function.
*/
// allow_send_wtx = false;
// RunMod();
// allow_send_wtx = true;
#ifdef PM5 // TODO DXL Test long press to device shutdown, temporarily blocking standalone mod
#ifndef PM5
allow_send_wtx = false;
RunMod();
allow_send_wtx = true;
#else // TODO DXL Test long press to device shutdown, temporarily blocking standalone mod
/*
StartTicks();