1
0
Fork 0
forked from len0rd/rockbox

imx233/fuze+: implement rtc (time only, alarm still to implement)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31473 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Amaury Pouly 2011-12-31 13:35:45 +00:00
parent 162fdeaa97
commit 094e62a528
4 changed files with 247 additions and 6 deletions

View file

@ -30,6 +30,7 @@
#include "power-imx233.h"
#include "clkctrl-imx233.h"
#include "powermgmt-imx233.h"
#include "rtc-imx233.h"
#include "string.h"
static struct
@ -313,10 +314,43 @@ bool dbg_hw_info_powermgmt(void)
}
}
bool dbg_hw_info_rtc(void)
{
lcd_setfont(FONT_SYSFIXED);
while(1)
{
int button = get_action(CONTEXT_STD, HZ / 10);
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();
struct imx233_rtc_info_t info = imx233_rtc_get_info();
lcd_putsf(0, 0, "seconds: %lu", info.seconds);
for(int i = 0; i < 6; i++)
lcd_putsf(0, i + 1, "persistent%d: 0x%lx", i, info.persistent[i]);
lcd_update();
yield();
}
}
bool dbg_hw_info(void)
{
return dbg_hw_info_clkctrl() && dbg_hw_info_dma() && dbg_hw_info_adc() &&
dbg_hw_info_power() && dbg_hw_info_powermgmt() && dbg_hw_target_info();
dbg_hw_info_power() && dbg_hw_info_powermgmt() && dbg_hw_info_rtc() &&
dbg_hw_target_info();
}
bool dbg_ports(void)