Iriver: Properly working remote type detection regardless of hold switch positions.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9079 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
cb9e316d4d
commit
13c63de2c1
|
@ -456,16 +456,21 @@ static void remote_tick(void)
|
|||
level = set_irq_level(HIGHEST_IRQ_LEVEL);
|
||||
val = adc_scan(ADC_REMOTEDETECT);
|
||||
set_irq_level(level);
|
||||
|
||||
if(val < (ADCVAL_H100_LCD_REMOTE + 8))
|
||||
if(val < (ADCVAL_H300_LCD_REMOTE + 8))
|
||||
_remote_type = REMOTETYPE_H300_LCD;
|
||||
if (val < ADCVAL_H300_LCD_REMOTE_HOLD)
|
||||
if (val < ADCVAL_H300_LCD_REMOTE)
|
||||
_remote_type = REMOTETYPE_H300_LCD; /* hold off */
|
||||
else
|
||||
_remote_type = REMOTETYPE_H100_LCD;
|
||||
if (val < ADCVAL_H100_LCD_REMOTE)
|
||||
_remote_type = REMOTETYPE_H100_LCD; /* hold off */
|
||||
else
|
||||
_remote_type = REMOTETYPE_H300_LCD; /* hold on */
|
||||
else
|
||||
_remote_type = REMOTETYPE_H300_NONLCD;
|
||||
|
||||
init_remote = true;
|
||||
if (val < ADCVAL_H100_LCD_REMOTE_HOLD)
|
||||
_remote_type = REMOTETYPE_H100_LCD; /* hold on, or no remote */
|
||||
else
|
||||
_remote_type = REMOTETYPE_H300_NONLCD; /* hold doesn't matter */
|
||||
|
||||
init_remote = true;
|
||||
/* request init in scroll_thread */
|
||||
}
|
||||
else
|
||||
|
|
|
@ -44,6 +44,19 @@
|
|||
#define ADC_REMOTEDETECT 3
|
||||
#define ADC_UNREG_POWER ADC_BATTERY /* For compatibility */
|
||||
|
||||
/* ADC values for different remote control types */
|
||||
#ifdef IRIVER_H100_SERIES
|
||||
#define ADCVAL_H300_LCD_REMOTE 0x5E
|
||||
#define ADCVAL_H100_LCD_REMOTE 0x96
|
||||
#define ADCVAL_H300_LCD_REMOTE_HOLD 0xCC
|
||||
#define ADCVAL_H100_LCD_REMOTE_HOLD 0xEA
|
||||
#else /* H300 series */
|
||||
#define ADCVAL_H300_LCD_REMOTE 0x35
|
||||
#define ADCVAL_H100_LCD_REMOTE 0x54
|
||||
#define ADCVAL_H300_LCD_REMOTE_HOLD 0x72
|
||||
#define ADCVAL_H100_LCD_REMOTE_HOLD 0x83
|
||||
#endif
|
||||
|
||||
#elif defined(IRIVER_IFP7XX)
|
||||
|
||||
#define NUM_ADC_CHANNELS 5
|
||||
|
|
|
@ -117,8 +117,3 @@
|
|||
/* Define this if you can control the S/PDIF power */
|
||||
#define HAVE_SPDIF_POWER
|
||||
#define SPDIF_POWER_INVERTED
|
||||
|
||||
/* ADC values for different remote control types */
|
||||
#define ADCVAL_H100_LCD_REMOTE 0x6a
|
||||
#define ADCVAL_H300_LCD_REMOTE 0x50
|
||||
#define ADCVAL_H300_NONLCD_REMOTE 0xfc
|
||||
|
|
|
@ -111,8 +111,3 @@
|
|||
|
||||
/* Define this if you can control the S/PDIF power */
|
||||
#define HAVE_SPDIF_POWER
|
||||
|
||||
/* ADC values for different remote control types */
|
||||
#define ADCVAL_H100_LCD_REMOTE 0x6a
|
||||
#define ADCVAL_H300_LCD_REMOTE 0x50
|
||||
#define ADCVAL_H300_NONLCD_REMOTE 0xfc
|
||||
|
|
|
@ -113,9 +113,4 @@
|
|||
/* define this if the unit can be powered or charged via USB */
|
||||
#define HAVE_USB_POWER
|
||||
|
||||
/* ADC values for different remote control types */
|
||||
#define ADCVAL_H100_LCD_REMOTE 0x3c
|
||||
#define ADCVAL_H300_LCD_REMOTE 0x2b
|
||||
#define ADCVAL_H300_NONLCD_REMOTE 0x8e
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue
Block a user