Index: firmware/target/arm/ipod/button-1g-3g.c =================================================================== --- firmware/target/arm/ipod/button-1g-3g.c (revision 17201) +++ firmware/target/arm/ipod/button-1g-3g.c (working copy) @@ -61,7 +61,7 @@ {1, 0, 0, -1}, {0, -1, 1, 0} }; - + if ( prev_scroll == -1 ) { prev_scroll = new_scroll; } @@ -99,7 +99,7 @@ unsigned char source, state; static bool was_hold = false; int btn = BUTTON_NONE; - + #ifdef IPOD_3G /* The following delay was 250 in the ipodlinux source, * but 50 seems to work fine. 250 causes the wheel to stop @@ -109,10 +109,10 @@ /* get source of interupts */ source = GPIOA_INT_STAT; - + /* get current keypad status */ state = GPIOA_INPUT_VAL; - + /* toggle interrupt level */ GPIOA_INT_LEV = ~state; @@ -250,5 +250,21 @@ bool headphones_inserted(void) { - return (GPIOC_INPUT_VAL & 0x1)?true:false; +#ifdef IPOD_1G2G + if ((IPOD_HW_REVISION >> 16) == 2) + { + /* 2G uses GPIO B bit 0 */ + return (GPIOB_INPUT_VAL & 0x1)?true:false; + } + else + { + /* 1G has no headphone detection, so fake insertion */ + return (true); } +#else +/* 3G uses GPIO C bit 0 */ +return (GPIOC_INPUT_VAL & 0x1)?true:false; +#endif +} + +