diff options
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/target/arm/lcd-c200_c200v2.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/firmware/target/arm/lcd-c200_c200v2.c b/firmware/target/arm/lcd-c200_c200v2.c index 062ed08d62..5393352fd1 100644 --- a/firmware/target/arm/lcd-c200_c200v2.c +++ b/firmware/target/arm/lcd-c200_c200v2.c | |||
@@ -182,14 +182,9 @@ static inline void as3525_dbop_init(void) | |||
182 | 182 | ||
183 | #endif | 183 | #endif |
184 | 184 | ||
185 | /* LCD init */ | 185 | static void lcd_reset(void) |
186 | void lcd_init_device(void) | ||
187 | { | 186 | { |
188 | #if defined(SANSA_C200) | 187 | #if defined(SANSA_C200V2) |
189 | c200v1_lcd_init(); | ||
190 | #elif defined(SANSA_C200V2) | ||
191 | as3525_dbop_init(); | ||
192 | |||
193 | /* reset lcd */ | 188 | /* reset lcd */ |
194 | GPIOB_DIR |= (1<<6); | 189 | GPIOB_DIR |= (1<<6); |
195 | GPIOB_PIN(6) = 0; /* pull reset low */ | 190 | GPIOB_PIN(6) = 0; /* pull reset low */ |
@@ -197,7 +192,6 @@ void lcd_init_device(void) | |||
197 | GPIOB_PIN(6) = 1<<6; /* release reset */ | 192 | GPIOB_PIN(6) = 1<<6; /* release reset */ |
198 | lcd_delay(20); | 193 | lcd_delay(20); |
199 | #endif | 194 | #endif |
200 | |||
201 | lcd_send_command(R_STANDBY_OFF, 0); | 195 | lcd_send_command(R_STANDBY_OFF, 0); |
202 | lcd_delay(20); | 196 | lcd_delay(20); |
203 | 197 | ||
@@ -249,6 +243,17 @@ void lcd_init_device(void) | |||
249 | lcd_send_command(R_DISPLAY_ON, 0); | 243 | lcd_send_command(R_DISPLAY_ON, 0); |
250 | } | 244 | } |
251 | 245 | ||
246 | /* LCD init */ | ||
247 | void lcd_init_device(void) | ||
248 | { | ||
249 | #if defined(SANSA_C200) | ||
250 | c200v1_lcd_init(); | ||
251 | #elif defined(SANSA_C200V2) | ||
252 | as3525_dbop_init(); | ||
253 | #endif | ||
254 | lcd_reset(); | ||
255 | } | ||
256 | |||
252 | /*** hardware configuration ***/ | 257 | /*** hardware configuration ***/ |
253 | int lcd_default_contrast(void) | 258 | int lcd_default_contrast(void) |
254 | { | 259 | { |
@@ -277,8 +282,13 @@ void lcd_enable(bool yesno) | |||
277 | 282 | ||
278 | if ((is_lcd_enabled = yesno)) | 283 | if ((is_lcd_enabled = yesno)) |
279 | { | 284 | { |
285 | #ifdef SANSA_C200V2 | ||
286 | /* lcd sometimes gets stuck, do full init here */ | ||
287 | lcd_reset(); | ||
288 | #else | ||
280 | lcd_send_command(R_STANDBY_OFF, 0); | 289 | lcd_send_command(R_STANDBY_OFF, 0); |
281 | lcd_send_command(R_DISPLAY_ON, 0); | 290 | lcd_send_command(R_DISPLAY_ON, 0); |
291 | #endif | ||
282 | send_event(LCD_EVENT_ACTIVATION, NULL); | 292 | send_event(LCD_EVENT_ACTIVATION, NULL); |
283 | } | 293 | } |
284 | else | 294 | else |