diff options
| author | YP3 Audiobook <noreply@example.invalid> | 2026-11-27 00:51:12 +0000 |
|---|---|---|
| committer | YP3 Audiobook <noreply@example.invalid> | 2026-11-27 00:51:12 +0000 |
| commit | 7a06b5d2d7ac329dc5cba794b019ba185b9b09e2 (patch) | |
| tree | fac537bb029a8532aadec97816292c3074b9e608 /patches/0010-yp3-ignore-the-power-on-key-until-it-is-released.patch | |
| parent | 4b670f7ac2635de6d6583d603d97f0bcfbec6733 (diff) | |
| download | yp3-audiobook-firmware-7a06b5d2d7ac329dc5cba794b019ba185b9b09e2.tar.gz | |
Release 1.1
- Hold Up/Down to keep changing the volume
- Pulling the SD card powers the player off instead of crashing; with no
card at power-on it says so and turns off
- Long M4B books load without freezing the controls, with a
"Loading book N%" screen
- The Center press that powers the player on no longer pauses the book
as it resumes (which also made it load twice)
- No "Bookmark saved" pause at power-off
- USB disk shows up right away while a book loads (flasher's
"NO USB DISK")
- tests/m4a: host test of the M4B index loader
Diffstat (limited to 'patches/0010-yp3-ignore-the-power-on-key-until-it-is-released.patch')
| -rw-r--r-- | patches/0010-yp3-ignore-the-power-on-key-until-it-is-released.patch | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/patches/0010-yp3-ignore-the-power-on-key-until-it-is-released.patch b/patches/0010-yp3-ignore-the-power-on-key-until-it-is-released.patch new file mode 100644 index 0000000..7561192 --- /dev/null +++ b/patches/0010-yp3-ignore-the-power-on-key-until-it-is-released.patch @@ -0,0 +1,82 @@ +From a7863201fe90839c670bfe6373e7d88360518835 Mon Sep 17 00:00:00 2001 +From: YP3 Audiobook <noreply@example.invalid> +Date: Fri, 27 Nov 2026 00:30:35 +0000 +Subject: [PATCH 10/11] yp3: ignore the power-on key until it is released + +The player powers on with a long press of Center. Held until Rockbox +was up (~5 s), its release reached Now Playing as Center, play/pause, +and paused the book being resumed: the boots that "loaded the book +twice" were these (with rewind-on-pause seeking during the load), and +the book then stayed paused. + +A key held when the buttons start is now ignored until it is released. + +--- + apps/main.c | 15 +++++++++++++++ + firmware/export/config/yp3.h | 3 +++ + 2 files changed, 18 insertions(+) + +diff --git a/apps/main.c b/apps/main.c +index ca189b07..6034408f 100644 +--- a/apps/main.c ++++ b/apps/main.c +@@ -31,6 +31,7 @@ + #include "led.h" + #include "../kernel-internal.h" + #include "button.h" ++#include "action.h" + #include "core_keymap.h" + #include "tree.h" + #include "filetypes.h" +@@ -167,6 +168,9 @@ + // #define AUTOROCK VIEWERS_DATA_DIR"/imageviewer.rock" + // #define AUTOROCK_ARG "/jpegs/sample.jpg" + ++#ifdef IGNORE_POWER_ON_KEY ++static bool key_held_at_boot; ++#endif + static void init(void); + /* main(), and various functions called by main() and init() may be + * be INIT_ATTR. These functions must not be called after the final call +@@ -258,6 +262,12 @@ int main(void) + #endif + #ifdef HAVE_BATTLOG + battlog_start(); ++#endif ++#ifdef IGNORE_POWER_ON_KEY ++ /* Ignore the power-on key until it is released (its press and ++ release may already be queued; other events are kept) */ ++ if (key_held_at_boot) ++ action_wait_for_release(); + #endif + CHART(">root_menu"); + root_menu(); +@@ -592,6 +602,11 @@ static void init(void) + backlight_init(); + + button_init(); ++#ifdef IGNORE_POWER_ON_KEY ++ /* The key that powered the player on, if still held: Center on the ++ YP3, whose release (play/pause) paused the book while it loaded */ ++ key_held_at_boot = (button_read_device() & BUTTON_MAIN) != 0; ++#endif + + /* Don't initialize power management here if it could incorrectly + * measure battery voltage, and it's not needed for charging. */ +diff --git a/firmware/export/config/yp3.h b/firmware/export/config/yp3.h +index ec0ccdab..4624ad2d 100644 +--- a/firmware/export/config/yp3.h ++++ b/firmware/export/config/yp3.h +@@ -26,6 +26,9 @@ + * carries on, otherwise playback pauses, writes are dropped instead of + * panicking, and the player powers off a few seconds later. */ + #define HAVE_SD_CARD_SWAP ++/* The key held to power on (Center) is ignored until released: its ++ * release toggled play/pause while a resumed book loaded (apps/main.c) */ ++#define IGNORE_POWER_ON_KEY + #endif + #define CONFIG_CPU SL6801 + #define CPU_FREQ 192000000 +-- +2.56.1 + |
