1
0
Fork 0
forked from len0rd/rockbox

Add the Sansa M200 (v1) as a target - it's extremely similar to the Logik DAX (the LCD driver worked unchanged). Plus various tcc77x work, including a working tick interrupt (enabled in the bootloader). Rockbox itself builds for the M200 (there are no keymaps yet for the DAX), but doesn't progress very far due to the lack of an ATA (NAND flash) driver.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17306 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Dave Chapman 2008-05-02 19:12:09 +00:00
parent 4cf4b5c2ae
commit f2042983f0
31 changed files with 1879 additions and 37 deletions

View file

@ -53,6 +53,64 @@ extern int line;
#define MAX_LOAD_SIZE (8*1024*1024) /* Arbitrary, but plenty. */
/* The following function is just test/development code */
#ifdef CPU_TCC77X
void show_debug_screen(void)
{
int button;
int power_count = 0;
int count = 0;
bool do_power_off = false;
lcd_puts_scroll(0,0,"this is a very long line to test scrolling");
while(!do_power_off) {
line = 1;
button = button_get(false);
/* Power-off if POWER button has been held for a long time
This loop is currently running at about 100 iterations/second
*/
if (button & POWEROFF_BUTTON) {
power_count++;
if (power_count > 200)
do_power_off = true;
} else {
power_count = 0;
}
printf("Btn: 0x%08x",button);
printf("Tick: %d",current_tick);
printf("GPIOA: 0x%08x",GPIOA);
printf("GPIOB: 0x%08x",GPIOB);
printf("GPIOC: 0x%08x",GPIOC);
printf("GPIOD: 0x%08x",GPIOD);
// printf("GPIOE: 0x%08x",GPIOE);
#if 0
int i;
for (i = 0; i<4; i++)
{
printf("ADC%d: 0x%04x",i,adc_read(i));
}
#endif
count++;
printf("Count: %d",count);
sleep(HZ/10);
}
lcd_clear_display();
line = 0;
printf("POWER-OFF");
/* Power-off */
power_off();
printf("(NOT) POWERED OFF");
while (true);
}
#else /* !CPU_TCC77X */
void show_debug_screen(void)
{
int button;
@ -100,7 +158,7 @@ void show_debug_screen(void)
printf("(NOT) POWERED OFF");
while (true);
}
#endif
void* main(void)
{
@ -111,6 +169,11 @@ void* main(void)
power_init();
system_init();
#ifndef COWON_D2
/* The D2 doesn't enable threading or interrupts */
kernel_init();
enable_irq();
#endif
lcd_init();
adc_init();