From d8666336a76391b7e0472c98b3ab7bcee41d580a Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Mon, 14 Nov 2011 21:07:48 +0000 Subject: [PATCH] imx233: add adc debug screen git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30983 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/imx233/debug-imx233.c | 37 ++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/firmware/target/arm/imx233/debug-imx233.c b/firmware/target/arm/imx233/debug-imx233.c index afdc6d0565..d4f5170f7e 100644 --- a/firmware/target/arm/imx233/debug-imx233.c +++ b/firmware/target/arm/imx233/debug-imx233.c @@ -25,6 +25,8 @@ #include "action.h" #include "lcd.h" #include "font.h" +#include "adc.h" +#include "adc-imx233.h" static struct { @@ -78,9 +80,42 @@ bool dbg_hw_info_dma(void) } } +bool dbg_hw_info_adc(void) +{ + lcd_setfont(FONT_SYSFIXED); + + while(1) + { + int button = get_action(CONTEXT_STD, HZ / 25); + switch(button) + { + case ACTION_STD_NEXT: + case ACTION_STD_PREV: + case ACTION_STD_OK: + case ACTION_STD_MENU: + lcd_setfont(FONT_UI); + return true; + case ACTION_STD_CANCEL: + lcd_setfont(FONT_UI); + return false; + } + + lcd_clear_display(); + + for(unsigned i = 0; i < NUM_ADC_CHANNELS; i++) + { + lcd_putsf(0, i, "%s %d", imx233_adc_channel_name[i], + adc_read(i)); + } + + lcd_update(); + yield(); + } +} + bool dbg_hw_info(void) { - return dbg_hw_info_dma() && dbg_hw_target_info(); + return dbg_hw_info_dma() && dbg_hw_info_adc() && dbg_hw_target_info(); } bool dbg_ports(void)