summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2021-11-03 13:16:40 -0400
committerSolomon Peachy <pizza@shaftnet.org>2021-11-03 13:16:40 -0400
commit5e663f0420c97ef90a7d38f42d86ca2c6ea59752 (patch)
tree6fc8d0e2f6949cecd0a5794e6c907d7c7fba150e
parent2731144094c8ba324a2936a1f8969d52d3a18713 (diff)
downloadrockbox-5e663f0420c97ef90a7d38f42d86ca2c6ea59752.tar.gz
rockbox-5e663f0420c97ef90a7d38f42d86ca2c6ea59752.zip
xduoox3ii: Ignore the remote events when headphones aren't plugged in
This prevents the actual insertion/removal from triggering false events Change-Id: I54114ce903e110c31eca6b2ce258a0cf5f6b782b
-rw-r--r--firmware/target/hosted/xduoo/button-xduoo.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/firmware/target/hosted/xduoo/button-xduoo.c b/firmware/target/hosted/xduoo/button-xduoo.c
index 568ad2614d..c06b60bd9f 100644
--- a/firmware/target/hosted/xduoo/button-xduoo.c
+++ b/firmware/target/hosted/xduoo/button-xduoo.c
@@ -58,13 +58,13 @@ int button_map(int keycode)
#if defined(XDUOO_X3II) && defined(USE_REMOTE) /* Headphone remote */
case KEY_NEXTSONG:
- return (BUTTON_NEXT | BUTTON_DELAY_RELEASE);
+ return headphones_inserted()? (BUTTON_NEXT | BUTTON_DELAY_RELEASE) : 0;
case KEY_PLAYPAUSE:
- return (BUTTON_PLAY | BUTTON_DELAY_RELEASE);
+ return headphones_inserted()? (BUTTON_PLAY | BUTTON_DELAY_RELEASE) : 0;
case KEY_PREVIOUSSONG:
- return (BUTTON_PREV | BUTTON_DELAY_RELEASE);
+ return headphones_inserted()? (BUTTON_PREV | BUTTON_DELAY_RELEASE) : 0;
#endif
default: