From 7f11bf7831673205e7c35c1e71f2f04f60b8dc5b Mon Sep 17 00:00:00 2001 From: wodz Date: Sat, 6 Nov 2010 14:24:25 +0000 Subject: [PATCH] move dbg_ports() from apps/menu_debug.c to target tree. FS#11712 by me. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28522 a1c6a512-1295-4272-9138-f99709370657 --- apps/debug_menu.c | 366 --------------------- firmware/SOURCES | 3 + firmware/target/arm/debug-pp.c | 154 +++++++++ firmware/target/arm/{s3c2440 => }/debug-target.h | 35 +- firmware/target/arm/imx31/debug-imx31.c | 2 +- firmware/target/arm/imx31/debug-target.h | 2 +- firmware/target/arm/pnx0101/debug-pnx0101.c | 5 + .../arm/{tms320dm320 => pnx0101}/debug-target.h | 9 +- firmware/target/arm/s3c2440/debug-s3c2440.c | 2 +- firmware/target/arm/s3c2440/debug-target.h | 2 +- firmware/target/arm/s5l8700/debug-s5l8700.c | 2 +- firmware/target/arm/s5l8700/debug-target.h | 2 +- firmware/target/arm/tcc77x/debug-target.h | 2 +- firmware/target/arm/tcc77x/debug-tcc77x.c | 2 +- firmware/target/arm/tcc780x/debug-target.h | 2 +- firmware/target/arm/tcc780x/debug-tcc780x.c | 2 +- firmware/target/arm/tms320dm320/debug-dm320.c | 2 +- firmware/target/arm/tms320dm320/debug-target.h | 2 +- firmware/target/coldfire/debug-coldfire.c | 106 ++++++ .../{arm/s3c2440 => coldfire}/debug-target.h | 20 +- firmware/target/mips/ingenic_jz47xx/debug-jz4740.c | 2 +- firmware/target/mips/ingenic_jz47xx/debug-target.h | 2 +- firmware/target/sh/debug-sh.c | 103 ++++++ firmware/target/{arm/s3c2440 => sh}/debug-target.h | 15 +- 24 files changed, 435 insertions(+), 409 deletions(-) create mode 100644 firmware/target/arm/debug-pp.c copy firmware/target/arm/{s3c2440 => }/debug-target.h (51%) create mode 100644 firmware/target/arm/pnx0101/debug-pnx0101.c copy firmware/target/arm/{tms320dm320 => pnx0101}/debug-target.h (84%) create mode 100644 firmware/target/coldfire/debug-coldfire.c copy firmware/target/{arm/s3c2440 => coldfire}/debug-target.h (69%) create mode 100644 firmware/target/sh/debug-sh.c copy firmware/target/{arm/s3c2440 => sh}/debug-target.h (82%) diff --git a/apps/debug_menu.c b/apps/debug_menu.c index bedc98ae1..631f02701 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c @@ -99,12 +99,7 @@ #include "pcf50605.h" #endif #include "appevents.h" - -#if CONFIG_CPU == DM320 || CONFIG_CPU == S3C2440 || CONFIG_CPU == TCC7801 \ - || CONFIG_CPU == IMX31L || CONFIG_CPU == AS3525 || CONFIG_CPU == JZ4732 \ - || defined(CPU_S5L870X) || CONFIG_CPU == AS3525v2 #include "debug-target.h" -#endif #if defined(SANSA_E200) || defined(SANSA_C200) || defined(PHILIPS_SA9200) \ || (CONFIG_CPU == AS3525 && defined(CONFIG_CHARGING)) \ @@ -953,367 +948,6 @@ static bool dbg_spdif(void) } #endif /* CPU_COLDFIRE */ -#if (CONFIG_PLATFORM & PLATFORM_NATIVE) -#ifdef HAVE_LCD_BITMAP - /* button definitions */ -#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \ - (CONFIG_KEYPAD == IRIVER_H300_PAD) -# define DEBUG_CANCEL BUTTON_OFF - -#elif CONFIG_KEYPAD == RECORDER_PAD -# define DEBUG_CANCEL BUTTON_OFF - -#elif CONFIG_KEYPAD == ONDIO_PAD -# define DEBUG_CANCEL BUTTON_MENU - -#elif (CONFIG_KEYPAD == IPOD_1G2G_PAD) || \ - (CONFIG_KEYPAD == IPOD_3G_PAD) || \ - (CONFIG_KEYPAD == IPOD_4G_PAD) -# define DEBUG_CANCEL BUTTON_MENU - -#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD -# define DEBUG_CANCEL BUTTON_PLAY - -#elif CONFIG_KEYPAD == IAUDIO_X5M5_PAD -# define DEBUG_CANCEL BUTTON_REC - -#elif (CONFIG_KEYPAD == IAUDIO_M3_PAD) -# define DEBUG_CANCEL BUTTON_RC_REC - -#elif (CONFIG_KEYPAD == IRIVER_H10_PAD) -# define DEBUG_CANCEL BUTTON_REW - -#elif (CONFIG_KEYPAD == MROBE100_PAD) -# define DEBUG_CANCEL BUTTON_MENU - -#elif (CONFIG_KEYPAD == SANSA_E200_PAD) || \ - (CONFIG_KEYPAD == SANSA_C200_PAD) || \ - (CONFIG_KEYPAD == SANSA_FUZE_PAD) -# define DEBUG_CANCEL BUTTON_LEFT - -/* This is temporary until the SA9200 touchpad works */ -#elif (CONFIG_KEYPAD == PHILIPS_SA9200_PAD) || \ - (CONFIG_KEYPAD == PHILIPS_HDD1630_PAD) -# define DEBUG_CANCEL BUTTON_POWER - -#elif (CONFIG_KEYPAD == PHILIPS_HDD6330_PAD) -# define DEBUG_CANCEL BUTTON_PREV - -#elif (CONFIG_KEYPAD == SAMSUNG_YH_PAD) -# define DEBUG_CANCEL BUTTON_PLAY - -#elif (CONFIG_KEYPAD == PBELL_VIBE500_PAD) -# define DEBUG_CANCEL BUTTON_CANCEL - -#elif (CONFIG_KEYPAD == MPIO_HD200_PAD) -# define DEBUG_CANCEL BUTTON_REC - -#endif /* key definitions */ - -/* Test code!!! */ -bool dbg_ports(void) -{ -#if CONFIG_CPU == SH7034 - int adc_battery_voltage, adc_battery_level; - - lcd_setfont(FONT_SYSFIXED); - lcd_clear_display(); - - while(1) - { - lcd_putsf(0, 0, "PADR: %04x", (unsigned short)PADR); - lcd_putsf(0, 1, "PBDR: %04x", (unsigned short)PBDR); - - lcd_putsf(0, 2, "AN0: %03x AN4: %03x", adc_read(0), adc_read(4)); - lcd_putsf(0, 3, "AN1: %03x AN5: %03x", adc_read(1), adc_read(5)); - lcd_putsf(0, 4, "AN2: %03x AN6: %03x", adc_read(2), adc_read(6)); - lcd_putsf(0, 5, "AN3: %03x AN7: %03x", adc_read(3), adc_read(7)); - - battery_read_info(&adc_battery_voltage, &adc_battery_level); - lcd_putsf(0, 6, "Batt: %d.%03dV %d%% ", adc_battery_voltage / 1000, - adc_battery_voltage % 1000, adc_battery_level); - - lcd_update(); - if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL)) - { - lcd_setfont(FONT_UI); - return false; - } - } -#elif defined(CPU_COLDFIRE) - unsigned int gpio_out; - unsigned int gpio1_out; - unsigned int gpio_read; - unsigned int gpio1_read; - unsigned int gpio_function; - unsigned int gpio1_function; - unsigned int gpio_enable; - unsigned int gpio1_enable; - int adc_buttons, adc_remote; - int adc_battery_voltage, adc_battery_level; - int line; - - lcd_clear_display(); - lcd_setfont(FONT_SYSFIXED); - - while(1) - { - line = 0; - gpio_read = GPIO_READ; - gpio1_read = GPIO1_READ; - gpio_out = GPIO_OUT; - gpio1_out = GPIO1_OUT; - gpio_function = GPIO_FUNCTION; - gpio1_function = GPIO1_FUNCTION; - gpio_enable = GPIO_ENABLE; - gpio1_enable = GPIO1_ENABLE; - - lcd_putsf(0, line++, "GPIO_READ: %08x", gpio_read); - lcd_putsf(0, line++, "GPIO_OUT: %08x", gpio_out); - lcd_putsf(0, line++, "GPIO_FUNC: %08x", gpio_function); - lcd_putsf(0, line++, "GPIO_ENA: %08x", gpio_enable); - - lcd_putsf(0, line++, "GPIO1_READ: %08x", gpio1_read); - lcd_putsf(0, line++, "GPIO1_OUT: %08x", gpio1_out); - lcd_putsf(0, line++, "GPIO1_FUNC: %08x", gpio1_function); - lcd_putsf(0, line++, "GPIO1_ENA: %08x", gpio1_enable); - - adc_buttons = adc_read(ADC_BUTTONS); - adc_remote = adc_read(ADC_REMOTE); - battery_read_info(&adc_battery_voltage, &adc_battery_level); -#if defined(IAUDIO_X5) || defined(IAUDIO_M5) || defined(IRIVER_H300_SERIES) - lcd_putsf(0, line++, "ADC_BUTTONS (%c): %02x", - button_scan_enabled() ? '+' : '-', adc_buttons); -#else - lcd_putsf(0, line++, "ADC_BUTTONS: %02x", adc_buttons); -#endif -#if defined(IAUDIO_X5) || defined(IAUDIO_M5) - lcd_putsf(0, line++, "ADC_REMOTE (%c): %02x", - remote_detect() ? '+' : '-', adc_remote); -#else - lcd_putsf(0, line++, "ADC_REMOTE: %02x", adc_remote); -#endif -#if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300_SERIES) - lcd_putsf(0, line++, "ADC_REMOTEDETECT: %02x", - adc_read(ADC_REMOTEDETECT)); -#endif - - lcd_putsf(0, line++, "Batt: %d.%03dV %d%% ", adc_battery_voltage / 1000, - adc_battery_voltage % 1000, adc_battery_level); - -#if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300_SERIES) - lcd_putsf(0, line++, "remotetype: %d", remote_type()); -#endif - - lcd_update(); - if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL)) - { - lcd_setfont(FONT_UI); - return false; - } - } - -#elif defined(CPU_PP502x) - int line; - - lcd_clear_display(); - lcd_setfont(FONT_SYSFIXED); - - while(1) - { - line = 0; -#if (LCD_HEIGHT >= 176) /* Only for displays with appropriate height. */ - lcd_puts(0, line++, "GPIO ENABLE: GPIO OUTPUT ENABLE:"); - lcd_putsf(0, line++, "A: %02x E: %02x I: %02x A: %02x E: %02x I: %02x", - (unsigned int)GPIOA_ENABLE, - (unsigned int)GPIOE_ENABLE, - (unsigned int)GPIOI_ENABLE, - (unsigned int)GPIOA_OUTPUT_EN, - (unsigned int)GPIOE_OUTPUT_EN, - (unsigned int)GPIOI_OUTPUT_EN); - lcd_putsf(0, line++, "B: %02x F: %02x J: %02x B: %02x F: %02x J: %02x", - (unsigned int)GPIOB_ENABLE, - (unsigned int)GPIOF_ENABLE, - (unsigned int)GPIOJ_ENABLE, - (unsigned int)GPIOB_OUTPUT_EN, - (unsigned int)GPIOF_OUTPUT_EN, - (unsigned int)GPIOJ_OUTPUT_EN); - lcd_putsf(0, line++, "C: %02x G: %02x K: %02x C: %02x G: %02x K: %02x", - (unsigned int)GPIOC_ENABLE, - (unsigned int)GPIOG_ENABLE, - (unsigned int)GPIOK_ENABLE, - (unsigned int)GPIOC_OUTPUT_EN, - (unsigned int)GPIOG_OUTPUT_EN, - (unsigned int)GPIOK_OUTPUT_EN); - lcd_putsf(0, line++, "D: %02x H: %02x L: %02x D: %02x H: %02x L: %02x", - (unsigned int)GPIOD_ENABLE, - (unsigned int)GPIOH_ENABLE, - (unsigned int)GPIOL_ENABLE, - (unsigned int)GPIOD_OUTPUT_EN, - (unsigned int)GPIOH_OUTPUT_EN, - (unsigned int)GPIOL_OUTPUT_EN); - line++; -#endif - lcd_puts(0, line++, "GPIO INPUT VAL:"); - lcd_putsf(0, line++, "A: %02x E: %02x I: %02x", - (unsigned int)GPIOA_INPUT_VAL, - (unsigned int)GPIOE_INPUT_VAL, - (unsigned int)GPIOI_INPUT_VAL); - lcd_putsf(0, line++, "B: %02x F: %02x J: %02x", - (unsigned int)GPIOB_INPUT_VAL, - (unsigned int)GPIOF_INPUT_VAL, - (unsigned int)GPIOJ_INPUT_VAL); - lcd_putsf(0, line++, "C: %02x G: %02x K: %02x", - (unsigned int)GPIOC_INPUT_VAL, - (unsigned int)GPIOG_INPUT_VAL, - (unsigned int)GPIOK_INPUT_VAL); - lcd_putsf(0, line++, "D: %02x H: %02x L: %02x", - (unsigned int)GPIOD_INPUT_VAL, - (unsigned int)GPIOH_INPUT_VAL, - (unsigned int)GPIOL_INPUT_VAL); - line++; - lcd_putsf(0, line++, "GPO32_VAL: %08lx", GPO32_VAL); - lcd_putsf(0, line++, "GPO32_EN: %08lx", GPO32_ENABLE); - lcd_putsf(0, line++, "DEV_EN: %08lx", DEV_EN); - lcd_putsf(0, line++, "DEV_EN2: %08lx", DEV_EN2); - lcd_putsf(0, line++, "DEV_EN3: %08lx", inl(0x60006044)); /* to be verified */ - lcd_putsf(0, line++, "DEV_INIT1: %08lx", DEV_INIT1); - lcd_putsf(0, line++, "DEV_INIT2: %08lx", DEV_INIT2); -#ifdef ADC_ACCESSORY - lcd_putsf(0, line++, "ACCESSORY: %d", adc_read(ADC_ACCESSORY)); -#endif -#ifdef IPOD_VIDEO - lcd_putsf(0, line++, "4066_ISTAT: %d", adc_read(ADC_4066_ISTAT)); -#endif - -#if defined(IPOD_ACCESSORY_PROTOCOL) - const unsigned char *serbuf = iap_get_serbuf(); - lcd_putsf(0, line++, "IAP PACKET: %02x %02x %02x %02x %02x %02x %02x %02x", - serbuf[0], serbuf[1], serbuf[2], serbuf[3], serbuf[4], serbuf[5], - serbuf[6], serbuf[7]); -#endif - -#if defined(IRIVER_H10) || defined(IRIVER_H10_5GB) - line++; - lcd_putsf(0, line++, "BATT: %03x UNK1: %03x", - adc_read(ADC_BATTERY), adc_read(ADC_UNKNOWN_1)); - lcd_putsf(0, line++, "REM: %03x PAD: %03x", - adc_read(ADC_REMOTE), adc_read(ADC_SCROLLPAD)); -#elif defined(PHILIPS_HDD1630) || defined(PHILIPS_HDD6330) - line++; - lcd_putsf(0, line++, "BATT: %03x UNK1: %03x", - adc_read(ADC_BATTERY), adc_read(ADC_UNKNOWN_1)); -#elif defined(SANSA_E200) || defined(PHILIPS_SA9200) - lcd_putsf(0, line++, "ADC_BVDD: %4d", adc_read(ADC_BVDD)); - lcd_putsf(0, line++, "ADC_RTCSUP: %4d", adc_read(ADC_RTCSUP)); - lcd_putsf(0, line++, "ADC_UVDD: %4d", adc_read(ADC_UVDD)); - lcd_putsf(0, line++, "ADC_CHG_IN: %4d", adc_read(ADC_CHG_IN)); - lcd_putsf(0, line++, "ADC_CVDD: %4d", adc_read(ADC_CVDD)); - lcd_putsf(0, line++, "ADC_BATTEMP: %4d", adc_read(ADC_BATTEMP)); - lcd_putsf(0, line++, "ADC_MICSUP1: %4d", adc_read(ADC_MICSUP1)); - lcd_putsf(0, line++, "ADC_MICSUP2: %4d", adc_read(ADC_MICSUP2)); - lcd_putsf(0, line++, "ADC_VBE1: %4d", adc_read(ADC_VBE1)); - lcd_putsf(0, line++, "ADC_VBE2: %4d", adc_read(ADC_VBE2)); - lcd_putsf(0, line++, "ADC_I_MICSUP1:%4d", adc_read(ADC_I_MICSUP1)); -#if !defined(PHILIPS_SA9200) - lcd_putsf(0, line++, "ADC_I_MICSUP2:%4d", adc_read(ADC_I_MICSUP2)); - lcd_putsf(0, line++, "ADC_VBAT: %4d", adc_read(ADC_VBAT)); -#endif -#endif - lcd_update(); - if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL)) - { - lcd_setfont(FONT_UI); - return false; - } - } - -#elif CONFIG_CPU == PP5002 - int line; - - lcd_clear_display(); - lcd_setfont(FONT_SYSFIXED); - - while(1) - { - line = 0; - lcd_putsf(0, line++, "GPIO_A: %02x GPIO_B: %02x", - (unsigned int)GPIOA_INPUT_VAL, (unsigned int)GPIOB_INPUT_VAL); - lcd_putsf(0, line++, "GPIO_C: %02x GPIO_D: %02x", - (unsigned int)GPIOC_INPUT_VAL, (unsigned int)GPIOD_INPUT_VAL); - - lcd_putsf(0, line++, "DEV_EN: %08lx", DEV_EN); - lcd_putsf(0, line++, "CLOCK_ENABLE: %08lx", CLOCK_ENABLE); - lcd_putsf(0, line++, "CLOCK_SOURCE: %08lx", CLOCK_SOURCE); - lcd_putsf(0, line++, "PLL_CONTROL: %08lx", PLL_CONTROL); - lcd_putsf(0, line++, "PLL_DIV: %08lx", PLL_DIV); - lcd_putsf(0, line++, "PLL_MULT: %08lx", PLL_MULT); - lcd_putsf(0, line++, "TIMING1_CTL: %08lx", TIMING1_CTL); - lcd_putsf(0, line++, "TIMING2_CTL: %08lx", TIMING2_CTL); - - lcd_update(); - if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL)) - { - lcd_setfont(FONT_UI); - return false; - } - } - lcd_setfont(FONT_UI); -#else - return __dbg_ports(); -#endif /* CPU */ - return false; -} -#else /* !HAVE_LCD_BITMAP */ -bool dbg_ports(void) -{ - int button; - int adc_battery_voltage; - int currval = 0; - - lcd_clear_display(); - - while(1) - { - if (currval == 0) { - lcd_putsf(0, 0, "PADR: %04x", (unsigned short)PADR); - } else if (currval == 1) { - lcd_putsf(0, 0, "PBDR: %04x", (unsigned short)PBDR); - } else { - int idx = currval - 2; /* idx < 7 */ - lcd_putsf(0, 0, "AN%d: %03x", idx, adc_read(idx)); - } - - battery_read_info(&adc_battery_voltage, NULL); - lcd_putsf(0, 1, "Batt: %d.%03dV", adc_battery_voltage / 1000, - adc_battery_voltage % 1000); - lcd_update(); - - button = get_action(CONTEXT_SETTINGS,HZ/5); - - switch(button) - { - case ACTION_STD_CANCEL: - return false; - - case ACTION_SETTINGS_DEC: - currval--; - if(currval < 0) - currval = 9; - break; - - case ACTION_SETTINGS_INC: - currval++; - if(currval > 9) - currval = 0; - break; - } - } - return false; -} -#endif /* !HAVE_LCD_BITMAP */ -#endif /* PLATFORM_NATIVE */ - #if (CONFIG_RTC == RTC_PCF50605) && (CONFIG_PLATFORM & PLATFORM_NATIVE) static bool dbg_pcf(void) { diff --git a/firmware/SOURCES b/firmware/SOURCES index 5b7a58260..c2df94639 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES @@ -398,6 +398,7 @@ target/sh/memset-sh.S target/sh/strlen-sh.S target/sh/system-sh.c target/sh/archos/descramble.S +target/sh/debug-sh.c #endif /* SIMULATOR */ #elif defined(CPU_COLDFIRE) @@ -421,6 +422,7 @@ target/coldfire/system-coldfire.c target/coldfire/timer-coldfire.c #ifndef BOOTLOADER target/coldfire/pcm-coldfire.c +target/coldfire/debug-coldfire.c #endif /* BOOTLOADER */ #if CONFIG_I2C == I2C_COLDFIRE target/coldfire/i2c-coldfire.c @@ -503,6 +505,7 @@ target/arm/system-pp502x.c target/arm/crt0-pp-bl.S #else target/arm/pcm-pp.c +target/arm/debug-pp.c #if !defined(SANSA_E200) && !defined(SANSA_C200) target/arm/audio-pp.c #endif /* SANSA_E200 */ diff --git a/firmware/target/arm/debug-pp.c b/firmware/target/arm/debug-pp.c new file mode 100644 index 000000000..3b9250c0f --- /dev/null +++ b/firmware/target/arm/debug-pp.c @@ -0,0 +1,154 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2006 Dave Chapman + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + +#include "config.h" +#include "system.h" +#include +#include "font.h" +#include "lcd.h" +#include "button.h" +#include "powermgmt.h" +#include "adc.h" +#include "iap.h" +#include "debug-target.h" + +bool dbg_ports(void) +{ + int line; + + lcd_clear_display(); + lcd_setfont(FONT_SYSFIXED); + + while(1) + { + line = 0; +#if defined(CPU_PP502x) +#if (LCD_HEIGHT >= 176) /* Only for displays with appropriate height. */ + lcd_puts(0, line++, "GPIO ENABLE:"); + lcd_putsf(0, line++, "A: %02x E: %02x I: %02x", + (unsigned int)GPIOA_ENABLE, + (unsigned int)GPIOE_ENABLE, + (unsigned int)GPIOI_ENABLE); + lcd_putsf(0, line++, "B: %02x F: %02x J: %02x", + (unsigned int)GPIOB_ENABLE, + (unsigned int)GPIOF_ENABLE, + (unsigned int)GPIOJ_ENABLE); + lcd_putsf(0, line++, "C: %02x G: %02x K: %02x", + (unsigned int)GPIOC_ENABLE, + (unsigned int)GPIOG_ENABLE, + (unsigned int)GPIOK_ENABLE); + lcd_putsf(0, line++, "D: %02x H: %02x L: %02x", + (unsigned int)GPIOD_ENABLE, + (unsigned int)GPIOH_ENABLE, + (unsigned int)GPIOL_ENABLE); + line++; +#endif + lcd_puts(0, line++, "GPIO INPUT VAL:"); + lcd_putsf(0, line++, "A: %02x E: %02x I: %02x", + (unsigned int)GPIOA_INPUT_VAL, + (unsigned int)GPIOE_INPUT_VAL, + (unsigned int)GPIOI_INPUT_VAL); + lcd_putsf(0, line++, "B: %02x F: %02x J: %02x", + (unsigned int)GPIOB_INPUT_VAL, + (unsigned int)GPIOF_INPUT_VAL, + (unsigned int)GPIOJ_INPUT_VAL); + lcd_putsf(0, line++, "C: %02x G: %02x K: %02x", + (unsigned int)GPIOC_INPUT_VAL, + (unsigned int)GPIOG_INPUT_VAL, + (unsigned int)GPIOK_INPUT_VAL); + lcd_putsf(0, line++, "D: %02x H: %02x L: %02x", + (unsigned int)GPIOD_INPUT_VAL, + (unsigned int)GPIOH_INPUT_VAL, + (unsigned int)GPIOL_INPUT_VAL); + line++; + lcd_putsf(0, line++, "GPO32_VAL: %08lx", GPO32_VAL); + lcd_putsf(0, line++, "GPO32_EN: %08lx", GPO32_ENABLE); + lcd_putsf(0, line++, "DEV_EN: %08lx", DEV_EN); + lcd_putsf(0, line++, "DEV_EN2: %08lx", DEV_EN2); + lcd_putsf(0, line++, "DEV_EN3: %08lx", inl(0x60006044)); /* to be verified */ + lcd_putsf(0, line++, "DEV_INIT1: %08lx", DEV_INIT1); + lcd_putsf(0, line++, "DEV_INIT2: %08lx", DEV_INIT2); +#ifdef ADC_ACCESSORY + lcd_putsf(0, line++, "ACCESSORY: %d", adc_read(ADC_ACCESSORY)); +#endif +#ifdef IPOD_VIDEO + lcd_putsf(0, line++, "4066_ISTAT: %d", adc_read(ADC_4066_ISTAT)); +#endif + +#if defined(IPOD_ACCESSORY_PROTOCOL) + const unsigned char *serbuf = iap_get_serbuf(); + lcd_putsf(0, line++, "IAP PACKET: %02x %02x %02x %02x %02x %02x %02x %02x", + serbuf[0], serbuf[1], serbuf[2], serbuf[3], serbuf[4], serbuf[5], + serbuf[6], serbuf[7]); +#endif + +#if defined(IRIVER_H10) || defined(IRIVER_H10_5GB) + line++; + lcd_putsf(0, line++, "BATT: %03x UNK1: %03x", + adc_read(ADC_BATTERY), adc_read(ADC_UNKNOWN_1)); + lcd_putsf(0, line++, "REM: %03x PAD: %03x", + adc_read(ADC_REMOTE), adc_read(ADC_SCROLLPAD)); +#elif defined(PHILIPS_HDD1630) || defined(PHILIPS_HDD6330) + line++; + lcd_putsf(0, line++, "BATT: %03x UNK1: %03x", + adc_read(ADC_BATTERY), adc_read(ADC_UNKNOWN_1)); +#elif defined(SANSA_E200) || defined(PHILIPS_SA9200) + lcd_putsf(0, line++, "ADC_BVDD: %4d", adc_read(ADC_BVDD)); + lcd_putsf(0, line++, "ADC_RTCSUP: %4d", adc_read(ADC_RTCSUP)); + lcd_putsf(0, line++, "ADC_UVDD: %4d", adc_read(ADC_UVDD)); + lcd_putsf(0, line++, "ADC_CHG_IN: %4d", adc_read(ADC_CHG_IN)); + lcd_putsf(0, line++, "ADC_CVDD: %4d", adc_read(ADC_CVDD)); + lcd_putsf(0, line++, "ADC_BATTEMP: %4d", adc_read(ADC_BATTEMP)); + lcd_putsf(0, line++, "ADC_MICSUP1: %4d", adc_read(ADC_MICSUP1)); + lcd_putsf(0, line++, "ADC_MICSUP2: %4d", adc_read(ADC_MICSUP2)); + lcd_putsf(0, line++, "ADC_VBE1: %4d", adc_read(ADC_VBE1)); + lcd_putsf(0, line++, "ADC_VBE2: %4d", adc_read(ADC_VBE2)); + lcd_putsf(0, line++, "ADC_I_MICSUP1:%4d", adc_read(ADC_I_MICSUP1)); +#if !defined(PHILIPS_SA9200) + lcd_putsf(0, line++, "ADC_I_MICSUP2:%4d", adc_read(ADC_I_MICSUP2)); + lcd_putsf(0, line++, "ADC_VBAT: %4d", adc_read(ADC_VBAT)); +#endif +#endif + +#elif CONFIG_CPU == PP5002 + lcd_putsf(0, line++, "GPIO_A: %02x GPIO_B: %02x", + (unsigned int)GPIOA_INPUT_VAL, (unsigned int)GPIOB_INPUT_VAL); + lcd_putsf(0, line++, "GPIO_C: %02x GPIO_D: %02x", + (unsigned int)GPIOC_INPUT_VAL, (unsigned int)GPIOD_INPUT_VAL); + + lcd_putsf(0, line++, "DEV_EN: %08lx", DEV_EN); + lcd_putsf(0, line++, "CLOCK_ENABLE: %08lx", CLOCK_ENABLE); + lcd_putsf(0, line++, "CLOCK_SOURCE: %08lx", CLOCK_SOURCE); + lcd_putsf(0, line++, "PLL_CONTROL: %08lx", PLL_CONTROL); + lcd_putsf(0, line++, "PLL_DIV: %08lx", PLL_DIV); + lcd_putsf(0, line++, "PLL_MULT: %08lx", PLL_MULT); + lcd_putsf(0, line++, "TIMING1_CTL: %08lx", TIMING1_CTL); + lcd_putsf(0, line++, "TIMING2_CTL: %08lx", TIMING2_CTL); +#endif + lcd_update(); + if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL)) + { + lcd_setfont(FONT_UI); + return false; + } + } + return false; +} diff --git a/firmware/target/arm/s3c2440/debug-target.h b/firmware/target/arm/debug-target.h similarity index 51% copy from firmware/target/arm/s3c2440/debug-target.h copy to firmware/target/arm/debug-target.h index bf1b6218e..4408acf5d 100644 --- a/firmware/target/arm/s3c2440/debug-target.h +++ b/firmware/target/arm/debug-target.h @@ -7,7 +7,7 @@ * \/ \/ \/ \/ \/ * $Id$ * - * Copyright (C) 2007 by Karl Kurbjun + * Copyright (C) 2010 by Marcin Bukat * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -18,13 +18,32 @@ * KIND, either express or implied. * ****************************************************************************/ +#if (CONFIG_KEYPAD == IPOD_1G2G_PAD) || \ + (CONFIG_KEYPAD == IPOD_3G_PAD) || \ + (CONFIG_KEYPAD == IPOD_4G_PAD) +# define DEBUG_CANCEL BUTTON_MENU -#ifdef GIGABEAT_F -#define DEBUG_CANCEL BUTTON_POWER -#elif defined(MINI2440) -#define DEBUG_CANCEL BUTTON_MENU -#endif +#elif (CONFIG_KEYPAD == IRIVER_H10_PAD) +# define DEBUG_CANCEL BUTTON_REW + +#elif (CONFIG_KEYPAD == MROBE100_PAD) +# define DEBUG_CANCEL BUTTON_MENU + +#elif (CONFIG_KEYPAD == SANSA_E200_PAD) || \ + (CONFIG_KEYPAD == SANSA_C200_PAD) +# define DEBUG_CANCEL BUTTON_LEFT -bool __dbg_hw_info(void); -bool __dbg_ports(void); +#elif (CONFIG_KEYPAD == PHILIPS_SA9200_PAD) || \ + (CONFIG_KEYPAD == PHILIPS_HDD1630_PAD) +# define DEBUG_CANCEL BUTTON_POWER +#elif (CONFIG_KEYPAD == PHILIPS_HDD6330_PAD) +# define DEBUG_CANCEL BUTTON_PREV + +#elif (CONFIG_KEYPAD == SAMSUNG_YH_PAD) +# define DEBUG_CANCEL BUTTON_PLAY + +#elif (CONFIG_KEYPAD == PBELL_VIBE500_PAD) +# define DEBUG_CANCEL BUTTON_CANCEL +#endif +bool dbg_ports(void); diff --git a/firmware/target/arm/imx31/debug-imx31.c b/firmware/target/arm/imx31/debug-imx31.c index 07f9453b2..1239c7cae 100644 --- a/firmware/target/arm/imx31/debug-imx31.c +++ b/firmware/target/arm/imx31/debug-imx31.c @@ -141,7 +141,7 @@ bool __dbg_hw_info(void) } } -bool __dbg_ports(void) +bool dbg_ports(void) { int line; int i; diff --git a/firmware/target/arm/imx31/debug-target.h b/firmware/target/arm/imx31/debug-target.h index ed8bba398..06baee5ea 100644 --- a/firmware/target/arm/imx31/debug-target.h +++ b/firmware/target/arm/imx31/debug-target.h @@ -23,6 +23,6 @@ #define DEBUG_CANCEL BUTTON_BACK bool __dbg_hw_info(void); -bool __dbg_ports(void); +bool dbg_ports(void); #endif /* DEBUG_TARGET_H */ diff --git a/firmware/target/arm/pnx0101/debug-pnx0101.c b/firmware/target/arm/pnx0101/debug-pnx0101.c new file mode 100644 index 000000000..3a556e66e --- /dev/null +++ b/firmware/target/arm/pnx0101/debug-pnx0101.c @@ -0,0 +1,5 @@ +/* just empty stub */ +bool dbg_ports() +{ + return false; +} diff --git a/firmware/target/arm/tms320dm320/debug-target.h b/firmware/target/arm/pnx0101/debug-target.h similarity index 84% copy from firmware/target/arm/tms320dm320/debug-target.h copy to firmware/target/arm/pnx0101/debug-target.h index 9e41fa4f9..4ed4cede9 100644 --- a/firmware/target/arm/tms320dm320/debug-target.h +++ b/firmware/target/arm/pnx0101/debug-target.h @@ -7,7 +7,7 @@ * \/ \/ \/ \/ \/ * $Id$ * - * Copyright (C) 2007 by Karl Kurbjun + * Copyright (C) 2010 by Marcin Bukat * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -18,6 +18,7 @@ * KIND, either express or implied. * ****************************************************************************/ - -bool __dbg_hw_info(void); -bool __dbg_ports(void); +#if CONFIG_KEYPAD == IRIVER_IFP7XX_PAD +# define DEBUG_CANCEL BUTTON_PLAY +#endif /* key definitions */ +bool dbg_ports(void); diff --git a/firmware/target/arm/s3c2440/debug-s3c2440.c b/firmware/target/arm/s3c2440/debug-s3c2440.c index 196a0b417..e552f12c2 100644 --- a/firmware/target/arm/s3c2440/debug-s3c2440.c +++ b/firmware/target/arm/s3c2440/debug-s3c2440.c @@ -34,7 +34,7 @@ bool __dbg_hw_info(void) return false; } -bool __dbg_ports(void) +bool dbg_ports(void) { int line; diff --git a/firmware/target/arm/s3c2440/debug-target.h b/firmware/target/arm/s3c2440/debug-target.h index bf1b6218e..dc274b9f0 100644 --- a/firmware/target/arm/s3c2440/debug-target.h +++ b/firmware/target/arm/s3c2440/debug-target.h @@ -26,5 +26,5 @@ #endif bool __dbg_hw_info(void); -bool __dbg_ports(void); +bool dbg_ports(void); diff --git a/firmware/target/arm/s5l8700/debug-s5l8700.c b/firmware/target/arm/s5l8700/debug-s5l8700.c index 29170d4ed..1f8dbebc6 100644 --- a/firmware/target/arm/s5l8700/debug-s5l8700.c +++ b/firmware/target/arm/s5l8700/debug-s5l8700.c @@ -155,7 +155,7 @@ bool __dbg_hw_info(void) return false; } -bool __dbg_ports(void) +bool dbg_ports(void) { int line; diff --git a/firmware/target/arm/s5l8700/debug-target.h b/firmware/target/arm/s5l8700/debug-target.h index f4a0247cc..351468fb5 100644 --- a/firmware/target/arm/s5l8700/debug-target.h +++ b/firmware/target/arm/s5l8700/debug-target.h @@ -27,7 +27,7 @@ #define DEBUG_CANCEL BUTTON_MENU bool __dbg_hw_info(void); -bool __dbg_ports(void); +bool dbg_ports(void); #endif /* _DEBUG_TARGET_H_ */ diff --git a/firmware/target/arm/tcc77x/debug-target.h b/firmware/target/arm/tcc77x/debug-target.h index a744c4f45..6cf93cc5a 100644 --- a/firmware/target/arm/tcc77x/debug-target.h +++ b/firmware/target/arm/tcc77x/debug-target.h @@ -20,5 +20,5 @@ ****************************************************************************/ bool __dbg_hw_info(void); -bool __dbg_ports(void); +bool dbg_ports(void); diff --git a/firmware/target/arm/tcc77x/debug-tcc77x.c b/firmware/target/arm/tcc77x/debug-tcc77x.c index 20d6954b0..88b0722a4 100644 --- a/firmware/target/arm/tcc77x/debug-tcc77x.c +++ b/firmware/target/arm/tcc77x/debug-tcc77x.c @@ -31,7 +31,7 @@ #include "debug-target.h" #include "adc.h" -bool __dbg_ports(void) +bool dbg_ports(void) { return false; } diff --git a/firmware/target/arm/tcc780x/debug-target.h b/firmware/target/arm/tcc780x/debug-target.h index a744c4f45..6cf93cc5a 100644 --- a/firmware/target/arm/tcc780x/debug-target.h +++ b/firmware/target/arm/tcc780x/debug-target.h @@ -20,5 +20,5 @@ ****************************************************************************/ bool __dbg_hw_info(void); -bool __dbg_ports(void); +bool dbg_ports(void); diff --git a/firmware/target/arm/tcc780x/debug-tcc780x.c b/firmware/target/arm/tcc780x/debug-tcc780x.c index 9267307e0..d527e2b04 100644 --- a/firmware/target/arm/tcc780x/debug-tcc780x.c +++ b/firmware/target/arm/tcc780x/debug-tcc780x.c @@ -35,7 +35,7 @@ #define STS (*(volatile unsigned long *)0xF3001008) #define SRC (*(volatile unsigned long *)0xF3001010) -bool __dbg_ports(void) +bool dbg_ports(void) { return false; } diff --git a/firmware/target/arm/tms320dm320/debug-dm320.c b/firmware/target/arm/tms320dm320/debug-dm320.c index cc529f5d1..26f34a4f5 100644 --- a/firmware/target/arm/tms320dm320/debug-dm320.c +++ b/firmware/target/arm/tms320dm320/debug-dm320.c @@ -36,7 +36,7 @@ #include "m66591.h" #endif -bool __dbg_ports(void) +bool dbg_ports(void) { #if defined(MROBE_500) int line = 0; diff --git a/firmware/target/arm/tms320dm320/debug-target.h b/firmware/target/arm/tms320dm320/debug-target.h index 9e41fa4f9..bcf9d688c 100644 --- a/firmware/target/arm/tms320dm320/debug-target.h +++ b/firmware/target/arm/tms320dm320/debug-target.h @@ -20,4 +20,4 @@ ****************************************************************************/ bool __dbg_hw_info(void); -bool __dbg_ports(void); +bool dbg_ports(void); diff --git a/firmware/target/coldfire/debug-coldfire.c b/firmware/target/coldfire/debug-coldfire.c new file mode 100644 index 000000000..0676ed0b0 --- /dev/null +++ b/firmware/target/coldfire/debug-coldfire.c @@ -0,0 +1,106 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2005 by Linus Nielsen Feltzing + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + +#include "config.h" +#include "system.h" +#include +#include "font.h" +#include "lcd.h" +#include "button.h" +#include "powermgmt.h" +#include "adc.h" +#include "debug-target.h" + +bool dbg_ports(void) +{ + unsigned int gpio_out; + unsigned int gpio1_out; + unsigned int gpio_read; + unsigned int gpio1_read; + unsigned int gpio_function; + unsigned int gpio1_function; + unsigned int gpio_enable; + unsigned int gpio1_enable; + int adc_battery_voltage, adc_battery_level; + int adc_buttons, adc_remote; + int line; + + lcd_clear_display(); + lcd_setfont(FONT_SYSFIXED); + + while(1) + { + line = 0; + gpio_read = GPIO_READ; + gpio1_read = GPIO1_READ; + gpio_out = GPIO_OUT; + gpio1_out = GPIO1_OUT; + gpio_function = GPIO_FUNCTION; + gpio1_function = GPIO1_FUNCTION; + gpio_enable = GPIO_ENABLE; + gpio1_enable = GPIO1_ENABLE; + + lcd_putsf(0, line++, "GPIO_READ: %08x", gpio_read); + lcd_putsf(0, line++, "GPIO_OUT: %08x", gpio_out); + lcd_putsf(0, line++, "GPIO_FUNC: %08x", gpio_function); + lcd_putsf(0, line++, "GPIO_ENA: %08x", gpio_enable); + lcd_putsf(0, line++, "GPIO1_READ: %08x", gpio1_read); + lcd_putsf(0, line++, "GPIO1_OUT: %08x", gpio1_out); + lcd_putsf(0, line++, "GPIO1_FUNC: %08x", gpio1_function); + lcd_putsf(0, line++, "GPIO1_ENA: %08x", gpio1_enable); + + adc_buttons = adc_read(ADC_BUTTONS); + adc_remote = adc_read(ADC_REMOTE); + battery_read_info(&adc_battery_voltage, &adc_battery_level); +#if defined(IAUDIO_X5) || defined(IAUDIO_M5) || defined(IRIVER_H300_SERIES) + lcd_putsf(0, line++, "ADC_BUTTONS (%c): %02x", + button_scan_enabled() ? '+' : '-', adc_buttons); +#else + lcd_putsf(0, line++, "ADC_BUTTONS: %02x", adc_buttons); +#endif +#if defined(IAUDIO_X5) || defined(IAUDIO_M5) + lcd_putsf(0, line++, "ADC_REMOTE (%c): %02x", + remote_detect() ? '+' : '-', adc_remote); +#else + lcd_putsf(0, line++, "ADC_REMOTE: %02x", adc_remote); +#endif +#if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300_SERIES) + lcd_putsf(0, line++, "ADC_REMOTEDETECT: %02x", + adc_read(ADC_REMOTEDETECT)); +#endif + + battery_read_info(&adc_battery_voltage, &adc_battery_level); + lcd_putsf(0, line++, "Batt: %d.%03dV %d%% ", adc_battery_voltage / 1000, + adc_battery_voltage % 1000, adc_battery_level); + +#if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300_SERIES) + lcd_putsf(0, line++, "remotetype: %d", remote_type()); +#endif + + lcd_update(); + if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL)) + { + lcd_setfont(FONT_UI); + return false; + } + } + return false; +} diff --git a/firmware/target/arm/s3c2440/debug-target.h b/firmware/target/coldfire/debug-target.h similarity index 69% copy from firmware/target/arm/s3c2440/debug-target.h copy to firmware/target/coldfire/debug-target.h index bf1b6218e..76b502e4f 100644 --- a/firmware/target/arm/s3c2440/debug-target.h +++ b/firmware/target/coldfire/debug-target.h @@ -7,7 +7,7 @@ * \/ \/ \/ \/ \/ * $Id$ * - * Copyright (C) 2007 by Karl Kurbjun + * Copyright (C) 2010 by Marcin Bukat * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -18,13 +18,17 @@ * KIND, either express or implied. * ****************************************************************************/ +#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \ + (CONFIG_KEYPAD == IRIVER_H300_PAD) +# define DEBUG_CANCEL BUTTON_OFF -#ifdef GIGABEAT_F -#define DEBUG_CANCEL BUTTON_POWER -#elif defined(MINI2440) -#define DEBUG_CANCEL BUTTON_MENU -#endif +#elif CONFIG_KEYPAD == IAUDIO_X5M5_PAD +# define DEBUG_CANCEL BUTTON_REC -bool __dbg_hw_info(void); -bool __dbg_ports(void); +#elif (CONFIG_KEYPAD == IAUDIO_M3_PAD) +# define DEBUG_CANCEL BUTTON_RC_REC +#elif (CONFIG_KEYPAD == MPIO_HD200_PAD) +# define DEBUG_CANCEL BUTTON_REC +#endif +bool dbg_ports(void); diff --git a/firmware/target/mips/ingenic_jz47xx/debug-jz4740.c b/firmware/target/mips/ingenic_jz47xx/debug-jz4740.c index f2b302e4c..5bdd4c4de 100644 --- a/firmware/target/mips/ingenic_jz47xx/debug-jz4740.c +++ b/firmware/target/mips/ingenic_jz47xx/debug-jz4740.c @@ -129,7 +129,7 @@ static void display_enabled_clocks(void) (clkgr & CPM_CLKGR_UART0) ? "stopped" : "running"); } -bool __dbg_ports(void) +bool dbg_ports(void) { return false; } diff --git a/firmware/target/mips/ingenic_jz47xx/debug-target.h b/firmware/target/mips/ingenic_jz47xx/debug-target.h index f753e6ee6..f82b43da5 100644 --- a/firmware/target/mips/ingenic_jz47xx/debug-target.h +++ b/firmware/target/mips/ingenic_jz47xx/debug-target.h @@ -23,6 +23,6 @@ #define __DEBUG_TARGET_H_ bool __dbg_hw_info(void); -bool __dbg_ports(void); +bool dbg_ports(void); #endif /* __DEBUG_TARGET_H_ */ diff --git a/firmware/target/sh/debug-sh.c b/firmware/target/sh/debug-sh.c new file mode 100644 index 000000000..3502cfade --- /dev/null +++ b/firmware/target/sh/debug-sh.c @@ -0,0 +1,103 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2002 Heikki Hannikainen + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + +#include "config.h" +#include "system.h" +#include +#include "font.h" +#include "lcd.h" +#include "button.h" +#include "powermgmt.h" +#include "adc.h" +#include "debug-target.h" + +bool dbg_ports(void) +{ + int adc_battery_voltage; +#ifndef HAVE_LCD_BITMAP + int currval = 0; + int button; +#else + int adc_battery_level; + + lcd_setfont(FONT_SYSFIXED); +#endif + lcd_clear_display(); + + while(1) + { +#ifdef HAVE_LCD_BITMAP + lcd_putsf(0, 0, "PADR: %04x", (unsigned short)PADR); + lcd_putsf(0, 1, "PBDR: %04x", (unsigned short)PBDR); + + lcd_putsf(0, 2, "AN0: %03x AN4: %03x", adc_read(0), adc_read(4)); + lcd_putsf(0, 3, "AN1: %03x AN5: %03x", adc_read(1), adc_read(5)); + lcd_putsf(0, 4, "AN2: %03x AN6: %03x", adc_read(2), adc_read(6)); + lcd_putsf(0, 5, "AN3: %03x AN7: %03x", adc_read(3), adc_read(7)); + + battery_read_info(&adc_battery_voltage, &adc_battery_level); + lcd_putsf(0, 6, "Batt: %d.%03dV %d%% ", adc_battery_voltage / 1000, + adc_battery_voltage % 1000, adc_battery_level); + + lcd_update(); + if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL)) + { + lcd_setfont(FONT_UI); + return false; + } +#else /* !HAVE_LCD_BITMAP */ + + if (currval == 0) { + lcd_putsf(0, 0, "PADR: %04x", (unsigned short)PADR); + } else if (currval == 1) { + lcd_putsf(0, 0, "PBDR: %04x", (unsigned short)PBDR); + } else { + int idx = currval - 2; /* idx < 7 */ + lcd_putsf(0, 0, "AN%d: %03x", idx, adc_read(idx)); + } + + battery_read_info(&adc_battery_voltage, NULL); + lcd_putsf(0, 1, "Batt: %d.%03dV", adc_battery_voltage / 1000, + adc_battery_voltage % 1000); + lcd_update(); + + button = button_get_w_tmo(HZ/5); + switch(button) + { + case BUTTON_STOP: + return false; + + case BUTTON_LEFT: + currval--; + if(currval < 0) + currval = 9; + break; + + case BUTTON_RIGHT: + currval++; + if(currval > 9) + currval = 0; + break; + } +#endif + } + return false; +} diff --git a/firmware/target/arm/s3c2440/debug-target.h b/firmware/target/sh/debug-target.h similarity index 82% copy from firmware/target/arm/s3c2440/debug-target.h copy to firmware/target/sh/debug-target.h index bf1b6218e..4e25b8194 100644 --- a/firmware/target/arm/s3c2440/debug-target.h +++ b/firmware/target/sh/debug-target.h @@ -7,7 +7,7 @@ * \/ \/ \/ \/ \/ * $Id$ * - * Copyright (C) 2007 by Karl Kurbjun + * Copyright (C) 2010 by Marcin Bukat * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -18,13 +18,10 @@ * KIND, either express or implied. * ****************************************************************************/ +#if CONFIG_KEYPAD == RECORDER_PAD +# define DEBUG_CANCEL BUTTON_OFF -#ifdef GIGABEAT_F -#define DEBUG_CANCEL BUTTON_POWER -#elif defined(MINI2440) -#define DEBUG_CANCEL BUTTON_MENU +#elif CONFIG_KEYPAD == ONDIO_PAD +# define DEBUG_CANCEL BUTTON_MENU #endif - -bool __dbg_hw_info(void); -bool __dbg_ports(void); - +bool dbg_ports(void); -- 2.11.4.GIT