diff options
Diffstat (limited to 'firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c')
-rw-r--r-- | firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c b/firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c index bfee2d253e..899eb538ea 100644 --- a/firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c +++ b/firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c | |||
@@ -336,18 +336,28 @@ static void lcd_setup_rect(int x, int x_end, int y, int y_end) | |||
336 | } | 336 | } |
337 | 337 | ||
338 | /* sets the brightness of the OLED */ | 338 | /* sets the brightness of the OLED */ |
339 | void lcd_brightness(uint8_t red, uint8_t green, uint8_t blue) | 339 | void oled_brightness(int brightness) |
340 | { | 340 | { |
341 | int r, g, b; | ||
342 | |||
341 | if (lcd_type == 0) { | 343 | if (lcd_type == 0) { |
342 | lcd_write(0x40, red); /* COLUMN_CURRENT_R */ | 344 | r = 2 + 16*brightness; |
343 | lcd_write(0x41, green); /* COLUMN_CURRENT_G */ | 345 | g = 1 + 10*brightness; |
344 | lcd_write(0x42, blue); /* COLUMN_CURRENT_B */ | 346 | b = 1 + (23*brightness)/2; |
347 | |||
348 | lcd_write(0x40, r); /* COLUMN_CURRENT_R */ | ||
349 | lcd_write(0x41, g); /* COLUMN_CURRENT_G */ | ||
350 | lcd_write(0x42, b); /* COLUMN_CURRENT_B */ | ||
345 | } | 351 | } |
346 | else { | 352 | else { |
353 | r = 6 + 10*brightness; | ||
354 | g = 1 + 6*brightness; | ||
355 | b = 3 + 10*brightness; | ||
356 | |||
347 | lcd_write_cmd(0x0E); | 357 | lcd_write_cmd(0x0E); |
348 | lcd_write_nibbles(red); | 358 | lcd_write_nibbles(r); |
349 | lcd_write_nibbles(green); | 359 | lcd_write_nibbles(g); |
350 | lcd_write_nibbles(blue); | 360 | lcd_write_nibbles(b); |
351 | } | 361 | } |
352 | } | 362 | } |
353 | 363 | ||