mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 05:05:20 -05:00
Revise r23225 a bit, removing the debug_printf function and implementing more generic lcd_(remote)_putsf function(s) instead and use those in more places
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23233 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
5ca76ab9c4
commit
f34a841b0c
18 changed files with 366 additions and 413 deletions
|
|
@ -27,6 +27,9 @@
|
|||
* KIND, either express or implied.
|
||||
*
|
||||
****************************************************************************/
|
||||
#include "stdarg.h"
|
||||
#include "sprintf.h"
|
||||
|
||||
#ifndef LCDFN /* Not compiling for remote - define macros for main LCD. */
|
||||
#define LCDFN(fn) lcd_ ## fn
|
||||
#define FBFN(fn) fb_ ## fn
|
||||
|
|
@ -206,6 +209,17 @@ void LCDFN(puts)(int x, int y, const unsigned char *str)
|
|||
LCDFN(puts_style_offset)(x, y, str, STYLE_DEFAULT, 0);
|
||||
}
|
||||
|
||||
/* Formatting version of LCDFN(puts) */
|
||||
void LCDFN(putsf)(int x, int y, const unsigned char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
char buf[256];
|
||||
va_start(ap, fmt);
|
||||
vsnprintf(buf, sizeof (buf), fmt, ap);
|
||||
va_end(ap);
|
||||
LCDFN(puts)(x, y, buf);
|
||||
}
|
||||
|
||||
void LCDFN(puts_style)(int x, int y, const unsigned char *str, int style)
|
||||
{
|
||||
LCDFN(puts_style_offset)(x, y, str, style, 0);
|
||||
|
|
|
|||
|
|
@ -21,7 +21,8 @@
|
|||
****************************************************************************/
|
||||
#include "config.h"
|
||||
#include "hwcompat.h"
|
||||
|
||||
#include "stdarg.h"
|
||||
#include "sprintf.h"
|
||||
#include "lcd.h"
|
||||
#include "kernel.h"
|
||||
#include "thread.h"
|
||||
|
|
@ -427,6 +428,17 @@ void lcd_puts(int x, int y, const unsigned char *str)
|
|||
lcd_puts_offset(x, y, str, 0);
|
||||
}
|
||||
|
||||
/* Formatting version of lcd_puts */
|
||||
void lcd_putsf(int x, int y, const unsigned char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
char buf[256];
|
||||
va_start(ap, fmt);
|
||||
vsnprintf(buf, sizeof (buf), fmt, ap);
|
||||
va_end(ap);
|
||||
lcd_puts(x, y, buf);
|
||||
}
|
||||
|
||||
/* Put a string at a given char position, skipping first offset chars */
|
||||
void lcd_puts_offset(int x, int y, const unsigned char *str, int offset)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -121,6 +121,7 @@ extern void lcd_remote_set_viewport(struct viewport* vp);
|
|||
extern void lcd_remote_clear_display(void);
|
||||
extern void lcd_remote_clear_viewport(void);
|
||||
extern void lcd_remote_puts(int x, int y, const unsigned char *str);
|
||||
extern void lcd_remote_putsf(int x, int y, const unsigned char *fmt, ...);
|
||||
extern void lcd_remote_puts_style(int x, int y, const unsigned char *str,
|
||||
int style);
|
||||
extern void lcd_remote_puts_offset(int x, int y, const unsigned char *str,
|
||||
|
|
|
|||
|
|
@ -191,6 +191,7 @@ extern void lcd_clear_viewport(void);
|
|||
extern void lcd_clear_display(void);
|
||||
extern void lcd_putsxy(int x, int y, const unsigned char *string);
|
||||
extern void lcd_puts(int x, int y, const unsigned char *string);
|
||||
extern void lcd_putsf(int x, int y, const unsigned char *fmt, ...);
|
||||
extern void lcd_puts_style(int x, int y, const unsigned char *string, int style);
|
||||
extern void lcd_puts_offset(int x, int y, const unsigned char *str, int offset);
|
||||
extern void lcd_puts_scroll_offset(int x, int y, const unsigned char *string,
|
||||
|
|
|
|||
|
|
@ -31,10 +31,6 @@
|
|||
#include "ascodec-target.h"
|
||||
#include "adc.h"
|
||||
|
||||
#define _DEBUG_PRINTF(a,varargs...) do { \
|
||||
snprintf(buf, sizeof(buf), (a), ##varargs); lcd_puts(0,line++,buf); \
|
||||
} while(0)
|
||||
|
||||
#define ON "Enabled"
|
||||
#define OFF "Disabled"
|
||||
|
||||
|
|
@ -224,7 +220,6 @@ int calc_freq(int clk)
|
|||
|
||||
bool __dbg_hw_info(void)
|
||||
{
|
||||
char buf[50];
|
||||
int line;
|
||||
int last_nand = 0;
|
||||
#if defined(SANSA_E200V2) || defined(SANSA_FUZE) || defined(SANSA_C200V2)
|
||||
|
|
@ -240,16 +235,16 @@ bool __dbg_hw_info(void)
|
|||
{
|
||||
lcd_clear_display();
|
||||
line = 0;
|
||||
_DEBUG_PRINTF("[Clock Frequencies:]");
|
||||
_DEBUG_PRINTF(" SET ACTUAL");
|
||||
_DEBUG_PRINTF("922T:%s %3dMHz",
|
||||
lcd_puts(0, line++, "[Clock Frequencies:]");
|
||||
lcd_puts(0, line++, " SET ACTUAL");
|
||||
lcd_putsf(0, line++, "922T:%s %3dMHz",
|
||||
(!(read_cp15()>>30)) ? "FAST " :
|
||||
(read_cp15()>>31) ? "ASYNC" : "SYNC ",
|
||||
calc_freq(CLK_922T)/1000000);
|
||||
_DEBUG_PRINTF("PLLA:%3dMHz %3dMHz", AS3525_PLLA_FREQ/1000000,
|
||||
lcd_putsf(0, line++, "PLLA:%3dMHz %3dMHz", AS3525_PLLA_FREQ/1000000,
|
||||
calc_freq(CLK_PLLA)/1000000);
|
||||
_DEBUG_PRINTF("PLLB: %3dMHz", calc_freq(CLK_PLLB)/1000000);
|
||||
_DEBUG_PRINTF("FCLK: %3dMHz", calc_freq(CLK_FCLK)/1000000);
|
||||
lcd_putsf(0, line++, "PLLB: %3dMHz", calc_freq(CLK_PLLB)/1000000);
|
||||
lcd_putsf(0, line++, "FCLK: %3dMHz", calc_freq(CLK_FCLK)/1000000);
|
||||
|
||||
#if LCD_HEIGHT < 176 /* clip */
|
||||
lcd_update();
|
||||
|
|
@ -265,17 +260,17 @@ bool __dbg_hw_info(void)
|
|||
line = 0;
|
||||
#endif /* LCD_HEIGHT < 176 */
|
||||
|
||||
_DEBUG_PRINTF("DRAM:%3dMHz %3dMHz", AS3525_PCLK_FREQ/1000000,
|
||||
lcd_putsf(0, line++, "DRAM:%3dMHz %3dMHz", AS3525_PCLK_FREQ/1000000,
|
||||
calc_freq(CLK_EXTMEM)/1000000);
|
||||
_DEBUG_PRINTF("PCLK:%3dMHz %3dMHz", AS3525_PCLK_FREQ/1000000,
|
||||
lcd_putsf(0, line++, "PCLK:%3dMHz %3dMHz", AS3525_PCLK_FREQ/1000000,
|
||||
calc_freq(CLK_PCLK)/1000000);
|
||||
_DEBUG_PRINTF("IDE :%3dMHz %3dMHz", AS3525_IDE_FREQ/1000000,
|
||||
lcd_putsf(0, line++, "IDE :%3dMHz %3dMHz", AS3525_IDE_FREQ/1000000,
|
||||
calc_freq(CLK_IDE)/1000000);
|
||||
_DEBUG_PRINTF("DBOP:%3dMHz %3dMHz", AS3525_DBOP_FREQ/1000000,
|
||||
lcd_putsf(0, line++, "DBOP:%3dMHz %3dMHz", AS3525_DBOP_FREQ/1000000,
|
||||
calc_freq(CLK_DBOP)/1000000);
|
||||
_DEBUG_PRINTF("I2C :%3dkHz %3dkHz", AS3525_I2C_FREQ/1000,
|
||||
lcd_putsf(0, line++, "I2C :%3dkHz %3dkHz", AS3525_I2C_FREQ/1000,
|
||||
calc_freq(CLK_I2C)/1000);
|
||||
_DEBUG_PRINTF("I2SI: %s %3dMHz", (CGU_AUDIO & (1<<23)) ?
|
||||
lcd_putsf(0, line++, "I2SI: %s %3dMHz", (CGU_AUDIO & (1<<23)) ?
|
||||
"on " : "off" , calc_freq(CLK_I2SI)/1000000);
|
||||
|
||||
#if LCD_HEIGHT < 176 /* clip */
|
||||
|
|
@ -292,27 +287,27 @@ bool __dbg_hw_info(void)
|
|||
line = 0;
|
||||
#endif /* LCD_HEIGHT < 176 */
|
||||
|
||||
_DEBUG_PRINTF("I2SO: %s %3dMHz", (CGU_AUDIO & (1<<11)) ?
|
||||
lcd_putsf(0, line++, "I2SO: %s %3dMHz", (CGU_AUDIO & (1<<11)) ?
|
||||
"on " : "off", calc_freq(CLK_I2SO)/1000000);
|
||||
if(MCI_NAND)
|
||||
last_nand = MCI_NAND;
|
||||
/* MCLK == PCLK */
|
||||
_DEBUG_PRINTF("SD :%3dMHz %3dMHz",
|
||||
lcd_putsf(0, line++, "SD :%3dMHz %3dMHz",
|
||||
((last_nand ? (AS3525_PCLK_FREQ/ 1000000): 0) /
|
||||
((last_nand & MCI_CLOCK_BYPASS)? 1:(((last_nand & 0xff)+1) * 2))),
|
||||
calc_freq(CLK_SD_MCLK_NAND)/1000000);
|
||||
#if defined(SANSA_E200V2) || defined(SANSA_FUZE) || defined(SANSA_C200V2)
|
||||
if(MCI_SD)
|
||||
last_sd = MCI_SD;
|
||||
_DEBUG_PRINTF("uSD :%3dMHz %3dMHz",
|
||||
lcd_putsf(0, line++, "uSD :%3dMHz %3dMHz",
|
||||
((last_sd ? (AS3525_PCLK_FREQ/ 1000000): 0) /
|
||||
((last_sd & MCI_CLOCK_BYPASS) ? 1: (((last_sd & 0xff) + 1) * 2))),
|
||||
calc_freq(CLK_SD_MCLK_MSD)/1000000);
|
||||
#endif
|
||||
_DEBUG_PRINTF("USB : %3dMHz", calc_freq(CLK_USB)/1000000);
|
||||
_DEBUG_PRINTF("MMU : %s CVDDP:%4d", (read_cp15() & CP15_MMU) ?
|
||||
lcd_putsf(0, line++, "USB : %3dMHz", calc_freq(CLK_USB)/1000000);
|
||||
lcd_putsf(0, line++, "MMU : %s CVDDP:%4d", (read_cp15() & CP15_MMU) ?
|
||||
" on" : "off", adc_read(ADC_CVDD) * 25);
|
||||
_DEBUG_PRINTF("Icache:%s Dcache:%s",
|
||||
lcd_putsf(0, line++, "Icache:%s Dcache:%s",
|
||||
(read_cp15() & CP15_IC) ? " on" : "off",
|
||||
(read_cp15() & CP15_DC) ? " on" : "off");
|
||||
|
||||
|
|
@ -328,12 +323,12 @@ bool __dbg_hw_info(void)
|
|||
lcd_clear_display();
|
||||
line = 0;
|
||||
|
||||
_DEBUG_PRINTF("CGU_PLLA :%8x", (unsigned int)(CGU_PLLA));
|
||||
_DEBUG_PRINTF("CGU_PLLB :%8x", (unsigned int)(CGU_PLLB));
|
||||
_DEBUG_PRINTF("CGU_PROC :%8x", (unsigned int)(CGU_PROC));
|
||||
_DEBUG_PRINTF("CGU_PERI :%8x", (unsigned int)(CGU_PERI));
|
||||
_DEBUG_PRINTF("CGU_IDE :%8x", (unsigned int)(CGU_IDE));
|
||||
_DEBUG_PRINTF("CGU_DBOP :%8x", (unsigned int)(CGU_DBOP));
|
||||
lcd_putsf(0, line++, "CGU_PLLA :%8x", (unsigned int)(CGU_PLLA));
|
||||
lcd_putsf(0, line++, "CGU_PLLB :%8x", (unsigned int)(CGU_PLLB));
|
||||
lcd_putsf(0, line++, "CGU_PROC :%8x", (unsigned int)(CGU_PROC));
|
||||
lcd_putsf(0, line++, "CGU_PERI :%8x", (unsigned int)(CGU_PERI));
|
||||
lcd_putsf(0, line++, "CGU_IDE :%8x", (unsigned int)(CGU_IDE));
|
||||
lcd_putsf(0, line++, "CGU_DBOP :%8x", (unsigned int)(CGU_DBOP));
|
||||
|
||||
#if LCD_HEIGHT < 176 /* clip */
|
||||
lcd_update();
|
||||
|
|
@ -349,12 +344,12 @@ bool __dbg_hw_info(void)
|
|||
line = 0;
|
||||
#endif /* LCD_HEIGHT < 176 */
|
||||
|
||||
_DEBUG_PRINTF("CGU_AUDIO :%8x", (unsigned int)(CGU_AUDIO));
|
||||
_DEBUG_PRINTF("CGU_USB :%8x", (unsigned int)(CGU_USB));
|
||||
_DEBUG_PRINTF("I2C2_CPSR :%8x", (unsigned int)(I2C2_CPSR1<<8 |
|
||||
lcd_putsf(0, line++, "CGU_AUDIO :%8x", (unsigned int)(CGU_AUDIO));
|
||||
lcd_putsf(0, line++, "CGU_USB :%8x", (unsigned int)(CGU_USB));
|
||||
lcd_putsf(0, line++, "I2C2_CPSR :%8x", (unsigned int)(I2C2_CPSR1<<8 |
|
||||
I2C2_CPSR0));
|
||||
_DEBUG_PRINTF("MCI_NAND :%8x", (unsigned int)(MCI_NAND));
|
||||
_DEBUG_PRINTF("MCI_SD :%8x", (unsigned int)(MCI_SD));
|
||||
lcd_putsf(0, line++, "MCI_NAND :%8x", (unsigned int)(MCI_NAND));
|
||||
lcd_putsf(0, line++, "MCI_SD :%8x", (unsigned int)(MCI_SD));
|
||||
|
||||
lcd_update();
|
||||
int btn = button_get_w_tmo(HZ/10);
|
||||
|
|
@ -372,7 +367,6 @@ end:
|
|||
|
||||
bool __dbg_ports(void)
|
||||
{
|
||||
char buf[50];
|
||||
int line;
|
||||
|
||||
lcd_clear_display();
|
||||
|
|
@ -381,19 +375,19 @@ bool __dbg_ports(void)
|
|||
while(1)
|
||||
{
|
||||
line = 0;
|
||||
_DEBUG_PRINTF("[GPIO Values and Directions]");
|
||||
_DEBUG_PRINTF("GPIOA: %2x DIR: %2x", GPIOA_DATA, GPIOA_DIR);
|
||||
_DEBUG_PRINTF("GPIOB: %2x DIR: %2x", GPIOB_DATA, GPIOB_DIR);
|
||||
_DEBUG_PRINTF("GPIOC: %2x DIR: %2x", GPIOC_DATA, GPIOC_DIR);
|
||||
_DEBUG_PRINTF("GPIOD: %2x DIR: %2x", GPIOD_DATA, GPIOD_DIR);
|
||||
lcd_puts(0, line++, "[GPIO Values and Directions]");
|
||||
lcd_putsf(0, line++, "GPIOA: %2x DIR: %2x", GPIOA_DATA, GPIOA_DIR);
|
||||
lcd_putsf(0, line++, "GPIOB: %2x DIR: %2x", GPIOB_DATA, GPIOB_DIR);
|
||||
lcd_putsf(0, line++, "GPIOC: %2x DIR: %2x", GPIOC_DATA, GPIOC_DIR);
|
||||
lcd_putsf(0, line++, "GPIOD: %2x DIR: %2x", GPIOD_DATA, GPIOD_DIR);
|
||||
#ifdef DEBUG_DBOP
|
||||
line++;
|
||||
_DEBUG_PRINTF("[DBOP_DIN]");
|
||||
_DEBUG_PRINTF("DBOP_DIN: %4x", button_dbop_data());
|
||||
lcd_puts(0, line++, "[DBOP_DIN]");
|
||||
lcd_putsf(0, line++, "DBOP_DIN: %4x", button_dbop_data());
|
||||
#endif
|
||||
line++;
|
||||
_DEBUG_PRINTF("[CP15]");
|
||||
_DEBUG_PRINTF("CP15: 0x%8x", read_cp15());
|
||||
lcd_puts(0, line++, "[CP15]");
|
||||
lcd_putsf(0, line++, "CP15: 0x%8x", read_cp15());
|
||||
lcd_update();
|
||||
if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL))
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@
|
|||
|
||||
bool __dbg_hw_info(void)
|
||||
{
|
||||
char buf[50];
|
||||
int line;
|
||||
unsigned int pllref;
|
||||
unsigned int mcu_pllfreq, ser_pllfreq, usb_pllfreq;
|
||||
|
|
@ -46,9 +45,8 @@ bool __dbg_hw_info(void)
|
|||
while (1)
|
||||
{
|
||||
line = 0;
|
||||
snprintf(buf, sizeof (buf), "Sys Rev Code: 0x%02X",
|
||||
iim_system_rev());
|
||||
lcd_puts(0, line++, buf); line++;
|
||||
lcd_putsf(0, line++, "Sys Rev Code: 0x%02X", iim_system_rev());
|
||||
line++;
|
||||
|
||||
mpctl = CCM_MPCTL;
|
||||
spctl = CCM_SPCTL;
|
||||
|
|
@ -60,69 +58,55 @@ bool __dbg_hw_info(void)
|
|||
ser_pllfreq = ccm_get_pll(PLL_SERIAL);
|
||||
usb_pllfreq = ccm_get_pll(PLL_USB);
|
||||
|
||||
snprintf(buf, sizeof (buf), "pll_ref_clk: %u", pllref);
|
||||
lcd_puts(0, line++, buf); line++;
|
||||
lcd_putsf(0, line++, "pll_ref_clk: %u", pllref);
|
||||
line++;
|
||||
|
||||
/* MCU clock domain */
|
||||
snprintf(buf, sizeof (buf), "MPCTL: %08lX", mpctl);
|
||||
lcd_puts(0, line++, buf);
|
||||
lcd_putsf(0, line++, "MPCTL: %08lX", mpctl);
|
||||
|
||||
snprintf(buf, sizeof (buf), " mpl_dpdgck_clk: %u", mcu_pllfreq);
|
||||
lcd_puts(0, line++, buf); line++;
|
||||
lcd_putsf(0, line++, " mpl_dpdgck_clk: %u", mcu_pllfreq);
|
||||
line++;
|
||||
|
||||
regval = CCM_PDR0;
|
||||
snprintf(buf, sizeof (buf), " PDR0: %08lX", regval);
|
||||
lcd_puts(0, line++, buf);
|
||||
lcd_putsf(0, line++, " PDR0: %08lX", regval);
|
||||
|
||||
freq = mcu_pllfreq / (((regval & 0x7) + 1));
|
||||
snprintf(buf, sizeof (buf), " mcu_clk: %u", freq);
|
||||
lcd_puts(0, line++, buf);
|
||||
lcd_putsf(0, line++, " mcu_clk: %u", freq);
|
||||
|
||||
freq = mcu_pllfreq / (((regval >> 11) & 0x7) + 1);
|
||||
snprintf(buf, sizeof (buf), " hsp_clk: %u", freq);
|
||||
lcd_puts(0, line++, buf);
|
||||
lcd_putsf(0, line++, " hsp_clk: %u", freq);
|
||||
|
||||
freq = mcu_pllfreq / (((regval >> 3) & 0x7) + 1);
|
||||
snprintf(buf, sizeof (buf), " hclk_clk: %u", freq);
|
||||
lcd_puts(0, line++, buf);
|
||||
lcd_putsf(0, line++, " hclk_clk: %u", freq);
|
||||
|
||||
snprintf(buf, sizeof (buf), " ipg_clk: %u",
|
||||
lcd_putsf(0, line++, " ipg_clk: %u",
|
||||
freq / (unsigned)(((regval >> 6) & 0x3) + 1));
|
||||
lcd_puts(0, line++, buf);
|
||||
|
||||
snprintf(buf, sizeof (buf), " nfc_clk: %u",
|
||||
lcd_putsf(0, line++, " nfc_clk: %u",
|
||||
freq / (unsigned)(((regval >> 8) & 0x7) + 1));
|
||||
lcd_puts(0, line++, buf);
|
||||
|
||||
line++;
|
||||
|
||||
/* Serial clock domain */
|
||||
snprintf(buf, sizeof (buf), "SPCTL: %08lX", spctl);
|
||||
lcd_puts(0, line++, buf);
|
||||
snprintf(buf, sizeof (buf), " spl_dpdgck_clk: %u", ser_pllfreq);
|
||||
lcd_puts(0, line++, buf);
|
||||
lcd_putsf(0, line++, "SPCTL: %08lX", spctl);
|
||||
lcd_putsf(0, line++, " spl_dpdgck_clk: %u", ser_pllfreq);
|
||||
|
||||
line++;
|
||||
|
||||
/* USB clock domain */
|
||||
snprintf(buf, sizeof (buf), "UPCTL: %08lX", upctl);
|
||||
lcd_puts(0, line++, buf);
|
||||
lcd_putsf(0, line++, "UPCTL: %08lX", upctl);
|
||||
|
||||
snprintf(buf, sizeof (buf), " upl_dpdgck_clk: %u", usb_pllfreq);
|
||||
lcd_puts(0, line++, buf); line++;
|
||||
lcd_putsf(0, line++, " upl_dpdgck_clk: %u", usb_pllfreq);
|
||||
|
||||
regval = CCM_PDR1;
|
||||
snprintf(buf, sizeof (buf), " PDR1: %08lX", regval);
|
||||
lcd_puts(0, line++, buf);
|
||||
lcd_putsf(0, line++, " PDR1: %08lX", regval);
|
||||
|
||||
freq = usb_pllfreq /
|
||||
((((regval >> 30) & 0x3) + 1) * (((regval >> 27) & 0x7) + 1));
|
||||
snprintf(buf, sizeof (buf), " usb_clk: %u", freq);
|
||||
lcd_puts(0, line++, buf);
|
||||
lcd_putsf(0, line++, " usb_clk: %u", freq);
|
||||
|
||||
freq = usb_pllfreq / (((CCM_PDR0 >> 16) & 0x1f) + 1);
|
||||
snprintf(buf, sizeof (buf), " ipg_per_baud: %u", freq);
|
||||
lcd_puts(0, line++, buf);
|
||||
lcd_putsf(0, line++, " ipg_per_baud: %u", freq);
|
||||
|
||||
lcd_update();
|
||||
|
||||
|
|
@ -133,7 +117,6 @@ bool __dbg_hw_info(void)
|
|||
|
||||
bool __dbg_ports(void)
|
||||
{
|
||||
char buf[50];
|
||||
int line;
|
||||
int i;
|
||||
|
||||
|
|
@ -171,71 +154,62 @@ bool __dbg_ports(void)
|
|||
while(1)
|
||||
{
|
||||
line = 0;
|
||||
snprintf(buf, sizeof(buf), "[Ports and Registers]");
|
||||
lcd_puts(0, line++, buf); line++;
|
||||
lcd_puts(0, line++, "[Ports and Registers]");
|
||||
line++;
|
||||
|
||||
/* GPIO1 */
|
||||
snprintf(buf, sizeof(buf), "GPIO1: DR: %08lx GDIR: %08lx", GPIO1_DR, GPIO1_GDIR);
|
||||
lcd_puts(0, line++, buf);
|
||||
lcd_putsf(0, line++, "GPIO1: DR: %08lx GDIR: %08lx", GPIO1_DR, GPIO1_GDIR);
|
||||
|
||||
snprintf(buf, sizeof(buf), " PSR: %08lx ICR1: %08lx", GPIO1_PSR, GPIO1_ICR1);
|
||||
lcd_puts(0, line++, buf);
|
||||
lcd_putsf(0, line++, " PSR: %08lx ICR1: %08lx", GPIO1_PSR, GPIO1_ICR1);
|
||||
|
||||
snprintf(buf, sizeof(buf), " ICR2: %08lx IMR: %08lx", GPIO1_ICR2, GPIO1_IMR);
|
||||
lcd_puts(0, line++, buf);
|
||||
lcd_putsf(0, line++, " ICR2: %08lx IMR: %08lx", GPIO1_ICR2, GPIO1_IMR);
|
||||
|
||||
snprintf(buf, sizeof(buf), " ISR: %08lx", GPIO1_ISR);
|
||||
lcd_puts(0, line++, buf); line++;
|
||||
lcd_putsf(0, line++, " ISR: %08lx", GPIO1_ISR);
|
||||
line++;
|
||||
|
||||
/* GPIO2 */
|
||||
snprintf(buf, sizeof(buf), "GPIO2: DR: %08lx GDIR: %08lx", GPIO2_DR, GPIO2_GDIR);
|
||||
lcd_puts(0, line++, buf);
|
||||
lcd_putsf(0, line++, "GPIO2: DR: %08lx GDIR: %08lx", GPIO2_DR, GPIO2_GDIR);
|
||||
|
||||
snprintf(buf, sizeof(buf), " PSR: %08lx ICR1: %08lx", GPIO2_PSR, GPIO2_ICR1);
|
||||
lcd_puts(0, line++, buf);
|
||||
lcd_putsf(0, line++, " PSR: %08lx ICR1: %08lx", GPIO2_PSR, GPIO2_ICR1);
|
||||
|
||||
snprintf(buf, sizeof(buf), " ICR2: %08lx IMR: %08lx", GPIO2_ICR2, GPIO2_IMR);
|
||||
lcd_puts(0, line++, buf);
|
||||
lcd_putsf(0, line++, " ICR2: %08lx IMR: %08lx", GPIO2_ICR2, GPIO2_IMR);
|
||||
|
||||
snprintf(buf, sizeof(buf), " ISR: %08lx", GPIO2_ISR);
|
||||
lcd_puts(0, line++, buf); line++;
|
||||
lcd_putsf(0, line++, " ISR: %08lx", GPIO2_ISR);
|
||||
line++;
|
||||
|
||||
/* GPIO3 */
|
||||
snprintf(buf, sizeof(buf), "GPIO3: DR: %08lx GDIR: %08lx", GPIO3_DR, GPIO3_GDIR);
|
||||
lcd_puts(0, line++, buf);
|
||||
lcd_putsf(0, line++, "GPIO3: DR: %08lx GDIR: %08lx", GPIO3_DR, GPIO3_GDIR);
|
||||
|
||||
snprintf(buf, sizeof(buf), " PSR: %08lx ICR1: %08lx", GPIO3_PSR, GPIO3_ICR1);
|
||||
lcd_puts(0, line++, buf);
|
||||
lcd_putsf(0, line++, " PSR: %08lx ICR1: %08lx", GPIO3_PSR, GPIO3_ICR1);
|
||||
|
||||
snprintf(buf, sizeof(buf), " ICR2: %08lx IMR: %08lx", GPIO3_ICR2, GPIO3_IMR);
|
||||
lcd_puts(0, line++, buf);
|
||||
lcd_putsf(0, line++, " ICR2: %08lx IMR: %08lx", GPIO3_ICR2, GPIO3_IMR);
|
||||
|
||||
snprintf(buf, sizeof(buf), " ISR: %08lx", GPIO3_ISR);
|
||||
lcd_puts(0, line++, buf); line++;
|
||||
lcd_putsf(0, line++, " ISR: %08lx", GPIO3_ISR);
|
||||
line++;
|
||||
|
||||
lcd_puts(0, line++, "PMIC Registers"); line++;
|
||||
lcd_puts(0, line++, "PMIC Registers");
|
||||
line++;
|
||||
|
||||
mc13783_read_regset(pmic_regset, pmic_regs, ARRAYLEN(pmic_regs));
|
||||
|
||||
for (i = 0; i < (int)ARRAYLEN(pmic_regs); i++)
|
||||
{
|
||||
snprintf(buf, sizeof(buf), "%s: %08lx", pmic_regnames[i], pmic_regs[i]);
|
||||
lcd_puts(0, line++, buf);
|
||||
lcd_putsf(0, line++, "%s: %08lx", pmic_regnames[i], pmic_regs[i]);
|
||||
}
|
||||
|
||||
line++;
|
||||
|
||||
lcd_puts(0, line++, "ADC"); line++;
|
||||
lcd_puts(0, line++, "ADC");
|
||||
line++;
|
||||
|
||||
for (i = 0; i < NUM_ADC_CHANNELS; i += 4)
|
||||
{
|
||||
snprintf(buf, sizeof(buf),
|
||||
lcd_putsf(0, line++,
|
||||
"CH%02d:%04u CH%02d:%04u CH%02d:%04u CH%02d:%04u",
|
||||
i+0, adc_read(i+0),
|
||||
i+1, adc_read(i+1),
|
||||
i+2, adc_read(i+2),
|
||||
i+3, adc_read(i+3));
|
||||
lcd_puts(0, line++, buf);
|
||||
}
|
||||
|
||||
lcd_update();
|
||||
|
|
|
|||
|
|
@ -46,40 +46,39 @@ bool __dbg_ports(void)
|
|||
while(1)
|
||||
{
|
||||
line = 0;
|
||||
snprintf(buf, sizeof(buf), "[Ports and Registers]");
|
||||
lcd_puts(0, line++, buf);
|
||||
lcd_puts(0, line++, "[Ports and Registers]");
|
||||
|
||||
snprintf(buf, sizeof(buf), "GPACON: %08lx GPBCON: %08lx", GPACON, GPBCON); lcd_puts(0, line++, buf);
|
||||
snprintf(buf, sizeof(buf), "GPADAT: %08lx GPBDAT: %08lx", GPADAT, GPBDAT); lcd_puts(0, line++, buf);
|
||||
snprintf(buf, sizeof(buf), "GPAUP: %08lx GPBUP: %08lx", 0ul, GPBUP); lcd_puts(0, line++, buf);
|
||||
snprintf(buf, sizeof(buf), "GPCCON: %08lx GPDCON: %08lx", GPCCON, GPDCON); lcd_puts(0, line++, buf);
|
||||
snprintf(buf, sizeof(buf), "GPCDAT: %08lx GPDDAT: %08lx", GPCDAT, GPDDAT); lcd_puts(0, line++, buf);
|
||||
snprintf(buf, sizeof(buf), "GPCUP: %08lx GPDUP: %08lx", GPCUP, GPDUP); lcd_puts(0, line++, buf);
|
||||
lcd_putsf(0, line++, "GPACON: %08lx GPBCON: %08lx", GPACON, GPBCON);
|
||||
lcd_putsf(0, line++, "GPADAT: %08lx GPBDAT: %08lx", GPADAT, GPBDAT);
|
||||
lcd_putsf(0, line++, "GPAUP: %08lx GPBUP: %08lx", 0ul, GPBUP);
|
||||
lcd_putsf(0, line++, "GPCCON: %08lx GPDCON: %08lx", GPCCON, GPDCON);
|
||||
lcd_putsf(0, line++, "GPCDAT: %08lx GPDDAT: %08lx", GPCDAT, GPDDAT);
|
||||
lcd_putsf(0, line++, "GPCUP: %08lx GPDUP: %08lx", GPCUP, GPDUP)
|
||||
|
||||
snprintf(buf, sizeof(buf), "GPCCON: %08lx GPDCON: %08lx", GPCCON, GPDCON); lcd_puts(0, line++, buf);
|
||||
snprintf(buf, sizeof(buf), "GPCDAT: %08lx GPDDAT: %08lx", GPCDAT, GPDDAT); lcd_puts(0, line++, buf);
|
||||
snprintf(buf, sizeof(buf), "GPCUP: %08lx GPDUP: %08lx", GPCUP, GPDUP); lcd_puts(0, line++, buf);
|
||||
lcd_putsf(0, line++, "GPCCON: %08lx GPDCON: %08lx", GPCCON, GPDCON);
|
||||
lcd_putsf(0, line++, "GPCDAT: %08lx GPDDAT: %08lx", GPCDAT, GPDDAT);
|
||||
lcd_putsf(0, line++, "GPCUP: %08lx GPDUP: %08lx", GPCUP, GPDUP);
|
||||
|
||||
snprintf(buf, sizeof(buf), "GPECON: %08lx GPFCON: %08lx", GPECON, GPFCON); lcd_puts(0, line++, buf);
|
||||
snprintf(buf, sizeof(buf), "GPEDAT: %08lx GPFDAT: %08lx", GPEDAT, GPFDAT); lcd_puts(0, line++, buf);
|
||||
snprintf(buf, sizeof(buf), "GPEUP: %08lx GPFUP: %08lx", GPEUP, GPFUP); lcd_puts(0, line++, buf);
|
||||
lcd_putsf(0, line++, "GPECON: %08lx GPFCON: %08lx", GPECON, GPFCON);
|
||||
lcd_putsf(0, line++, "GPEDAT: %08lx GPFDAT: %08lx", GPEDAT, GPFDAT);
|
||||
lcd_putsf(0, line++, "GPEUP: %08lx GPFUP: %08lx", GPEUP, GPFUP);
|
||||
|
||||
snprintf(buf, sizeof(buf), "GPGCON: %08lx GPHCON: %08lx", GPGCON, GPHCON); lcd_puts(0, line++, buf);
|
||||
snprintf(buf, sizeof(buf), "GPGDAT: %08lx GPHDAT: %08lx", GPGDAT, GPHDAT); lcd_puts(0, line++, buf);
|
||||
snprintf(buf, sizeof(buf), "GPGUP: %08lx GPHUP: %08lx", GPGUP, GPHUP); lcd_puts(0, line++, buf);
|
||||
lcd_putsf(0, line++, "GPGCON: %08lx GPHCON: %08lx", GPGCON, GPHCON);
|
||||
lcd_putsf(0, line++, "GPGDAT: %08lx GPHDAT: %08lx", GPGDAT, GPHDAT);
|
||||
lcd_putsf(0, line++, "GPGUP: %08lx GPHUP: %08lx", GPGUP, GPHUP);
|
||||
|
||||
snprintf(buf, sizeof(buf), "GPJCON: %08lx", GPJCON); lcd_puts(0, line++, buf);
|
||||
snprintf(buf, sizeof(buf), "GPJDAT: %08lx", GPJDAT); lcd_puts(0, line++, buf);
|
||||
snprintf(buf, sizeof(buf), "GPJUP: %08lx", GPJUP); lcd_puts(0, line++, buf);
|
||||
lcd_putsf(0, line++, "GPJCON: %08lx", GPJCON);
|
||||
lcd_putsf(0, line++, "GPJDAT: %08lx", GPJDAT);
|
||||
lcd_putsf(0, line++, "GPJUP: %08lx", GPJUP);
|
||||
|
||||
line++;
|
||||
|
||||
snprintf(buf, sizeof(buf), "SRCPND: %08lx INTMOD: %08lx", SRCPND, INTMOD); lcd_puts(0, line++, buf);
|
||||
snprintf(buf, sizeof(buf), "INTMSK: %08lx INTPND: %08lx", INTMSK, INTPND); lcd_puts(0, line++, buf);
|
||||
snprintf(buf, sizeof(buf), "CLKCON: %08lx CLKSLOW: %08lx", CLKCON, CLKSLOW); lcd_puts(0, line++, buf);
|
||||
snprintf(buf, sizeof(buf), "MPLLCON: %08lx UPLLCON: %08lx", MPLLCON, UPLLCON); lcd_puts(0, line++, buf);
|
||||
snprintf(buf, sizeof(buf), "CLKDIVN: %08lx CAMDIVN: %08lx", CLKDIVN, CAMDIVN); lcd_puts(0, line++, buf);
|
||||
snprintf(buf, sizeof(buf), "BWSCON: %08lx TCONSEL: %08lx", BWSCON, TCONSEL); lcd_puts(0, line++, buf);
|
||||
lcd_putsf(0, line++, "SRCPND: %08lx INTMOD: %08lx", SRCPND, INTMOD);
|
||||
lcd_putsf(0, line++, "INTMSK: %08lx INTPND: %08lx", INTMSK, INTPND);
|
||||
lcd_putsf(0, line++, "CLKCON: %08lx CLKSLOW: %08lx", CLKCON, CLKSLOW);
|
||||
lcd_putsf(0, line++, "MPLLCON: %08lx UPLLCON: %08lx", MPLLCON, UPLLCON);
|
||||
lcd_putsf(0, line++, "CLKDIVN: %08lx CAMDIVN: %08lx", CLKDIVN, CAMDIVN);
|
||||
lcd_putsf(0, line++, "BWSCON: %08lx TCONSEL: %08lx", BWSCON, TCONSEL);
|
||||
|
||||
lcd_update();
|
||||
if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL))
|
||||
|
|
|
|||
|
|
@ -36,16 +36,13 @@ static const char* const uiename[] = {
|
|||
*/
|
||||
void __attribute__((noreturn)) UIE(unsigned int pc, unsigned int num)
|
||||
{
|
||||
char str[32];
|
||||
|
||||
lcd_clear_display();
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
lcd_setfont(FONT_SYSFIXED);
|
||||
#endif
|
||||
lcd_puts(0, 0, uiename[num]);
|
||||
snprintf(str, sizeof(str), "at %08x" IF_COP(" (%d)"), pc
|
||||
lcd_putsf(0, 1, "at %08x" IF_COP(" (%d)"), pc
|
||||
IF_COP(, CURRENT_CORE));
|
||||
lcd_puts(0, 1, str);
|
||||
lcd_update();
|
||||
|
||||
disable_interrupt(IRQ_FIQ_STATUS);
|
||||
|
|
|
|||
|
|
@ -48,7 +48,6 @@ bool __dbg_hw_info(void)
|
|||
int *address=0x0;
|
||||
#endif
|
||||
bool done=false;
|
||||
char buf[100];
|
||||
|
||||
lcd_setfont(FONT_SYSFIXED);
|
||||
lcd_clear_display();
|
||||
|
|
@ -58,38 +57,27 @@ bool __dbg_hw_info(void)
|
|||
|
||||
lcd_puts(0, line++, "Clock info:");
|
||||
#if LCD_WIDTH > 320
|
||||
snprintf(buf, sizeof(buf), "IO_CLK_PLLA: 0x%04x IO_CLK_PLLB: 0x%04x IO_CLK_SEL0: 0x%04x IO_CLK_SEL1: 0x%04x",
|
||||
IO_CLK_PLLA, IO_CLK_PLLB, IO_CLK_SEL0, IO_CLK_SEL1); lcd_puts(0, line++, buf);
|
||||
snprintf(buf, sizeof(buf), "IO_CLK_SEL2: 0x%04x IO_CLK_DIV0: 0x%04x IO_CLK_DIV1: 0x%04x IO_CLK_DIV2: 0x%04x",
|
||||
IO_CLK_SEL2, IO_CLK_DIV0, IO_CLK_DIV1, IO_CLK_DIV2); lcd_puts(0, line++, buf);
|
||||
snprintf(buf, sizeof(buf), "IO_CLK_DIV3: 0x%04x IO_CLK_DIV4: 0x%04x IO_CLK_BYP : 0x%04x IO_CLK_INV : 0x%04x",
|
||||
IO_CLK_DIV3, IO_CLK_DIV4, IO_CLK_BYP, IO_CLK_INV); lcd_puts(0, line++, buf);
|
||||
snprintf(buf, sizeof(buf), "IO_CLK_MOD0: 0x%04x IO_CLK_MOD1: 0x%04x IO_CLK_MOD2: 0x%04x IO_CLK_LPCTL0: 0x%04x",
|
||||
IO_CLK_MOD0, IO_CLK_MOD1, IO_CLK_MOD2, IO_CLK_LPCTL0); lcd_puts(0, line++, buf);
|
||||
lcd_putsf(0, line++, "IO_CLK_PLLA: 0x%04x IO_CLK_PLLB: 0x%04x IO_CLK_SEL0: 0x%04x IO_CLK_SEL1: 0x%04x",
|
||||
IO_CLK_PLLA, IO_CLK_PLLB, IO_CLK_SEL0, IO_CLK_SEL1);
|
||||
lcd_putsf(0, line++, "IO_CLK_SEL2: 0x%04x IO_CLK_DIV0: 0x%04x IO_CLK_DIV1: 0x%04x IO_CLK_DIV2: 0x%04x",
|
||||
IO_CLK_SEL2, IO_CLK_DIV0, IO_CLK_DIV1, IO_CLK_DIV2);
|
||||
lcd_putsf(0, line++, "IO_CLK_DIV3: 0x%04x IO_CLK_DIV4: 0x%04x IO_CLK_BYP : 0x%04x IO_CLK_INV : 0x%04x",
|
||||
IO_CLK_DIV3, IO_CLK_DIV4, IO_CLK_BYP, IO_CLK_INV);
|
||||
lcd_putsf(0, line++, "IO_CLK_MOD0: 0x%04x IO_CLK_MOD1: 0x%04x IO_CLK_MOD2: 0x%04x IO_CLK_LPCTL0: 0x%04x",
|
||||
IO_CLK_MOD0, IO_CLK_MOD1, IO_CLK_MOD2, IO_CLK_LPCTL0);
|
||||
#else
|
||||
snprintf(buf, sizeof(buf), " IO_CLK_PLLA: 0x%04x IO_CLK_PLLB: 0x%04x", IO_CLK_PLLA, IO_CLK_PLLB);
|
||||
lcd_puts(0, line++, buf);
|
||||
snprintf(buf, sizeof(buf), " IO_CLK_SEL0: 0x%04x IO_CLK_SEL1: 0x%04x", IO_CLK_SEL0, IO_CLK_SEL1);
|
||||
lcd_puts(0, line++, buf);
|
||||
snprintf(buf, sizeof(buf), " IO_CLK_SEL2: 0x%04x IO_CLK_DIV0: 0x%04x", IO_CLK_SEL2, IO_CLK_DIV0);
|
||||
lcd_puts(0, line++, buf);
|
||||
snprintf(buf, sizeof(buf), " IO_CLK_DIV1: 0x%04x IO_CLK_DIV2: 0x%04x", IO_CLK_DIV1, IO_CLK_DIV2);
|
||||
lcd_puts(0, line++, buf);
|
||||
snprintf(buf, sizeof(buf), " IO_CLK_DIV3: 0x%04x IO_CLK_DIV4: 0x%04x", IO_CLK_DIV3, IO_CLK_DIV4);
|
||||
lcd_puts(0, line++, buf);
|
||||
snprintf(buf, sizeof(buf), " IO_CLK_BYP : 0x%04x IO_CLK_INV : 0x%04x", IO_CLK_BYP, IO_CLK_INV);
|
||||
lcd_puts(0, line++, buf);
|
||||
snprintf(buf, sizeof(buf), " IO_CLK_MOD0: 0x%04x IO_CLK_MOD1: 0x%04x ", IO_CLK_MOD0, IO_CLK_MOD1);
|
||||
lcd_puts(0, line++, buf);
|
||||
snprintf(buf, sizeof(buf), " IO_CLK_MOD2: 0x%04x IO_CLK_LPCTL0: 0x%04x ", IO_CLK_MOD2, IO_CLK_LPCTL0);
|
||||
lcd_puts(0, line++, buf);
|
||||
lcd_putsf(0, line++, " IO_CLK_PLLA: 0x%04x IO_CLK_PLLB: 0x%04x", IO_CLK_PLLA, IO_CLK_PLLB);
|
||||
lcd_putsf(0, line++, " IO_CLK_SEL0: 0x%04x IO_CLK_SEL1: 0x%04x", IO_CLK_SEL0, IO_CLK_SEL1);
|
||||
lcd_putsf(0, line++, " IO_CLK_SEL2: 0x%04x IO_CLK_DIV0: 0x%04x", IO_CLK_SEL2, IO_CLK_DIV0);
|
||||
lcd_putsf(0, line++, " IO_CLK_DIV1: 0x%04x IO_CLK_DIV2: 0x%04x", IO_CLK_DIV1, IO_CLK_DIV2);
|
||||
lcd_putsf(0, line++, " IO_CLK_DIV3: 0x%04x IO_CLK_DIV4: 0x%04x", IO_CLK_DIV3, IO_CLK_DIV4);
|
||||
lcd_putsf(0, line++, " IO_CLK_BYP : 0x%04x IO_CLK_INV : 0x%04x", IO_CLK_BYP, IO_CLK_INV);
|
||||
lcd_putsf(0, line++, " IO_CLK_MOD0: 0x%04x IO_CLK_MOD1: 0x%04x ", IO_CLK_MOD0, IO_CLK_MOD1);
|
||||
lcd_putsf(0, line++, " IO_CLK_MOD2: 0x%04x IO_CLK_LPCTL0: 0x%04x ", IO_CLK_MOD2, IO_CLK_LPCTL0);
|
||||
lcd_puts(0, line++, "Interrupt info:");
|
||||
snprintf(buf, sizeof(buf), " IO_INTC_EINT0: 0x%04x IO_INTC_EINT1: 0x%04x ", IO_INTC_EINT0, IO_INTC_EINT1);
|
||||
lcd_puts(0, line++, buf);
|
||||
snprintf(buf, sizeof(buf), " IO_INTC_EINT2: 0x%04x IO_INTC_IRQ0: 0x%04x ", IO_INTC_EINT2, IO_INTC_IRQ0);
|
||||
lcd_puts(0, line++, buf);
|
||||
snprintf(buf, sizeof(buf), " IO_INTC_IRQ1: 0x%04x IO_INTC_IRQ2: 0x%04x ", IO_INTC_IRQ1, IO_INTC_IRQ2);
|
||||
lcd_puts(0, line++, buf);
|
||||
lcd_putsf(0, line++, " IO_INTC_EINT0: 0x%04x IO_INTC_EINT1: 0x%04x ", IO_INTC_EINT0, IO_INTC_EINT1);
|
||||
lcd_putsf(0, line++, " IO_INTC_EINT2: 0x%04x IO_INTC_IRQ0: 0x%04x ", IO_INTC_EINT2, IO_INTC_IRQ0);
|
||||
lcd_putsf(0, line++, " IO_INTC_IRQ1: 0x%04x IO_INTC_IRQ2: 0x%04x ", IO_INTC_IRQ1, IO_INTC_IRQ2);
|
||||
#endif
|
||||
|
||||
lcd_puts(0, line++, "Board revision:");
|
||||
|
|
@ -134,20 +122,19 @@ bool __dbg_hw_info(void)
|
|||
lcd_set_direct_fb(true);
|
||||
|
||||
lcd_puts(0, line++, "LCD info:");
|
||||
snprintf(buf, sizeof(buf), " LCD direct FB access? %s", (lcd_get_direct_fb() ? "yes" : "no"));
|
||||
lcd_puts(0, line++, buf);
|
||||
lcd_putsf(0, line++, " LCD direct FB access? %s", (lcd_get_direct_fb() ? "yes" : "no"));
|
||||
line++;
|
||||
#endif
|
||||
lcd_puts(0, line++, "[Rockbox info]");
|
||||
snprintf(buf, sizeof(buf), "current tick: %08x Seconds running: %08d",
|
||||
(unsigned int)current_tick, (unsigned int)current_tick/100); lcd_puts(0, line++, buf);
|
||||
lcd_putsf(0, line++, "current tick: %08x Seconds running: %08d",
|
||||
(unsigned int)current_tick, (unsigned int)current_tick/100);
|
||||
#ifndef CREATIVE_ZVx
|
||||
snprintf(buf, sizeof(buf), "Address: 0x%08x Data: 0x%08x",
|
||||
(unsigned int)address, *address); lcd_puts(0, line++, buf);
|
||||
snprintf(buf, sizeof(buf), "Address: 0x%08x Data: 0x%08x",
|
||||
(unsigned int)(address+1), *(address+1)); lcd_puts(0, line++, buf);
|
||||
snprintf(buf, sizeof(buf), "Address: 0x%08x Data: 0x%08x",
|
||||
(unsigned int)(address+2), *(address+2)); lcd_puts(0, line++, buf);
|
||||
lcd_putsf(0, line++, "Address: 0x%08x Data: 0x%08x",
|
||||
(unsigned int)address, *address);
|
||||
lcd_putsf(0, line++, "Address: 0x%08x Data: 0x%08x",
|
||||
(unsigned int)(address+1), *(address+1));
|
||||
lcd_putsf(0, line++, "Address: 0x%08x Data: 0x%08x",
|
||||
(unsigned int)(address+2), *(address+2));
|
||||
#endif
|
||||
|
||||
lcd_update();
|
||||
|
|
|
|||
|
|
@ -165,16 +165,13 @@ static void system_display_exception_info(unsigned long format,
|
|||
unsigned long pc)
|
||||
{
|
||||
int vector = (format >> 18) & 0xff;
|
||||
char str[32];
|
||||
|
||||
/* clear screen */
|
||||
lcd_clear_display ();
|
||||
lcd_setfont(FONT_SYSFIXED);
|
||||
|
||||
snprintf(str, sizeof(str), "I%02x:%s", vector, irqname[vector]);
|
||||
lcd_puts(0, 0, str);
|
||||
snprintf(str, sizeof(str), "at %08x", pc);
|
||||
lcd_puts(0, 1, str);
|
||||
lcd_putsf(0, 0, "I%02x:%s", vector, irqname[vector]);
|
||||
lcd_putsf(0, 1, "at %08x", pc);
|
||||
lcd_update();
|
||||
|
||||
system_exception_wait();
|
||||
|
|
|
|||
|
|
@ -295,22 +295,19 @@ void UIE (unsigned int pc) __attribute__((section(".text")));
|
|||
void UIE (unsigned int pc) /* Unexpected Interrupt or Exception */
|
||||
{
|
||||
unsigned int n;
|
||||
char str[32];
|
||||
|
||||
asm volatile ("sts\tpr,%0" : "=r"(n));
|
||||
|
||||
/* clear screen */
|
||||
lcd_clear_display ();
|
||||
lcd_clear_display();
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
lcd_setfont(FONT_SYSFIXED);
|
||||
#endif
|
||||
/* output exception */
|
||||
n = (n - (unsigned)UIE4 + 12)>>2; /* get exception or interrupt number */
|
||||
snprintf(str,sizeof(str),"I%02x:%s",n,irqname[n]);
|
||||
lcd_puts(0,0,str);
|
||||
snprintf(str,sizeof(str),"at %08x",pc);
|
||||
lcd_puts(0,1,str);
|
||||
lcd_update ();
|
||||
lcd_putsf(0, 0, "I%02x:%s", n, irqname[n]);
|
||||
lcd_putsf(0, 1, "at %08x", pc);
|
||||
lcd_update();
|
||||
|
||||
/* try to restart firmware if ON is pressed */
|
||||
system_exception_wait();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue