summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/as3525
diff options
context:
space:
mode:
authorMichael Giacomelli <giac2000@hotmail.com>2016-01-18 22:35:56 +0100
committerMichael Giacomelli <giac2000@hotmail.com>2016-01-18 22:35:56 +0100
commit784790dbec40695bd6d74c862d9e5730e17ba9fd (patch)
treef9deffae8b09e74cfde0836d7b903a2ae26b6653 /firmware/target/arm/as3525
parent1015088d90275336e7b999624d2524800b8aa3e8 (diff)
downloadrockbox-784790dbec40695bd6d74c862d9e5730e17ba9fd.tar.gz
rockbox-784790dbec40695bd6d74c862d9e5730e17ba9fd.tar.bz2
rockbox-784790dbec40695bd6d74c862d9e5730e17ba9fd.zip
Change the clipv2 button driver to use fixed delays rather than processor cycle counting.
Also introduce a new delay needed for frequency scaling. Change-Id: I575a503a8ca44358fcd5512fd951fe9c7bbde31c
Diffstat (limited to 'firmware/target/arm/as3525')
-rw-r--r--firmware/target/arm/as3525/button-clip.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/firmware/target/arm/as3525/button-clip.c b/firmware/target/arm/as3525/button-clip.c
index 35b5e8af5e..c83590a06e 100644
--- a/firmware/target/arm/as3525/button-clip.c
+++ b/firmware/target/arm/as3525/button-clip.c
@@ -118,10 +118,7 @@ bool button_hold(void)
#ifdef SANSA_CLIPV2
GPIOA_DIR |= 1<<7;
GPIOA_PIN(7) = 1<<7;
-
- int delay = 50;
- while(delay--)
- asm("nop");
+ udelay(2);
#endif
bool hold_button = (GPIOA_PIN(3) != 0);
@@ -129,6 +126,7 @@ bool button_hold(void)
#ifdef SANSA_CLIPV2
GPIOA_PIN(7) = 0;
GPIOA_DIR &= ~(1<<7);
+ udelay(4);
#endif
#ifndef BOOTLOADER