From 57667c51cf09de052222484ce94fbd6da113a55c Mon Sep 17 00:00:00 2001 From: Rafaël Carré Date: Wed, 6 Jan 2010 23:41:36 +0000 Subject: Sansa AMS: refactor DBOP button reading (e200v2/Fuze/c200v2) This gets rid of LCD glitches on Sansa Fuze, and now LCD transfers can get interrupted by button reading Flyspray: FS #10603 Author: Bertrik Sikken git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24192 a1c6a512-1295-4272-9138-f99709370657 --- .../target/arm/as3525/sansa-c200v2/button-c200v2.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) (limited to 'firmware/target/arm/as3525/sansa-c200v2/button-c200v2.c') diff --git a/firmware/target/arm/as3525/sansa-c200v2/button-c200v2.c b/firmware/target/arm/as3525/sansa-c200v2/button-c200v2.c index b7ce7330c0..8a95c2d661 100644 --- a/firmware/target/arm/as3525/sansa-c200v2/button-c200v2.c +++ b/firmware/target/arm/as3525/sansa-c200v2/button-c200v2.c @@ -5,9 +5,9 @@ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ * \/ \/ \/ \/ \/ - * $Id: button-e200v2.c 19035 2008-11-07 05:31:05Z jdgordon $ + * $Id: button-c200v2.c 19035 2008-11-07 05:31:05Z jdgordon $ * - * Copyright (C) 2006 by Barry Wardell + * Copyright (C) 2006 by Barry Wardell, (C) 2009 by Bertrik Sikken * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -19,29 +19,20 @@ * ****************************************************************************/ +#include "config.h" #include "system.h" #include "button-target.h" #include "button.h" #include "backlight.h" -#include "powermgmt.h" +#include "dbop-as3525.h" - -static unsigned short _dbop_din = 0xFFFF; - -/* in the lcd driver */ -extern unsigned short int lcd_dbop_input(void); +static unsigned short _dbop_din; static bool hold_button = false; #ifndef BOOTLOADER static bool hold_button_old = false; #endif -/* for the debug menu */ -unsigned short button_dbop_data(void) -{ - return _dbop_din; -} - void button_init_device(void) { GPIOA_DIR &= ~(1<<3); @@ -59,7 +50,7 @@ int button_read_device(void) { int btn = BUTTON_NONE; - _dbop_din = lcd_dbop_input(); + _dbop_din = dbop_read_input(); /* hold button handling */ hold_button = ((_dbop_din & (1<<12)) == 0); -- cgit v1.2.3