From f62388f82c1a3cbc5e47c8e002abb5a514e9251b Mon Sep 17 00:00:00 2001 From: Rob Purchase Date: Wed, 24 Jun 2009 07:37:11 +0000 Subject: TCC78x: Enable interrupts/threading in the bootloader (required now that the storage driver yields). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21486 a1c6a512-1295-4272-9138-f99709370657 --- bootloader/telechips.c | 64 +++++--------------------------------------------- 1 file changed, 6 insertions(+), 58 deletions(-) (limited to 'bootloader') diff --git a/bootloader/telechips.c b/bootloader/telechips.c index 1e54f5d..8babbf3 100644 --- a/bootloader/telechips.c +++ b/bootloader/telechips.c @@ -57,19 +57,18 @@ 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"); + + lcd_puts_scroll(0,0,"+++ this is a very 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 time This loop is currently running at about 100 iterations/second */ @@ -107,6 +106,7 @@ void show_debug_screen(void) #endif count++; printf("Count: %d",count); + lcd_update(); sleep(HZ/10); } @@ -122,57 +122,6 @@ void show_debug_screen(void) while (true); } -#else /* !CPU_TCC77X */ - -void show_debug_screen(void) -{ - int button; - int power_count = 0; - int count = 0; - bool do_power_off = false; -#ifdef HAVE_BUTTON_DATA - unsigned int data; -#endif - - while(!do_power_off) { - line = 0; - printf("Hello World!"); - -#ifdef HAVE_BUTTON_DATA - button = button_read_device(&data); -#else - button = button_read_device(); -#endif - - /* 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); - - count++; - printf("Count: %d",count); - } - - lcd_clear_display(); - line = 0; - printf("POWER-OFF"); - - /* Power-off */ - power_off(); - - printf("(NOT) POWERED OFF"); - while (true); -} -#endif - void* main(void) { #ifdef TCCBOOT @@ -182,11 +131,10 @@ void* main(void) system_init(); power_init(); -#ifndef COWON_D2 - /* The D2 doesn't enable threading or interrupts */ + kernel_init(); enable_irq(); -#endif + lcd_init(); adc_init(); -- cgit v1.1