diff options
author | Thomas Martitz <kugel@rockbox.org> | 2009-02-18 16:38:16 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2009-02-18 16:38:16 +0000 |
commit | 30255d53daf8184a33631893b0bf214f8973c329 (patch) | |
tree | 01024ee7d1cc1a381a9a4cebcc995f343987d990 /firmware/target/arm/as3525/sansa-fuze | |
parent | 6a3779b5431cccbd1af822e7362c7955ee90d4d7 (diff) | |
download | rockbox-30255d53daf8184a33631893b0bf214f8973c329.tar.gz rockbox-30255d53daf8184a33631893b0bf214f8973c329.zip |
Get rid of disabling irq. Simply blocking does it too, it also caused problems (particulary with scrolling lines).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20040 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 | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/firmware/target/arm/as3525/sansa-fuze/lcd-fuze.c b/firmware/target/arm/as3525/sansa-fuze/lcd-fuze.c index f9de3c3117..7443426c25 100644 --- a/firmware/target/arm/as3525/sansa-fuze/lcd-fuze.c +++ b/firmware/target/arm/as3525/sansa-fuze/lcd-fuze.c | |||
@@ -41,8 +41,10 @@ | |||
41 | static bool display_on = false; /* is the display turned on? */ | 41 | static bool display_on = false; /* is the display turned on? */ |
42 | static bool display_flipped = false; | 42 | static bool display_flipped = false; |
43 | static int xoffset = 20; /* needed for flip */ | 43 | static int xoffset = 20; /* needed for flip */ |
44 | 44 | /* we need to write a red pixel for correct button reads | |
45 | static volatile int _ystart, _ymax, _xstart, _xmax; | 45 | * (see lcd_button_support()), but that must not happen while the lcd is updating |
46 | * so block lcd_button_support the during updates */ | ||
47 | static volatile bool lcd_busy = false; | ||
46 | 48 | ||
47 | static void as3525_dbop_init(void) | 49 | static void as3525_dbop_init(void) |
48 | { | 50 | { |
@@ -285,8 +287,7 @@ void lcd_update(void) | |||
285 | 287 | ||
286 | lcd_write_reg(R_ENTRY_MODE, R_ENTRY_MODE_HORZ); | 288 | lcd_write_reg(R_ENTRY_MODE, R_ENTRY_MODE_HORZ); |
287 | 289 | ||
288 | /* we must disable interrupts because buttondriver also writes to lcd */ | 290 | lcd_busy = true; |
289 | disable_irq(); | ||
290 | lcd_window_x(0, LCD_WIDTH - 1); | 291 | lcd_window_x(0, LCD_WIDTH - 1); |
291 | lcd_window_y(0, LCD_HEIGHT - 1); | 292 | lcd_window_y(0, LCD_HEIGHT - 1); |
292 | 293 | ||
@@ -295,7 +296,7 @@ void lcd_update(void) | |||
295 | 296 | ||
296 | /* Write data */ | 297 | /* Write data */ |
297 | lcd_write_data((unsigned short *)lcd_framebuffer, LCD_WIDTH*LCD_HEIGHT); | 298 | lcd_write_data((unsigned short *)lcd_framebuffer, LCD_WIDTH*LCD_HEIGHT); |
298 | enable_irq(); | 299 | lcd_busy = false; |
299 | } | 300 | } |
300 | 301 | ||
301 | /* Update a fraction of the display. */ | 302 | /* Update a fraction of the display. */ |
@@ -327,8 +328,7 @@ void lcd_update_rect(int x, int y, int width, int height) | |||
327 | 328 | ||
328 | lcd_write_reg(R_ENTRY_MODE, R_ENTRY_MODE_HORZ); | 329 | lcd_write_reg(R_ENTRY_MODE, R_ENTRY_MODE_HORZ); |
329 | 330 | ||
330 | /* we must disable interrupts because buttondriver also writes to lcd */ | 331 | lcd_busy = true; |
331 | disable_irq(); | ||
332 | lcd_window_x(x, xmax); | 332 | lcd_window_x(x, xmax); |
333 | lcd_window_y(y, ymax); | 333 | lcd_window_y(y, ymax); |
334 | 334 | ||
@@ -343,13 +343,15 @@ void lcd_update_rect(int x, int y, int width, int height) | |||
343 | ptr += LCD_WIDTH; | 343 | ptr += LCD_WIDTH; |
344 | } | 344 | } |
345 | while (++y <= ymax); | 345 | while (++y <= ymax); |
346 | enable_irq(); | 346 | lcd_busy = false; |
347 | } | 347 | } |
348 | 348 | ||
349 | /* writes one read pixel outside the visible area, needed for correct dbop reads */ | 349 | /* writes one read pixel outside the visible area, needed for correct dbop reads */ |
350 | void lcd_button_support(void) | 350 | void lcd_button_support(void) |
351 | { | 351 | { |
352 | fb_data data = 0xf<<12; | 352 | fb_data data = 0xf<<12; |
353 | if (lcd_busy) | ||
354 | return; | ||
353 | lcd_write_reg(R_ENTRY_MODE, R_ENTRY_MODE_HORZ); | 355 | lcd_write_reg(R_ENTRY_MODE, R_ENTRY_MODE_HORZ); |
354 | /* Set start position and window */ | 356 | /* Set start position and window */ |
355 | 357 | ||