mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-08 12:45:26 -05:00
AMSv2: fix dependency between button light and sd card control for fuze v2 variant 0
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29667 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
a7354e7925
commit
eab630a1e1
2 changed files with 7 additions and 21 deletions
|
|
@ -26,8 +26,6 @@
|
||||||
#include "ascodec-target.h"
|
#include "ascodec-target.h"
|
||||||
#include "as3514.h"
|
#include "as3514.h"
|
||||||
|
|
||||||
int buttonlight_is_on = 0;
|
|
||||||
|
|
||||||
void _backlight_set_brightness(int brightness)
|
void _backlight_set_brightness(int brightness)
|
||||||
{
|
{
|
||||||
ascodec_write_pmu(AS3543_BACKLIGHT, 2, brightness * 10);
|
ascodec_write_pmu(AS3543_BACKLIGHT, 2, brightness * 10);
|
||||||
|
|
@ -39,8 +37,14 @@ bool _backlight_init(void)
|
||||||
ascodec_write_pmu(AS3543_BACKLIGHT, 2, backlight_brightness * 10);
|
ascodec_write_pmu(AS3543_BACKLIGHT, 2, backlight_brightness * 10);
|
||||||
|
|
||||||
/* needed for button light */
|
/* needed for button light */
|
||||||
if (amsv2_variant == 1)
|
if (amsv2_variant == 0)
|
||||||
|
{
|
||||||
|
GPIOB_DIR |= 1<<5;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
ascodec_write_pmu(0x1a, 1, 0x30); /* MUX_PWGD = PWM */
|
ascodec_write_pmu(0x1a, 1, 0x30); /* MUX_PWGD = PWM */
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -65,9 +69,7 @@ void _buttonlight_on(void)
|
||||||
{
|
{
|
||||||
if (amsv2_variant == 0)
|
if (amsv2_variant == 0)
|
||||||
{
|
{
|
||||||
GPIOB_DIR |= 1<<5;
|
|
||||||
GPIOB_PIN(5) = (1<<5);
|
GPIOB_PIN(5) = (1<<5);
|
||||||
buttonlight_is_on = 1;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -80,8 +82,6 @@ void _buttonlight_off(void)
|
||||||
if (amsv2_variant == 0)
|
if (amsv2_variant == 0)
|
||||||
{
|
{
|
||||||
GPIOB_PIN(5) = 0;
|
GPIOB_PIN(5) = 0;
|
||||||
GPIOB_DIR &= ~(1<<5);
|
|
||||||
buttonlight_is_on = 0;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -46,10 +46,6 @@
|
||||||
#include "disk.h"
|
#include "disk.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(SANSA_FUZEV2)
|
|
||||||
#include "backlight-target.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "lcd.h"
|
#include "lcd.h"
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include "sysfont.h"
|
#include "sysfont.h"
|
||||||
|
|
@ -432,16 +428,6 @@ static bool send_cmd(const int drive, const int cmd, const int arg, const int fl
|
||||||
/*b23 | CMD_CCS_EXPECTED unused */
|
/*b23 | CMD_CCS_EXPECTED unused */
|
||||||
/*b31 */ | CMD_DONE_BIT;
|
/*b31 */ | CMD_DONE_BIT;
|
||||||
|
|
||||||
#if defined(SANSA_FUZEV2)
|
|
||||||
if (amsv2_variant == 0)
|
|
||||||
{
|
|
||||||
extern int buttonlight_is_on;
|
|
||||||
if(buttonlight_is_on)
|
|
||||||
_buttonlight_on();
|
|
||||||
else
|
|
||||||
_buttonlight_off();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
semaphore_wait(&command_completion_signal, TIMEOUT_BLOCK);
|
semaphore_wait(&command_completion_signal, TIMEOUT_BLOCK);
|
||||||
|
|
||||||
/* Handle command responses & errors */
|
/* Handle command responses & errors */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue