diff options
Diffstat (limited to 'firmware/target')
-rw-r--r-- | firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c | 24 | ||||
-rw-r--r-- | firmware/target/arm/as3525/sansa-clipzip/lcd-target.h | 2 | ||||
-rw-r--r-- | firmware/target/arm/as3525/system-as3525.c | 6 |
3 files changed, 23 insertions, 9 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 | ||
diff --git a/firmware/target/arm/as3525/sansa-clipzip/lcd-target.h b/firmware/target/arm/as3525/sansa-clipzip/lcd-target.h index 137e9731dd..4adf07554e 100644 --- a/firmware/target/arm/as3525/sansa-clipzip/lcd-target.h +++ b/firmware/target/arm/as3525/sansa-clipzip/lcd-target.h | |||
@@ -23,5 +23,5 @@ | |||
23 | #include "config.h" | 23 | #include "config.h" |
24 | 24 | ||
25 | /* target-specific OLED brightness function */ | 25 | /* target-specific OLED brightness function */ |
26 | void lcd_brightness(uint8_t red, uint8_t green, uint8_t blue); | 26 | void oled_brightness(int brightness); |
27 | 27 | ||
diff --git a/firmware/target/arm/as3525/system-as3525.c b/firmware/target/arm/as3525/system-as3525.c index 348b4abcb2..a79b934aaa 100644 --- a/firmware/target/arm/as3525/system-as3525.c +++ b/firmware/target/arm/as3525/system-as3525.c | |||
@@ -285,7 +285,11 @@ void system_init(void) | |||
285 | ascodec_write_pmu(0x18, 1, 0x35); | 285 | ascodec_write_pmu(0x18, 1, 0x35); |
286 | /* AVDD17: set AVDD17 power supply to 2.5V */ | 286 | /* AVDD17: set AVDD17 power supply to 2.5V */ |
287 | ascodec_write_pmu(0x18, 7, 0x31); | 287 | ascodec_write_pmu(0x18, 7, 0x31); |
288 | #else | 288 | #ifdef SANSA_CLIPZIP |
289 | /* CVDD2: set CVDD2 power supply to 2.8V */ | ||
290 | ascodec_write_pmu(0x17, 2, 0xF4); | ||
291 | #endif | ||
292 | #else /* HAVE_AS3543 */ | ||
289 | ascodec_write(AS3514_CVDD_DCDC3, AS314_CP_DCDC3_SETTING); | 293 | ascodec_write(AS3514_CVDD_DCDC3, AS314_CP_DCDC3_SETTING); |
290 | #endif /* HAVE_AS3543 */ | 294 | #endif /* HAVE_AS3543 */ |
291 | 295 | ||