summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/drivers/lcd-h100-remote.c21
-rw-r--r--firmware/export/adc.h13
-rw-r--r--firmware/export/config-h100.h5
-rw-r--r--firmware/export/config-h120.h5
-rw-r--r--firmware/export/config-h300.h5
5 files changed, 26 insertions, 23 deletions
diff --git a/firmware/drivers/lcd-h100-remote.c b/firmware/drivers/lcd-h100-remote.c
index a6d584c3fb..58953f61b5 100644
--- a/firmware/drivers/lcd-h100-remote.c
+++ b/firmware/drivers/lcd-h100-remote.c
@@ -456,16 +456,21 @@ static void remote_tick(void)
456 level = set_irq_level(HIGHEST_IRQ_LEVEL); 456 level = set_irq_level(HIGHEST_IRQ_LEVEL);
457 val = adc_scan(ADC_REMOTEDETECT); 457 val = adc_scan(ADC_REMOTEDETECT);
458 set_irq_level(level); 458 set_irq_level(level);
459 459 if (val < ADCVAL_H300_LCD_REMOTE_HOLD)
460 if(val < (ADCVAL_H100_LCD_REMOTE + 8)) 460 if (val < ADCVAL_H300_LCD_REMOTE)
461 if(val < (ADCVAL_H300_LCD_REMOTE + 8)) 461 _remote_type = REMOTETYPE_H300_LCD; /* hold off */
462 _remote_type = REMOTETYPE_H300_LCD;
463 else 462 else
464 _remote_type = REMOTETYPE_H100_LCD; 463 if (val < ADCVAL_H100_LCD_REMOTE)
464 _remote_type = REMOTETYPE_H100_LCD; /* hold off */
465 else
466 _remote_type = REMOTETYPE_H300_LCD; /* hold on */
465 else 467 else
466 _remote_type = REMOTETYPE_H300_NONLCD; 468 if (val < ADCVAL_H100_LCD_REMOTE_HOLD)
467 469 _remote_type = REMOTETYPE_H100_LCD; /* hold on, or no remote */
468 init_remote = true; 470 else
471 _remote_type = REMOTETYPE_H300_NONLCD; /* hold doesn't matter */
472
473 init_remote = true;
469 /* request init in scroll_thread */ 474 /* request init in scroll_thread */
470 } 475 }
471 else 476 else
diff --git a/firmware/export/adc.h b/firmware/export/adc.h
index 40d6a6aaab..2f14e3cf48 100644
--- a/firmware/export/adc.h
+++ b/firmware/export/adc.h
@@ -44,6 +44,19 @@
44#define ADC_REMOTEDETECT 3 44#define ADC_REMOTEDETECT 3
45#define ADC_UNREG_POWER ADC_BATTERY /* For compatibility */ 45#define ADC_UNREG_POWER ADC_BATTERY /* For compatibility */
46 46
47/* ADC values for different remote control types */
48#ifdef IRIVER_H100_SERIES
49#define ADCVAL_H300_LCD_REMOTE 0x5E
50#define ADCVAL_H100_LCD_REMOTE 0x96
51#define ADCVAL_H300_LCD_REMOTE_HOLD 0xCC
52#define ADCVAL_H100_LCD_REMOTE_HOLD 0xEA
53#else /* H300 series */
54#define ADCVAL_H300_LCD_REMOTE 0x35
55#define ADCVAL_H100_LCD_REMOTE 0x54
56#define ADCVAL_H300_LCD_REMOTE_HOLD 0x72
57#define ADCVAL_H100_LCD_REMOTE_HOLD 0x83
58#endif
59
47#elif defined(IRIVER_IFP7XX) 60#elif defined(IRIVER_IFP7XX)
48 61
49#define NUM_ADC_CHANNELS 5 62#define NUM_ADC_CHANNELS 5
diff --git a/firmware/export/config-h100.h b/firmware/export/config-h100.h
index d35a35bb60..bdbcce71a4 100644
--- a/firmware/export/config-h100.h
+++ b/firmware/export/config-h100.h
@@ -117,8 +117,3 @@
117/* Define this if you can control the S/PDIF power */ 117/* Define this if you can control the S/PDIF power */
118#define HAVE_SPDIF_POWER 118#define HAVE_SPDIF_POWER
119#define SPDIF_POWER_INVERTED 119#define SPDIF_POWER_INVERTED
120
121/* ADC values for different remote control types */
122#define ADCVAL_H100_LCD_REMOTE 0x6a
123#define ADCVAL_H300_LCD_REMOTE 0x50
124#define ADCVAL_H300_NONLCD_REMOTE 0xfc
diff --git a/firmware/export/config-h120.h b/firmware/export/config-h120.h
index 8426940da8..aea6011e63 100644
--- a/firmware/export/config-h120.h
+++ b/firmware/export/config-h120.h
@@ -111,8 +111,3 @@
111 111
112/* Define this if you can control the S/PDIF power */ 112/* Define this if you can control the S/PDIF power */
113#define HAVE_SPDIF_POWER 113#define HAVE_SPDIF_POWER
114
115/* ADC values for different remote control types */
116#define ADCVAL_H100_LCD_REMOTE 0x6a
117#define ADCVAL_H300_LCD_REMOTE 0x50
118#define ADCVAL_H300_NONLCD_REMOTE 0xfc
diff --git a/firmware/export/config-h300.h b/firmware/export/config-h300.h
index 45d3265010..88feb9d649 100644
--- a/firmware/export/config-h300.h
+++ b/firmware/export/config-h300.h
@@ -113,9 +113,4 @@
113/* define this if the unit can be powered or charged via USB */ 113/* define this if the unit can be powered or charged via USB */
114#define HAVE_USB_POWER 114#define HAVE_USB_POWER
115 115
116/* ADC values for different remote control types */
117#define ADCVAL_H100_LCD_REMOTE 0x3c
118#define ADCVAL_H300_LCD_REMOTE 0x2b
119#define ADCVAL_H300_NONLCD_REMOTE 0x8e
120
121#endif 116#endif