diff options
author | Rafaël Carré <rafael.carre@gmail.com> | 2010-01-06 23:41:36 +0000 |
---|---|---|
committer | Rafaël Carré <rafael.carre@gmail.com> | 2010-01-06 23:41:36 +0000 |
commit | 57667c51cf09de052222484ce94fbd6da113a55c (patch) | |
tree | b85872be9b6c204e7d66a9203a64d78c524a38a5 /firmware/target/arm/as3525/sansa-fuze | |
parent | 8e8e2627b27b28a855881db09f2c16bfb2193050 (diff) | |
download | rockbox-57667c51cf09de052222484ce94fbd6da113a55c.tar.gz rockbox-57667c51cf09de052222484ce94fbd6da113a55c.zip |
Sansa AMS: refactor DBOP button reading (e200v2/Fuze/c200v2)
This gets rid of LCD glitches on Sansa Fuze, and now LCD transfers can
get interrupted by button reading
Flyspray: FS #10603
Author: Bertrik Sikken
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24192 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/as3525/sansa-fuze')
-rw-r--r-- | firmware/target/arm/as3525/sansa-fuze/lcd-fuze.c | 34 |
1 files changed, 1 insertions, 33 deletions
diff --git a/firmware/target/arm/as3525/sansa-fuze/lcd-fuze.c b/firmware/target/arm/as3525/sansa-fuze/lcd-fuze.c index d10396cfd4..f9d5e5ace1 100644 --- a/firmware/target/arm/as3525/sansa-fuze/lcd-fuze.c +++ b/firmware/target/arm/as3525/sansa-fuze/lcd-fuze.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include "debug.h" | 28 | #include "debug.h" |
29 | #include "system.h" | 29 | #include "system.h" |
30 | #include "clock-target.h" | 30 | #include "clock-target.h" |
31 | #include "dbop-as3525.h" | ||
31 | 32 | ||
32 | /* The controller is unknown, but some registers appear to be the same as the | 33 | /* The controller is unknown, but some registers appear to be the same as the |
33 | HD66789R */ | 34 | HD66789R */ |
@@ -92,7 +93,6 @@ static unsigned short r_entry_mode = R_ENTRY_MODE_HORZ_NORMAL; | |||
92 | static unsigned short r_disp_control_rev = R_DISP_CONTROL_NORMAL; | 93 | static unsigned short r_disp_control_rev = R_DISP_CONTROL_NORMAL; |
93 | 94 | ||
94 | static const int xoffset = 20; | 95 | static const int xoffset = 20; |
95 | static volatile bool lcd_busy = false; | ||
96 | 96 | ||
97 | static inline void lcd_delay(int x) | 97 | static inline void lcd_delay(int x) |
98 | { | 98 | { |
@@ -379,8 +379,6 @@ void lcd_blit_yuv(unsigned char * const src[3], | |||
379 | yuv_src[1] = src[1] + (z >> 2) + (src_x >> 1); | 379 | yuv_src[1] = src[1] + (z >> 2) + (src_x >> 1); |
380 | yuv_src[2] = src[2] + (yuv_src[1] - src[1]); | 380 | yuv_src[2] = src[2] + (yuv_src[1] - src[1]); |
381 | 381 | ||
382 | lcd_busy = true; | ||
383 | |||
384 | #ifdef HAVE_LCD_FLIP | 382 | #ifdef HAVE_LCD_FLIP |
385 | lcd_write_reg(R_ENTRY_MODE, | 383 | lcd_write_reg(R_ENTRY_MODE, |
386 | display_flipped ? R_ENTRY_MODE_VIDEO_FLIPPED : R_ENTRY_MODE_VIDEO_NORMAL | 384 | display_flipped ? R_ENTRY_MODE_VIDEO_FLIPPED : R_ENTRY_MODE_VIDEO_NORMAL |
@@ -423,8 +421,6 @@ void lcd_blit_yuv(unsigned char * const src[3], | |||
423 | } | 421 | } |
424 | while (--height > 0); | 422 | while (--height > 0); |
425 | } | 423 | } |
426 | |||
427 | lcd_busy = false; | ||
428 | } | 424 | } |
429 | 425 | ||
430 | /* Update the display. | 426 | /* Update the display. |
@@ -434,8 +430,6 @@ void lcd_update(void) | |||
434 | if (!display_on) | 430 | if (!display_on) |
435 | return; | 431 | return; |
436 | 432 | ||
437 | lcd_busy = true; | ||
438 | |||
439 | lcd_write_reg(R_ENTRY_MODE, r_entry_mode); | 433 | lcd_write_reg(R_ENTRY_MODE, r_entry_mode); |
440 | 434 | ||
441 | lcd_window_x(0, LCD_WIDTH - 1); | 435 | lcd_window_x(0, LCD_WIDTH - 1); |
@@ -444,8 +438,6 @@ void lcd_update(void) | |||
444 | lcd_write_cmd(R_WRITE_DATA_2_GRAM); | 438 | lcd_write_cmd(R_WRITE_DATA_2_GRAM); |
445 | 439 | ||
446 | lcd_write_data((fb_data*)lcd_framebuffer, LCD_WIDTH*LCD_HEIGHT); | 440 | lcd_write_data((fb_data*)lcd_framebuffer, LCD_WIDTH*LCD_HEIGHT); |
447 | |||
448 | lcd_busy = false; | ||
449 | } | 441 | } |
450 | 442 | ||
451 | /* Update a fraction of the display. */ | 443 | /* Update a fraction of the display. */ |
@@ -475,8 +467,6 @@ void lcd_update_rect(int x, int y, int width, int height) | |||
475 | if (y >= ymax) | 467 | if (y >= ymax) |
476 | return; /* nothing left to do */ | 468 | return; /* nothing left to do */ |
477 | 469 | ||
478 | lcd_busy = true; | ||
479 | |||
480 | lcd_write_reg(R_ENTRY_MODE, r_entry_mode); | 470 | lcd_write_reg(R_ENTRY_MODE, r_entry_mode); |
481 | 471 | ||
482 | lcd_window_x(x, xmax); | 472 | lcd_window_x(x, xmax); |
@@ -493,26 +483,4 @@ void lcd_update_rect(int x, int y, int width, int height) | |||
493 | ptr += LCD_WIDTH; | 483 | ptr += LCD_WIDTH; |
494 | } | 484 | } |
495 | while (--height >= 0); | 485 | while (--height >= 0); |
496 | |||
497 | lcd_busy = false; | ||
498 | } | ||
499 | |||
500 | /* writes one red pixel outside the visible area, needed for correct | ||
501 | * dbop reads */ | ||
502 | bool lcd_button_support(void) | ||
503 | { | ||
504 | if (lcd_busy) | ||
505 | return false; | ||
506 | |||
507 | lcd_write_reg(R_ENTRY_MODE, r_entry_mode); | ||
508 | |||
509 | /* Set start position and window */ | ||
510 | lcd_window_x(-1, 0); | ||
511 | lcd_window_y(-1, 0); | ||
512 | |||
513 | lcd_write_cmd(R_WRITE_DATA_2_GRAM); | ||
514 | |||
515 | lcd_write_value16(0xf<<12); | ||
516 | |||
517 | return true; | ||
518 | } | 486 | } |