imx233: add adc debug screen
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30983 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
e167c1d8d7
commit
d8666336a7
1 changed files with 36 additions and 1 deletions
|
@ -25,6 +25,8 @@
|
|||
#include "action.h"
|
||||
#include "lcd.h"
|
||||
#include "font.h"
|
||||
#include "adc.h"
|
||||
#include "adc-imx233.h"
|
||||
|
||||
static struct
|
||||
{
|
||||
|
@ -78,9 +80,42 @@ bool dbg_hw_info_dma(void)
|
|||
}
|
||||
}
|
||||
|
||||
bool dbg_hw_info_adc(void)
|
||||
{
|
||||
lcd_setfont(FONT_SYSFIXED);
|
||||
|
||||
while(1)
|
||||
{
|
||||
int button = get_action(CONTEXT_STD, HZ / 25);
|
||||
switch(button)
|
||||
{
|
||||
case ACTION_STD_NEXT:
|
||||
case ACTION_STD_PREV:
|
||||
case ACTION_STD_OK:
|
||||
case ACTION_STD_MENU:
|
||||
lcd_setfont(FONT_UI);
|
||||
return true;
|
||||
case ACTION_STD_CANCEL:
|
||||
lcd_setfont(FONT_UI);
|
||||
return false;
|
||||
}
|
||||
|
||||
lcd_clear_display();
|
||||
|
||||
for(unsigned i = 0; i < NUM_ADC_CHANNELS; i++)
|
||||
{
|
||||
lcd_putsf(0, i, "%s %d", imx233_adc_channel_name[i],
|
||||
adc_read(i));
|
||||
}
|
||||
|
||||
lcd_update();
|
||||
yield();
|
||||
}
|
||||
}
|
||||
|
||||
bool dbg_hw_info(void)
|
||||
{
|
||||
return dbg_hw_info_dma() && dbg_hw_target_info();
|
||||
return dbg_hw_info_dma() && dbg_hw_info_adc() && dbg_hw_target_info();
|
||||
}
|
||||
|
||||
bool dbg_ports(void)
|
||||
|
|
Loading…
Reference in a new issue