mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-08 12:45:26 -05:00
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
This commit is contained in:
parent
6a3779b543
commit
30255d53da
2 changed files with 26 additions and 21 deletions
|
|
@ -36,6 +36,10 @@
|
||||||
static bool display_on = false; /* is the display turned on? */
|
static bool display_on = false; /* is the display turned on? */
|
||||||
static bool display_flipped = false;
|
static bool display_flipped = false;
|
||||||
static int y_offset = 0; /* needed for flip */
|
static int y_offset = 0; /* needed for flip */
|
||||||
|
/* we need to write a red pixel for correct button reads
|
||||||
|
* (see lcd_button_support()), but that must not happen while the lcd is updating
|
||||||
|
* so block lcd_button_support the during updates */
|
||||||
|
static volatile bool lcd_busy = false;
|
||||||
|
|
||||||
/* register defines */
|
/* register defines */
|
||||||
#define R_START_OSC 0x00
|
#define R_START_OSC 0x00
|
||||||
|
|
@ -365,12 +369,10 @@ void lcd_update(void)
|
||||||
{
|
{
|
||||||
if (!display_on)
|
if (!display_on)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* we must disable interrupts because buttondriver also writes to lcd */
|
|
||||||
disable_irq();
|
|
||||||
|
|
||||||
lcd_write_reg(R_ENTRY_MODE, R_ENTRY_MODE_HORZ);
|
lcd_write_reg(R_ENTRY_MODE, R_ENTRY_MODE_HORZ);
|
||||||
|
|
||||||
|
lcd_busy = true;
|
||||||
/* Set start position and window */
|
/* Set start position and window */
|
||||||
lcd_write_reg(R_HORIZ_RAM_ADDR_POS, (LCD_WIDTH-1) << 8);
|
lcd_write_reg(R_HORIZ_RAM_ADDR_POS, (LCD_WIDTH-1) << 8);
|
||||||
lcd_write_reg(R_VERT_RAM_ADDR_POS,
|
lcd_write_reg(R_VERT_RAM_ADDR_POS,
|
||||||
|
|
@ -381,7 +383,7 @@ void lcd_update(void)
|
||||||
|
|
||||||
lcd_write_data((unsigned short *)lcd_framebuffer, LCD_WIDTH*LCD_HEIGHT);
|
lcd_write_data((unsigned short *)lcd_framebuffer, LCD_WIDTH*LCD_HEIGHT);
|
||||||
|
|
||||||
enable_irq();
|
lcd_busy = false;
|
||||||
} /* lcd_update */
|
} /* lcd_update */
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -393,7 +395,7 @@ void lcd_update_rect(int x, int y, int width, int height)
|
||||||
|
|
||||||
if (!display_on)
|
if (!display_on)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (x + width > LCD_WIDTH)
|
if (x + width > LCD_WIDTH)
|
||||||
width = LCD_WIDTH - x; /* Clip right */
|
width = LCD_WIDTH - x; /* Clip right */
|
||||||
if (x < 0)
|
if (x < 0)
|
||||||
|
|
@ -409,10 +411,8 @@ void lcd_update_rect(int x, int y, int width, int height)
|
||||||
if (y >= ymax)
|
if (y >= ymax)
|
||||||
return; /* nothing left to do */
|
return; /* nothing left to do */
|
||||||
|
|
||||||
/* we must disable interrupts because buttondriver also writes to lcd */
|
|
||||||
disable_irq();
|
|
||||||
|
|
||||||
lcd_write_reg(R_ENTRY_MODE, R_ENTRY_MODE_HORZ);
|
lcd_write_reg(R_ENTRY_MODE, R_ENTRY_MODE_HORZ);
|
||||||
|
lcd_busy = true;
|
||||||
/* Set start position and window */
|
/* Set start position and window */
|
||||||
lcd_write_reg(R_HORIZ_RAM_ADDR_POS,
|
lcd_write_reg(R_HORIZ_RAM_ADDR_POS,
|
||||||
((x + width-1) << 8) | x);
|
((x + width-1) << 8) | x);
|
||||||
|
|
@ -430,8 +430,8 @@ void lcd_update_rect(int x, int y, int width, int height)
|
||||||
ptr += LCD_WIDTH;
|
ptr += LCD_WIDTH;
|
||||||
}
|
}
|
||||||
while (++y < ymax);
|
while (++y < ymax);
|
||||||
|
|
||||||
enable_irq();
|
lcd_busy = false;
|
||||||
} /* lcd_update_rect */
|
} /* lcd_update_rect */
|
||||||
|
|
||||||
/* writes one read pixel outside the visible area, needed for correct dbop reads */
|
/* writes one read pixel outside the visible area, needed for correct dbop reads */
|
||||||
|
|
@ -440,9 +440,12 @@ void lcd_button_support(void)
|
||||||
int x=LCD_HEIGHT+1;
|
int x=LCD_HEIGHT+1;
|
||||||
int y=LCD_WIDTH+1;
|
int y=LCD_WIDTH+1;
|
||||||
int width=1;
|
int width=1;
|
||||||
int height=1;
|
int height=1;
|
||||||
unsigned short data = (0xf<<12);
|
unsigned short data = (0xf<<12);
|
||||||
|
|
||||||
|
if (lcd_busy)
|
||||||
|
return;
|
||||||
|
|
||||||
lcd_write_reg(R_ENTRY_MODE, R_ENTRY_MODE_HORZ);
|
lcd_write_reg(R_ENTRY_MODE, R_ENTRY_MODE_HORZ);
|
||||||
/* Set start position and window */
|
/* Set start position and window */
|
||||||
lcd_write_reg(R_HORIZ_RAM_ADDR_POS,
|
lcd_write_reg(R_HORIZ_RAM_ADDR_POS,
|
||||||
|
|
|
||||||
|
|
@ -41,8 +41,10 @@
|
||||||
static bool display_on = false; /* is the display turned on? */
|
static bool display_on = false; /* is the display turned on? */
|
||||||
static bool display_flipped = false;
|
static bool display_flipped = false;
|
||||||
static int xoffset = 20; /* needed for flip */
|
static int xoffset = 20; /* needed for flip */
|
||||||
|
/* we need to write a red pixel for correct button reads
|
||||||
static volatile int _ystart, _ymax, _xstart, _xmax;
|
* (see lcd_button_support()), but that must not happen while the lcd is updating
|
||||||
|
* so block lcd_button_support the during updates */
|
||||||
|
static volatile bool lcd_busy = false;
|
||||||
|
|
||||||
static void as3525_dbop_init(void)
|
static void as3525_dbop_init(void)
|
||||||
{
|
{
|
||||||
|
|
@ -285,8 +287,7 @@ void lcd_update(void)
|
||||||
|
|
||||||
lcd_write_reg(R_ENTRY_MODE, R_ENTRY_MODE_HORZ);
|
lcd_write_reg(R_ENTRY_MODE, R_ENTRY_MODE_HORZ);
|
||||||
|
|
||||||
/* we must disable interrupts because buttondriver also writes to lcd */
|
lcd_busy = true;
|
||||||
disable_irq();
|
|
||||||
lcd_window_x(0, LCD_WIDTH - 1);
|
lcd_window_x(0, LCD_WIDTH - 1);
|
||||||
lcd_window_y(0, LCD_HEIGHT - 1);
|
lcd_window_y(0, LCD_HEIGHT - 1);
|
||||||
|
|
||||||
|
|
@ -295,7 +296,7 @@ void lcd_update(void)
|
||||||
|
|
||||||
/* Write data */
|
/* Write data */
|
||||||
lcd_write_data((unsigned short *)lcd_framebuffer, LCD_WIDTH*LCD_HEIGHT);
|
lcd_write_data((unsigned short *)lcd_framebuffer, LCD_WIDTH*LCD_HEIGHT);
|
||||||
enable_irq();
|
lcd_busy = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Update a fraction of the display. */
|
/* Update a fraction of the display. */
|
||||||
|
|
@ -327,8 +328,7 @@ void lcd_update_rect(int x, int y, int width, int height)
|
||||||
|
|
||||||
lcd_write_reg(R_ENTRY_MODE, R_ENTRY_MODE_HORZ);
|
lcd_write_reg(R_ENTRY_MODE, R_ENTRY_MODE_HORZ);
|
||||||
|
|
||||||
/* we must disable interrupts because buttondriver also writes to lcd */
|
lcd_busy = true;
|
||||||
disable_irq();
|
|
||||||
lcd_window_x(x, xmax);
|
lcd_window_x(x, xmax);
|
||||||
lcd_window_y(y, ymax);
|
lcd_window_y(y, ymax);
|
||||||
|
|
||||||
|
|
@ -343,13 +343,15 @@ void lcd_update_rect(int x, int y, int width, int height)
|
||||||
ptr += LCD_WIDTH;
|
ptr += LCD_WIDTH;
|
||||||
}
|
}
|
||||||
while (++y <= ymax);
|
while (++y <= ymax);
|
||||||
enable_irq();
|
lcd_busy = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* writes one read pixel outside the visible area, needed for correct dbop reads */
|
/* writes one read pixel outside the visible area, needed for correct dbop reads */
|
||||||
void lcd_button_support(void)
|
void lcd_button_support(void)
|
||||||
{
|
{
|
||||||
fb_data data = 0xf<<12;
|
fb_data data = 0xf<<12;
|
||||||
|
if (lcd_busy)
|
||||||
|
return;
|
||||||
lcd_write_reg(R_ENTRY_MODE, R_ENTRY_MODE_HORZ);
|
lcd_write_reg(R_ENTRY_MODE, R_ENTRY_MODE_HORZ);
|
||||||
/* Set start position and window */
|
/* Set start position and window */
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue