summaryrefslogtreecommitdiff
path: root/firmware/target/arm/as3525/sansa-clip/lcd-ssd1303.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/as3525/sansa-clip/lcd-ssd1303.c')
-rw-r--r--firmware/target/arm/as3525/sansa-clip/lcd-ssd1303.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/firmware/target/arm/as3525/sansa-clip/lcd-ssd1303.c b/firmware/target/arm/as3525/sansa-clip/lcd-ssd1303.c
index ed4bcc7be9..a794589647 100644
--- a/firmware/target/arm/as3525/sansa-clip/lcd-ssd1303.c
+++ b/firmware/target/arm/as3525/sansa-clip/lcd-ssd1303.c
@@ -149,6 +149,9 @@ void lcd_set_flip(bool yesno)
149 149
150void lcd_enable(bool enable) 150void lcd_enable(bool enable)
151{ 151{
152 if(display_on == enable)
153 return;
154
152 if( (display_on = enable) ) /* simple '=' is not a typo ! */ 155 if( (display_on = enable) ) /* simple '=' is not a typo ! */
153 lcd_write_command(LCD_SET_DISPLAY_ON); 156 lcd_write_command(LCD_SET_DISPLAY_ON);
154 else 157 else
@@ -240,6 +243,9 @@ void lcd_init_device(void)
240void lcd_blit_mono(const unsigned char *data, int x, int by, int width, 243void lcd_blit_mono(const unsigned char *data, int x, int by, int width,
241 int bheight, int stride) 244 int bheight, int stride)
242{ 245{
246 if(!display_on)
247 return;
248
243 /* Copy display bitmap to hardware */ 249 /* Copy display bitmap to hardware */
244 while (bheight--) 250 while (bheight--)
245 { 251 {
@@ -258,6 +264,13 @@ void lcd_blit_mono(const unsigned char *data, int x, int by, int width,
258void lcd_blit_grey_phase(unsigned char *values, unsigned char *phases, 264void lcd_blit_grey_phase(unsigned char *values, unsigned char *phases,
259 int x, int by, int width, int bheight, int stride) 265 int x, int by, int width, int bheight, int stride)
260{ 266{
267 /* TODO */
268
269#if 0
270 if(!display_on)
271 return;
272#endif
273
261 (void)values; 274 (void)values;
262 (void)phases; 275 (void)phases;
263 (void)x; 276 (void)x;
@@ -274,6 +287,9 @@ void lcd_update(void)
274{ 287{
275 int y; 288 int y;
276 289
290 if(!display_on)
291 return;
292
277 /* Copy display bitmap to hardware */ 293 /* Copy display bitmap to hardware */
278 for (y = 0; y < LCD_FBHEIGHT; y++) 294 for (y = 0; y < LCD_FBHEIGHT; y++)
279 { 295 {
@@ -291,6 +307,9 @@ void lcd_update_rect(int x, int y, int width, int height)
291{ 307{
292 int ymax; 308 int ymax;
293 309
310 if(!display_on)
311 return;
312
294 /* The Y coordinates have to work on even 8 pixel rows */ 313 /* The Y coordinates have to work on even 8 pixel rows */
295 ymax = (y + height-1) >> 3; 314 ymax = (y + height-1) >> 3;
296 y >>= 3; 315 y >>= 3;