summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorTobias Diedrich <ranma+coreboot@tdiedrich.de>2010-06-27 02:50:24 +0000
committerTobias Diedrich <ranma+coreboot@tdiedrich.de>2010-06-27 02:50:24 +0000
commiteefe273ce6395f3f6872a63f0a0f242b5065a17e (patch)
treef089b8ca89e1209746c58b213abc5a6fcd73f784 /firmware
parentac40959c48ced2c2dee30d3977e1671ceb941371 (diff)
downloadrockbox-eefe273ce6395f3f6872a63f0a0f242b5065a17e.tar.gz
rockbox-eefe273ce6395f3f6872a63f0a0f242b5065a17e.tar.bz2
rockbox-eefe273ce6395f3f6872a63f0a0f242b5065a17e.zip
DBOP noise on C200v2 goes away if we precharge long enough.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27148 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/target/arm/as3525/dbop-as3525.c45
-rw-r--r--firmware/target/arm/as3525/debug-as3525.c11
2 files changed, 5 insertions, 51 deletions
diff --git a/firmware/target/arm/as3525/dbop-as3525.c b/firmware/target/arm/as3525/dbop-as3525.c
index 87bc46e145..1816b5205b 100644
--- a/firmware/target/arm/as3525/dbop-as3525.c
+++ b/firmware/target/arm/as3525/dbop-as3525.c
@@ -34,49 +34,9 @@
/* doesn't work with the new ams sansas so far and is not needed */
static short int dbop_input_value = 0;
-#if defined(SANSA_C200V2)
-/*
- * workaround DBOP noise issue cause it's really annoying if your
- * buttons don't work in the debug menu...
- */
-static short int input_value_tmp[2];
-int dbop_denoise_reject = 0;
-int dbop_denoise_accept = 0;
-#endif
-
/* read the DBOP data pins */
-#if defined(SANSA_C200V2)
-unsigned short dbop_read_input_once(void);
-
unsigned short dbop_read_input(void)
{
- int i;
-
- while (1) {
- for (i=0; i<2; i++) {
- input_value_tmp[i] = dbop_read_input_once();
- }
- /* noise rejection */
- if (input_value_tmp[0] == input_value_tmp[1]) {
- dbop_denoise_accept++;
- break;
- } else {
- dbop_denoise_reject++;
- }
- }
- if (dbop_denoise_accept + dbop_denoise_reject > 1000) {
- dbop_denoise_accept /= 2;
- dbop_denoise_reject /= 2;
- }
-
- return dbop_input_value;
-}
-
-unsigned short dbop_read_input_once(void)
-#else
-unsigned short dbop_read_input(void)
-#endif
-{
unsigned int dbop_ctrl_old = DBOP_CTRL;
unsigned int dbop_timpol23_old = DBOP_TIMPOL_23;
@@ -92,6 +52,11 @@ unsigned short dbop_read_input(void)
(1 << 16) | /* enw=1 (enable write) */
(1 << 12); /* ow=1 (16-bit data width) */
DBOP_DOUT = DBOP_PRECHARGE;
+#if defined(SANSA_C200V2)
+ /* two additional writes to precharge longer get rid of the read noise */
+ DBOP_DOUT = DBOP_PRECHARGE;
+ DBOP_DOUT = DBOP_PRECHARGE;
+#endif
while ((DBOP_STAT & (1<<10)) == 0);
#if defined(SANSA_FUZE) || defined(SANSA_E200V2)
diff --git a/firmware/target/arm/as3525/debug-as3525.c b/firmware/target/arm/as3525/debug-as3525.c
index e6ae3a4a5d..71a8a85022 100644
--- a/firmware/target/arm/as3525/debug-as3525.c
+++ b/firmware/target/arm/as3525/debug-as3525.c
@@ -269,21 +269,10 @@ bool __dbg_hw_info(void)
while(1)
{
#ifdef SANSA_C200V2
- extern int dbop_denoise_accept;
- extern int dbop_denoise_reject;
-
lcd_clear_display();
line = 0;
lcd_puts(0, line++, "[Submodel:]");
lcd_putsf(0, line++, "C200v2 variant %d", c200v2_variant);
- if (dbop_denoise_accept) {
- lcd_putsf(0, line++, "DBOP noise: %d%%",
- (100*dbop_denoise_reject)/dbop_denoise_accept);
- } else {
- lcd_puts(0, line++, "DBOP noise: oo");
- }
- lcd_putsf(0, line++, "reject: %d", dbop_denoise_reject);
- lcd_putsf(0, line++, "accept: %d", dbop_denoise_accept);
lcd_update();
int btn = button_get_w_tmo(HZ/10);
if(btn == (DEBUG_CANCEL|BUTTON_REL))