diff options
| author | Dave Chapman <dave@dchapman.com> | 2008-05-02 19:12:09 +0000 |
|---|---|---|
| committer | Dave Chapman <dave@dchapman.com> | 2008-05-02 19:12:09 +0000 |
| commit | f2042983f08cd49404be0b6916fc73d778fe8dba (patch) | |
| tree | 33a84414ca4d94770f900e92074c18ecadf23ed7 /bootloader/telechips.c | |
| parent | 4cf4b5c2aef075b719e834f30d17c0986fadb658 (diff) | |
| download | rockbox-f2042983f08cd49404be0b6916fc73d778fe8dba.zip rockbox-f2042983f08cd49404be0b6916fc73d778fe8dba.tar.gz rockbox-f2042983f08cd49404be0b6916fc73d778fe8dba.tar.bz2 rockbox-f2042983f08cd49404be0b6916fc73d778fe8dba.tar.xz | |
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
Diffstat (limited to 'bootloader/telechips.c')
| -rw-r--r-- | bootloader/telechips.c | 65 |
1 files changed, 64 insertions, 1 deletions
diff --git a/bootloader/telechips.c b/bootloader/telechips.c index 6666575..7563a18 100644 --- a/bootloader/telechips.c +++ b/bootloader/telechips.c @@ -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(); |