From 5e72616618658c8b377db323696042ca122a5c89 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Mon, 27 Jul 2020 21:00:49 -0400 Subject: [PATCH] FS#8778: Fix iPod 1G scroll wheel not being enabled (Mark Fawcus and Rune Pade) They confirmed it worked in the original ticket. Change-Id: I949f119554a1e8bbdd0e4160c104cbc4aa2bd17d --- docs/CREDITS | 1 + firmware/target/arm/ipod/1g2g/adc-ipod-1g2g.c | 4 ++-- firmware/target/arm/ipod/1g2g/powermgmt-1g2g.c | 2 +- firmware/target/arm/ipod/button-1g-3g.c | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/CREDITS b/docs/CREDITS index 85f02dd4f1..012b31c72b 100644 --- a/docs/CREDITS +++ b/docs/CREDITS @@ -695,6 +695,7 @@ Sylvain Saubier Adrián Tinoco Boris Kovačević Stéphane Moutard-Martin +Rune Pade The libmad team The wavpack team diff --git a/firmware/target/arm/ipod/1g2g/adc-ipod-1g2g.c b/firmware/target/arm/ipod/1g2g/adc-ipod-1g2g.c index 37c719f2b1..4a9fe2e568 100644 --- a/firmware/target/arm/ipod/1g2g/adc-ipod-1g2g.c +++ b/firmware/target/arm/ipod/1g2g/adc-ipod-1g2g.c @@ -40,7 +40,7 @@ unsigned short adc_scan(int channel) (void)channel; /* there is only one */ mutex_lock(&adc_mtx); - if ((IPOD_HW_REVISION >> 16) == 1) + if ((IPOD_HW_REVISION >> 16) != 2) { int i; unsigned pval = GPIOB_OUTPUT_VAL; @@ -109,7 +109,7 @@ void adc_init(void) GPIOB_ENABLE |= 0x1e; /* enable B1..B4 */ - if ((IPOD_HW_REVISION >> 16) == 1) + if ((IPOD_HW_REVISION >> 16) != 2) { GPIOB_OUTPUT_EN = (GPIOB_OUTPUT_EN & ~0x08) | 0x16; /* B1, B2, B4 -> output, B3 -> input */ diff --git a/firmware/target/arm/ipod/1g2g/powermgmt-1g2g.c b/firmware/target/arm/ipod/1g2g/powermgmt-1g2g.c index c3eca14332..b90b953c68 100644 --- a/firmware/target/arm/ipod/1g2g/powermgmt-1g2g.c +++ b/firmware/target/arm/ipod/1g2g/powermgmt-1g2g.c @@ -61,7 +61,7 @@ int _battery_voltage(void) { unsigned adcval = adc_read(ADC_UNREG_POWER); - if ((IPOD_HW_REVISION >> 16) == 1) + if ((IPOD_HW_REVISION >> 16) != 2) return (adcval * BATTERY_SCALE_FACTOR_1G) >> 8; else return (adcval * BATTERY_SCALE_FACTOR_2G) >> 8; diff --git a/firmware/target/arm/ipod/button-1g-3g.c b/firmware/target/arm/ipod/button-1g-3g.c index 67aa7eb336..2710723866 100644 --- a/firmware/target/arm/ipod/button-1g-3g.c +++ b/firmware/target/arm/ipod/button-1g-3g.c @@ -265,7 +265,7 @@ void button_init_device(void) GPIOA_INT_CLR = GPIOA_INT_STAT; #ifdef IPOD_1G2G - if ((IPOD_HW_REVISION >> 16) == 1) + if ((IPOD_HW_REVISION >> 16) != 2) { /* enable scroll wheel */ GPIOB_ENABLE |= 0x01; GPIOB_OUTPUT_EN |= 0x01; @@ -289,7 +289,7 @@ int button_read_device(void) static unsigned char last_wheel_value = 0; unsigned char wheel_value; - if ((IPOD_HW_REVISION >> 16) == 1) + if ((IPOD_HW_REVISION >> 16) != 2) { if (!hold_button && (wheel_timeout == 0)) {