Debug function to dump audio and PMU registers --- apps/debug_menu.c | 20 ++++++++++++++++++++ firmware/drivers/audio/as3514.c | 2 +- 2 files changed, 21 insertions(+), 1 deletions(-) diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 828b881..a452f98 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c @@ -52,6 +52,7 @@ #endif #include "lcd-remote.h" #include "crc32.h" +#define LOGF_ENABLE #include "logf.h" #if (CONFIG_PLATFORM & PLATFORM_NATIVE) #include "disk.h" @@ -2318,6 +2319,22 @@ static bool dbg_pic(void) } #endif +#ifdef HAVE_AS3543 +extern uint8_t as3514_regs[AS3514_NUM_AUDIO_REGS]; +#include "ascodec-target.h" +static bool dbg_as3543(void) +{ + unsigned i, j; + for (i = 0; i < AS3514_NUM_AUDIO_REGS; i++) + logf("AS3514[%x] = %x", i, (unsigned)(as3514_regs[i])); + + for (j = 0x17; j <= 0x1B; j++) + for (i = 0; i <= 7; i++) + logf("AS3514[%x,%x] = %x", j, i, ascodec_read_pmu(j,i)); + + return false; +} +#endif /* HAVE_AS3543 */ /****** The menu *********/ struct the_menu_item { @@ -2404,6 +2421,9 @@ static const struct the_menu_item menuitems[] = { { "View PIC info", dbg_pic }, #endif #ifdef ROCKBOX_HAS_LOGF +#ifdef HAVE_AS3543 + { "Log AS3543 registers", dbg_as3543 }, +#endif /* HAVE_AS3543 */ {"Show Log File", logfdisplay }, {"Dump Log File", logfdump }, #endif diff --git a/firmware/drivers/audio/as3514.c b/firmware/drivers/audio/as3514.c index 1774932..3db95ab 100644 --- a/firmware/drivers/audio/as3514.c +++ b/firmware/drivers/audio/as3514.c @@ -79,7 +79,7 @@ const struct sound_settings_info audiohw_settings[] = { }; /* Shadow registers */ -static uint8_t as3514_regs[AS3514_NUM_AUDIO_REGS]; /* 8-bit registers */ +/* static */ uint8_t as3514_regs[AS3514_NUM_AUDIO_REGS]; /* 8-bit registers */ /* * little helper method to set register values. -- 1.7.1