summaryrefslogtreecommitdiff
path: root/bootloader/iaudio_coldfire.c
diff options
context:
space:
mode:
Diffstat (limited to 'bootloader/iaudio_coldfire.c')
-rw-r--r--bootloader/iaudio_coldfire.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/bootloader/iaudio_coldfire.c b/bootloader/iaudio_coldfire.c
index 5639a0e59b..9c829c4a34 100644
--- a/bootloader/iaudio_coldfire.c
+++ b/bootloader/iaudio_coldfire.c
@@ -123,6 +123,10 @@ void check_battery(void)
123 } 123 }
124} 124}
125 125
126#if defined(IAUDIO_M5) || defined(IAUDIO_X5)
127int initial_gpio_read;
128#endif
129
126void main(void) 130void main(void)
127{ 131{
128 int i; 132 int i;
@@ -144,17 +148,13 @@ void main(void)
144 if ((GPIO_READ & 0x80000000) == 0) 148 if ((GPIO_READ & 0x80000000) == 0)
145 rc_on_button = true; 149 rc_on_button = true;
146#elif defined(IAUDIO_M5) || defined(IAUDIO_X5) 150#elif defined(IAUDIO_M5) || defined(IAUDIO_X5)
147 int data;
148
149 or_l(0x0e000000, &GPIO_FUNCTION); /* main Hold & Power, remote Play */ 151 or_l(0x0e000000, &GPIO_FUNCTION); /* main Hold & Power, remote Play */
150 and_l(~0x0e000000, &GPIO_ENABLE); 152 and_l(~0x0e000000, &GPIO_ENABLE);
151 153
152 data = GPIO_READ; 154 if ((initial_gpio_read & 0x04000000) == 0)
153
154 if ((data & 0x04000000) == 0)
155 on_button = true; 155 on_button = true;
156 156
157 if ((data & 0x02000000) == 0) 157 if ((initial_gpio_read & 0x02000000) == 0)
158 rc_on_button = true; 158 rc_on_button = true;
159#endif 159#endif
160 160