summaryrefslogtreecommitdiff
path: root/firmware/target/coldfire/iaudio/x5/button-x5.c
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-10-13 14:18:35 -0400
committerSolomon Peachy <pizza@shaftnet.org>2020-10-13 14:18:35 -0400
commitf8bd54d5759c78d0777f25cad287a6dbeb0b45ea (patch)
treee2e4e79cd7bd166ceecb21d0dfd4acb530e1b69c /firmware/target/coldfire/iaudio/x5/button-x5.c
parentca326896d0dfd7693ab3b7097d0fe3ad6ab0a0c9 (diff)
iaudiox5: Fix red, due to slightly bogus asm
Change-Id: I6ebcda3452d4244b5e2d1a9bbeb9fff9a9456388
Diffstat (limited to 'firmware/target/coldfire/iaudio/x5/button-x5.c')
-rw-r--r--firmware/target/coldfire/iaudio/x5/button-x5.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/firmware/target/coldfire/iaudio/x5/button-x5.c b/firmware/target/coldfire/iaudio/x5/button-x5.c
index e1f68de36b..b94a0de678 100644
--- a/firmware/target/coldfire/iaudio/x5/button-x5.c
+++ b/firmware/target/coldfire/iaudio/x5/button-x5.c
@@ -60,14 +60,18 @@ bool remote_button_hold(void)
int button_read_device(void)
{
int btn = BUTTON_NONE;
+#ifndef BOOTLOADER
bool hold_button_old;
bool remote_hold_button_old;
+#endif
static int prev_data = 0xff;
static int last_valid = 0xff;
int data;
/* normal buttons */
+#ifndef BOOTLOADER
hold_button_old = hold_button;
+#endif
hold_button = button_hold();
#ifndef BOOTLOADER
@@ -86,7 +90,7 @@ int button_read_device(void)
last_valid = data;
prev_data = data;
data = last_valid;
-
+
if (data < 0xf0)
{
if(data < 0x7c)
@@ -114,7 +118,9 @@ int button_read_device(void)
/* remote buttons */
data = remote_detect() ? adc_scan(ADC_REMOTE) : 0xff;
+#ifndef BOOTLOADER
remote_hold_button_old = remote_hold_button;
+#endif
remote_hold_button = data < 0x17;
#ifndef BOOTLOADER