summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcin Bukat <marcin.bukat@gmail.com>2010-11-06 14:24:25 +0000
committerMarcin Bukat <marcin.bukat@gmail.com>2010-11-06 14:24:25 +0000
commitb8a7f5137b38cbfd301715bb69034467a033eccb (patch)
tree5bef733ca715d7706801587137c1db40f173b6c1
parent97a783a79ab53cc772545980ff4bad6a6d3b8bad (diff)
downloadrockbox-b8a7f5137b38cbfd301715bb69034467a033eccb.tar.gz
rockbox-b8a7f5137b38cbfd301715bb69034467a033eccb.zip
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
-rw-r--r--apps/debug_menu.c366
-rw-r--r--firmware/SOURCES3
-rw-r--r--firmware/target/arm/debug-pp.c154
-rw-r--r--firmware/target/arm/debug-target.h49
-rw-r--r--firmware/target/arm/imx31/debug-imx31.c2
-rw-r--r--firmware/target/arm/imx31/debug-target.h2
-rw-r--r--firmware/target/arm/pnx0101/debug-pnx0101.c5
-rw-r--r--firmware/target/arm/pnx0101/debug-target.h24
-rw-r--r--firmware/target/arm/s3c2440/debug-s3c2440.c2
-rw-r--r--firmware/target/arm/s3c2440/debug-target.h2
-rw-r--r--firmware/target/arm/s5l8700/debug-s5l8700.c2
-rw-r--r--firmware/target/arm/s5l8700/debug-target.h2
-rw-r--r--firmware/target/arm/tcc77x/debug-target.h2
-rw-r--r--firmware/target/arm/tcc77x/debug-tcc77x.c2
-rw-r--r--firmware/target/arm/tcc780x/debug-target.h2
-rw-r--r--firmware/target/arm/tcc780x/debug-tcc780x.c2
-rw-r--r--firmware/target/arm/tms320dm320/debug-dm320.c2
-rw-r--r--firmware/target/arm/tms320dm320/debug-target.h2
-rw-r--r--firmware/target/coldfire/debug-coldfire.c106
-rw-r--r--firmware/target/coldfire/debug-target.h34
-rw-r--r--firmware/target/mips/ingenic_jz47xx/debug-jz4740.c2
-rw-r--r--firmware/target/mips/ingenic_jz47xx/debug-target.h2
-rw-r--r--firmware/target/sh/debug-sh.c103
-rw-r--r--firmware/target/sh/debug-target.h27
24 files changed, 519 insertions, 380 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index bedc98ae10..631f027017 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 5b7a582604..c2df946394 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 0000000000..3b9250c0fb
--- /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 <stdbool.h>
+#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/debug-target.h b/firmware/target/arm/debug-target.h
new file mode 100644
index 0000000000..4408acf5da
--- /dev/null
+++ b/firmware/target/arm/debug-target.h
@@ -0,0 +1,49 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ * 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
+ * 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.
+ *
+ ****************************************************************************/
+#if (CONFIG_KEYPAD == IPOD_1G2G_PAD) || \
+ (CONFIG_KEYPAD == IPOD_3G_PAD) || \
+ (CONFIG_KEYPAD == IPOD_4G_PAD)
+# define DEBUG_CANCEL BUTTON_MENU
+
+#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
+
+#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 07f9453b29..1239c7cae7 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 ed8bba3984..06baee5ea0 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 0000000000..3a556e66e3
--- /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/pnx0101/debug-target.h b/firmware/target/arm/pnx0101/debug-target.h
new file mode 100644
index 0000000000..4ed4cede92
--- /dev/null
+++ b/firmware/target/arm/pnx0101/debug-target.h
@@ -0,0 +1,24 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ * 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
+ * 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.
+ *
+ ****************************************************************************/
+#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 196a0b4177..e552f12c2b 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 bf1b6218e4..dc274b9f06 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 29170d4ed2..1f8dbebc68 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 f4a0247cc4..351468fb50 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 a744c4f456..6cf93cc5a4 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 20d6954b03..88b0722a4e 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 a744c4f456..6cf93cc5a4 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 9267307e05..d527e2b045 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 cc529f5d15..26f34a4f5f 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 9e41fa4f9b..bcf9d688cd 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 0000000000..0676ed0b07
--- /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 <stdbool.h>
+#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/coldfire/debug-target.h b/firmware/target/coldfire/debug-target.h
new file mode 100644
index 0000000000..76b502e4ff
--- /dev/null
+++ b/firmware/target/coldfire/debug-target.h
@@ -0,0 +1,34 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ * 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
+ * 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.
+ *
+ ****************************************************************************/
+#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
+ (CONFIG_KEYPAD == IRIVER_H300_PAD)
+# define DEBUG_CANCEL BUTTON_OFF
+
+#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 == 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 f2b302e4c1..5bdd4c4de9 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 f753e6ee6c..f82b43da5b 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 0000000000..3502cfade0
--- /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 <stdbool.h>
+#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/sh/debug-target.h b/firmware/target/sh/debug-target.h
new file mode 100644
index 0000000000..4e25b81948
--- /dev/null
+++ b/firmware/target/sh/debug-target.h
@@ -0,0 +1,27 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ * 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
+ * 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.
+ *
+ ****************************************************************************/
+#if CONFIG_KEYPAD == RECORDER_PAD
+# define DEBUG_CANCEL BUTTON_OFF
+
+#elif CONFIG_KEYPAD == ONDIO_PAD
+# define DEBUG_CANCEL BUTTON_MENU
+#endif
+bool dbg_ports(void);