summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/target/arm/as3525/sansa-fuzev2/backlight-fuzev2.c14
-rw-r--r--firmware/target/arm/as3525/sd-as3525v2.c14
2 files changed, 7 insertions, 21 deletions
diff --git a/firmware/target/arm/as3525/sansa-fuzev2/backlight-fuzev2.c b/firmware/target/arm/as3525/sansa-fuzev2/backlight-fuzev2.c
index 617f7095f4..68c626d829 100644
--- a/firmware/target/arm/as3525/sansa-fuzev2/backlight-fuzev2.c
+++ b/firmware/target/arm/as3525/sansa-fuzev2/backlight-fuzev2.c
@@ -26,8 +26,6 @@
26#include "ascodec-target.h" 26#include "ascodec-target.h"
27#include "as3514.h" 27#include "as3514.h"
28 28
29int buttonlight_is_on = 0;
30
31void _backlight_set_brightness(int brightness) 29void _backlight_set_brightness(int brightness)
32{ 30{
33 ascodec_write_pmu(AS3543_BACKLIGHT, 2, brightness * 10); 31 ascodec_write_pmu(AS3543_BACKLIGHT, 2, brightness * 10);
@@ -39,8 +37,14 @@ bool _backlight_init(void)
39 ascodec_write_pmu(AS3543_BACKLIGHT, 2, backlight_brightness * 10); 37 ascodec_write_pmu(AS3543_BACKLIGHT, 2, backlight_brightness * 10);
40 38
41 /* needed for button light */ 39 /* needed for button light */
42 if (amsv2_variant == 1) 40 if (amsv2_variant == 0)
41 {
42 GPIOB_DIR |= 1<<5;
43 }
44 else
45 {
43 ascodec_write_pmu(0x1a, 1, 0x30); /* MUX_PWGD = PWM */ 46 ascodec_write_pmu(0x1a, 1, 0x30); /* MUX_PWGD = PWM */
47 }
44 48
45 return true; 49 return true;
46} 50}
@@ -65,9 +69,7 @@ void _buttonlight_on(void)
65{ 69{
66 if (amsv2_variant == 0) 70 if (amsv2_variant == 0)
67 { 71 {
68 GPIOB_DIR |= 1<<5;
69 GPIOB_PIN(5) = (1<<5); 72 GPIOB_PIN(5) = (1<<5);
70 buttonlight_is_on = 1;
71 } 73 }
72 else 74 else
73 { 75 {
@@ -80,8 +82,6 @@ void _buttonlight_off(void)
80 if (amsv2_variant == 0) 82 if (amsv2_variant == 0)
81 { 83 {
82 GPIOB_PIN(5) = 0; 84 GPIOB_PIN(5) = 0;
83 GPIOB_DIR &= ~(1<<5);
84 buttonlight_is_on = 0;
85 } 85 }
86 else 86 else
87 { 87 {
diff --git a/firmware/target/arm/as3525/sd-as3525v2.c b/firmware/target/arm/as3525/sd-as3525v2.c
index 73816e5537..022bd13b41 100644
--- a/firmware/target/arm/as3525/sd-as3525v2.c
+++ b/firmware/target/arm/as3525/sd-as3525v2.c
@@ -46,10 +46,6 @@
46#include "disk.h" 46#include "disk.h"
47#endif 47#endif
48 48
49#if defined(SANSA_FUZEV2)
50#include "backlight-target.h"
51#endif
52
53#include "lcd.h" 49#include "lcd.h"
54#include <stdarg.h> 50#include <stdarg.h>
55#include "sysfont.h" 51#include "sysfont.h"
@@ -432,16 +428,6 @@ static bool send_cmd(const int drive, const int cmd, const int arg, const int fl
432 /*b23 | CMD_CCS_EXPECTED unused */ 428 /*b23 | CMD_CCS_EXPECTED unused */
433 /*b31 */ | CMD_DONE_BIT; 429 /*b31 */ | CMD_DONE_BIT;
434 430
435#if defined(SANSA_FUZEV2)
436 if (amsv2_variant == 0)
437 {
438 extern int buttonlight_is_on;
439 if(buttonlight_is_on)
440 _buttonlight_on();
441 else
442 _buttonlight_off();
443 }
444#endif
445 semaphore_wait(&command_completion_signal, TIMEOUT_BLOCK); 431 semaphore_wait(&command_completion_signal, TIMEOUT_BLOCK);
446 432
447 /* Handle command responses & errors */ 433 /* Handle command responses & errors */