Sansa Clip+: detect AMSv2 variant (just like was already done for fuze v2), this makes SD transfers work for newer clip+ players ("COMBO4E" type). Variable fuzev2_variant has been renamed to amsv2_variant.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27520 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Bertrik Sikken 2010-07-22 13:47:09 +00:00
parent 1ebdb8988f
commit 4d6c816721
6 changed files with 25 additions and 25 deletions

View file

@ -268,14 +268,14 @@ bool __dbg_hw_info(void)
{
while(1)
{
#if defined(SANSA_C200V2) || defined(SANSA_FUZEV2)
#if defined(SANSA_C200V2) || defined(SANSA_FUZEV2) || defined(SANSA_CLIPPLUS)
lcd_clear_display();
line = 0;
lcd_puts(0, line++, "[Submodel:]");
#if defined(SANSA_C200V2)
lcd_putsf(0, line++, "C200v2 variant %d", c200v2_variant);
#elif defined(SANSA_FUZEV2)
lcd_putsf(0, line++, "Fuzev2 variant %d", fuzev2_variant);
#elif defined(SANSA_FUZEV2) || defined(SANSA_CLIPPLUS)
lcd_putsf(0, line++, "AMSv2 variant %d", amsv2_variant);
#endif
lcd_update();
int btn = button_get_w_tmo(HZ/10);

View file

@ -39,7 +39,7 @@ bool _backlight_init(void)
ascodec_write_pmu(AS3543_BACKLIGHT, 2, backlight_brightness * 10);
/* needed for button light */
if (fuzev2_variant == 1)
if (amsv2_variant == 1)
ascodec_write_pmu(0x1a, 1, 0x30); /* MUX_PWGD = PWM */
return true;
@ -63,7 +63,7 @@ void _backlight_off(void)
void _buttonlight_on(void)
{
if (fuzev2_variant == 0)
if (amsv2_variant == 0)
{
GPIOB_DIR |= 1<<5;
GPIOB_PIN(5) = (1<<5);
@ -77,7 +77,7 @@ void _buttonlight_on(void)
void _buttonlight_off(void)
{
if (fuzev2_variant == 0)
if (amsv2_variant == 0)
{
GPIOB_PIN(5) = 0;
GPIOB_DIR &= ~(1<<5);

View file

@ -257,7 +257,7 @@ int button_read_device(void)
btn |= BUTTON_RIGHT;
if (GPIOB_PIN(1) & 1<<1)
btn |= BUTTON_HOME;
if (fuzev2_variant == 1)
if (amsv2_variant == 1)
btn ^= BUTTON_HOME;
if (gpiod6 & 1<<6)

View file

@ -45,7 +45,7 @@
#include "disk.h"
#endif
#ifdef SANSA_FUZEV2
#if defined(SANSA_FUZEV2) || defined(SANSA_CLIPPLUS)
#include "backlight-target.h"
#endif
@ -403,8 +403,8 @@ static bool send_cmd(const int drive, const int cmd, const int arg, const int fl
MCI_ARGUMENT = arg;
#ifdef SANSA_FUZEV2
if (fuzev2_variant == 1)
#if defined(SANSA_FUZEV2) || defined(SANSA_CLIPPLUS)
if (amsv2_variant == 1)
card_no = 1 << 16;
else
#endif
@ -429,8 +429,8 @@ static bool send_cmd(const int drive, const int cmd, const int arg, const int fl
/*b23 | CMD_CCS_EXPECTED unused */
/*b31 */ | CMD_DONE_BIT;
#ifdef SANSA_FUZEV2
if (fuzev2_variant == 0)
#if defined(SANSA_FUZEV2)
if (amsv2_variant == 0)
{
extern int buttonlight_is_on;
if(buttonlight_is_on)
@ -594,8 +594,8 @@ static int sd_init_card(const int drive)
return -17;
/* Now that card is widebus make controller aware */
#ifdef SANSA_FUZEV2
if (fuzev2_variant == 1)
#if defined(SANSA_FUZEV2) || defined(SANSA_CLIPPLUS)
if (amsv2_variant == 1)
MCI_CTYPE |= 1<<1;
else
#endif
@ -604,8 +604,8 @@ static int sd_init_card(const int drive)
#endif /* ! BOOTLOADER */
/* Set low power mode */
#ifdef SANSA_FUZEV2
if (fuzev2_variant == 1)
#if defined(SANSA_FUZEV2) || defined(SANSA_CLIPPLUS)
if (amsv2_variant == 1)
MCI_CLKENA |= 1<<16;
else
#endif
@ -709,8 +709,8 @@ static void init_controller(void)
int card_mask = (1 << hcon_numcards) - 1;
int pwr_mask;
#ifdef SANSA_FUZEV2
if (fuzev2_variant == 1)
#if defined(SANSA_FUZEV2) || defined(SANSA_CLIPPLUS)
if (amsv2_variant == 1)
pwr_mask = 1 << 1;
else
#endif
@ -774,8 +774,8 @@ int sd_init(void)
wakeup_init(&transfer_completion_signal);
wakeup_init(&command_completion_signal);
#ifdef SANSA_FUZEV2
if (fuzev2_variant == 1)
#if defined(SANSA_FUZEV2) || defined(SANSA_CLIPPLUS)
if (amsv2_variant == 1)
GPIOB_DIR |= 1 << 5;
#endif

View file

@ -189,13 +189,13 @@ static void check_model_variant(void)
c200v2_variant = !GPIOA_PIN(7);
GPIOA_DIR = saved_dir;
}
#elif defined(SANSA_FUZEV2)
int fuzev2_variant;
#elif defined(SANSA_FUZEV2) || defined(SANSA_CLIPPLUS)
int amsv2_variant;
static void check_model_variant(void)
{
GPIOB_DIR &= ~(1<<5);
fuzev2_variant = !!GPIOB_PIN(5);
amsv2_variant = !!GPIOB_PIN(5);
}
#else
static inline void check_model_variant(void)

View file

@ -46,8 +46,8 @@
? (((uintptr_t)(a)) - IRAM_ORIG) \
: ((uintptr_t)(a))))
#ifdef SANSA_FUZEV2
extern int fuzev2_variant;
#if defined(SANSA_FUZEV2) || defined(SANSA_CLIPPLUS)
extern int amsv2_variant;
#endif
#ifdef SANSA_C200V2