diff options
Diffstat (limited to 'bootloader/telechips.c')
-rw-r--r-- | bootloader/telechips.c | 64 |
1 files changed, 6 insertions, 58 deletions
diff --git a/bootloader/telechips.c b/bootloader/telechips.c index 1e54f5d37d..8babbf3b62 100644 --- a/bootloader/telechips.c +++ b/bootloader/telechips.c | |||
@@ -57,19 +57,18 @@ extern int line; | |||
57 | #define MAX_LOAD_SIZE (8*1024*1024) /* Arbitrary, but plenty. */ | 57 | #define MAX_LOAD_SIZE (8*1024*1024) /* Arbitrary, but plenty. */ |
58 | 58 | ||
59 | /* The following function is just test/development code */ | 59 | /* The following function is just test/development code */ |
60 | #ifdef CPU_TCC77X | ||
61 | void show_debug_screen(void) | 60 | void show_debug_screen(void) |
62 | { | 61 | { |
63 | int button; | 62 | int button; |
64 | int power_count = 0; | 63 | int power_count = 0; |
65 | int count = 0; | 64 | int count = 0; |
66 | bool do_power_off = false; | 65 | bool do_power_off = false; |
67 | 66 | ||
68 | lcd_puts_scroll(0,0,"this is a very long line to test scrolling"); | 67 | lcd_puts_scroll(0,0,"+++ this is a very very long line to test scrolling. ---"); |
69 | while (!do_power_off) { | 68 | while (!do_power_off) { |
70 | line = 1; | 69 | line = 1; |
71 | button = button_get(false); | 70 | button = button_get(false); |
72 | 71 | ||
73 | /* Power-off if POWER button has been held for a time | 72 | /* Power-off if POWER button has been held for a time |
74 | This loop is currently running at about 100 iterations/second | 73 | This loop is currently running at about 100 iterations/second |
75 | */ | 74 | */ |
@@ -107,6 +106,7 @@ void show_debug_screen(void) | |||
107 | #endif | 106 | #endif |
108 | count++; | 107 | count++; |
109 | printf("Count: %d",count); | 108 | printf("Count: %d",count); |
109 | lcd_update(); | ||
110 | sleep(HZ/10); | 110 | sleep(HZ/10); |
111 | 111 | ||
112 | } | 112 | } |
@@ -122,57 +122,6 @@ void show_debug_screen(void) | |||
122 | while (true); | 122 | while (true); |
123 | } | 123 | } |
124 | 124 | ||
125 | #else /* !CPU_TCC77X */ | ||
126 | |||
127 | void show_debug_screen(void) | ||
128 | { | ||
129 | int button; | ||
130 | int power_count = 0; | ||
131 | int count = 0; | ||
132 | bool do_power_off = false; | ||
133 | #ifdef HAVE_BUTTON_DATA | ||
134 | unsigned int data; | ||
135 | #endif | ||
136 | |||
137 | while(!do_power_off) { | ||
138 | line = 0; | ||
139 | printf("Hello World!"); | ||
140 | |||
141 | #ifdef HAVE_BUTTON_DATA | ||
142 | button = button_read_device(&data); | ||
143 | #else | ||
144 | button = button_read_device(); | ||
145 | #endif | ||
146 | |||
147 | /* Power-off if POWER button has been held for a long time | ||
148 | This loop is currently running at about 100 iterations/second | ||
149 | */ | ||
150 | if (button & POWEROFF_BUTTON) { | ||
151 | power_count++; | ||
152 | if (power_count > 200) | ||
153 | do_power_off = true; | ||
154 | } else { | ||
155 | power_count = 0; | ||
156 | } | ||
157 | |||
158 | printf("Btn: 0x%08x",button); | ||
159 | |||
160 | count++; | ||
161 | printf("Count: %d",count); | ||
162 | } | ||
163 | |||
164 | lcd_clear_display(); | ||
165 | line = 0; | ||
166 | printf("POWER-OFF"); | ||
167 | |||
168 | /* Power-off */ | ||
169 | power_off(); | ||
170 | |||
171 | printf("(NOT) POWERED OFF"); | ||
172 | while (true); | ||
173 | } | ||
174 | #endif | ||
175 | |||
176 | void* main(void) | 125 | void* main(void) |
177 | { | 126 | { |
178 | #ifdef TCCBOOT | 127 | #ifdef TCCBOOT |
@@ -182,11 +131,10 @@ void* main(void) | |||
182 | 131 | ||
183 | system_init(); | 132 | system_init(); |
184 | power_init(); | 133 | power_init(); |
185 | #ifndef COWON_D2 | 134 | |
186 | /* The D2 doesn't enable threading or interrupts */ | ||
187 | kernel_init(); | 135 | kernel_init(); |
188 | enable_irq(); | 136 | enable_irq(); |
189 | #endif | 137 | |
190 | lcd_init(); | 138 | lcd_init(); |
191 | 139 | ||
192 | adc_init(); | 140 | adc_init(); |