summaryrefslogtreecommitdiff
path: root/bootloader/telechips.c
diff options
context:
space:
mode:
Diffstat (limited to 'bootloader/telechips.c')
-rw-r--r--bootloader/telechips.c36
1 files changed, 17 insertions, 19 deletions
diff --git a/bootloader/telechips.c b/bootloader/telechips.c
index 7f9a3556c0..a4f4d36c11 100644
--- a/bootloader/telechips.c
+++ b/bootloader/telechips.c
@@ -44,16 +44,12 @@
44#include "file.h" 44#include "file.h"
45#include "common.h" 45#include "common.h"
46 46
47#if defined(COWON_D2) || defined(IAUDIO_7) && defined(TCCBOOT) 47#if defined(COWON_D2) || defined(IAUDIO_7)
48# define REAL_BOOT 48#include "pcf50606.h"
49#endif 49#endif
50 50
51#ifdef REAL_BOOT 51/* Address to load main Rockbox image to */
52# if defined(COWON_D2) || defined(IAUDIO_7) 52#define LOAD_ADDRESS 0x20000000 /* DRAM_START */
53# include "pcf50606.h"
54# endif
55# define LOAD_ADDRESS 0x20000000 /* DRAM_START */
56#endif
57 53
58char version[] = APPSVERSION; 54char version[] = APPSVERSION;
59 55
@@ -70,13 +66,12 @@ void show_debug_screen(void)
70 int count = 0; 66 int count = 0;
71 bool do_power_off = false; 67 bool do_power_off = false;
72 68
73 /*lcd_puts_scroll(0,0,"this is a very long line to test scrolling");*/ 69 lcd_puts_scroll(0,0,"this is a very long line to test scrolling");
74 while(!do_power_off) { 70 while (!do_power_off) {
75
76 line = 1; 71 line = 1;
77 button = button_get(false); 72 button = button_get(false);
78 73
79 /* Power-off if POWER button has been held for a time 74 /* Power-off if POWER button has been held for a time
80 This loop is currently running at about 100 iterations/second 75 This loop is currently running at about 100 iterations/second
81 */ 76 */
82 if (button & POWEROFF_BUTTON) { 77 if (button & POWEROFF_BUTTON) {
@@ -86,7 +81,7 @@ void show_debug_screen(void)
86 } else { 81 } else {
87 power_count = 0; 82 power_count = 0;
88 } 83 }
89#ifdef BUTTON_SELECT 84#if 0
90 if (button & BUTTON_SELECT){ 85 if (button & BUTTON_SELECT){
91 _backlight_off(); 86 _backlight_off();
92 } 87 }
@@ -94,17 +89,19 @@ void show_debug_screen(void)
94 _backlight_on(); 89 _backlight_on();
95 } 90 }
96#endif 91#endif
97 /*printf("Btn: 0x%08x",button); 92 printf("Btn: 0x%08x",button);
93#if 0
98 printf("Tick: %d",current_tick); 94 printf("Tick: %d",current_tick);
99 printf("GPIOA: 0x%08x",GPIOA); 95 printf("GPIOA: 0x%08x",GPIOA);
100 printf("GPIOB: 0x%08x",GPIOB); 96 printf("GPIOB: 0x%08x",GPIOB);
101 printf("GPIOC: 0x%08x",GPIOC); 97 printf("GPIOC: 0x%08x",GPIOC);
102 printf("GPIOD: 0x%08x",GPIOD); 98 printf("GPIOD: 0x%08x",GPIOD);
103 printf("GPIOE: 0x%08x",GPIOE);*/ 99 printf("GPIOE: 0x%08x",GPIOE);
100#endif
104 101
105#if 0 102#if 0
106 int i; 103 int i;
107 for (i = 1; i<4; i++) 104 for (i = 0; i<4; i++)
108 { 105 {
109 printf("ADC%d: 0x%04x",i,adc_read(i)); 106 printf("ADC%d: 0x%04x",i,adc_read(i));
110 } 107 }
@@ -124,9 +121,10 @@ void show_debug_screen(void)
124 121
125 printf("(NOT) POWERED OFF"); 122 printf("(NOT) POWERED OFF");
126 while (true); 123 while (true);
127
128} 124}
125
129#else /* !CPU_TCC77X */ 126#else /* !CPU_TCC77X */
127
130void show_debug_screen(void) 128void show_debug_screen(void)
131{ 129{
132 int button; 130 int button;
@@ -178,7 +176,7 @@ void show_debug_screen(void)
178 176
179void* main(void) 177void* main(void)
180{ 178{
181#ifdef REAL_BOOT 179#ifdef TCCBOOT
182 int rc; 180 int rc;
183 unsigned char* loadbuffer = (unsigned char*)LOAD_ADDRESS; 181 unsigned char* loadbuffer = (unsigned char*)LOAD_ADDRESS;
184#endif 182#endif
@@ -203,7 +201,7 @@ void* main(void)
203 201
204/* Only load the firmware if TCCBOOT is defined - this ensures SDRAM_START is 202/* Only load the firmware if TCCBOOT is defined - this ensures SDRAM_START is
205 available for loading the firmware. Otherwise display the debug screen. */ 203 available for loading the firmware. Otherwise display the debug screen. */
206#ifdef REAL_BOOT 204#ifdef TCCBOOT
207 printf("Rockbox boot loader"); 205 printf("Rockbox boot loader");
208 printf("Version %s", version); 206 printf("Version %s", version);
209 207