Skip to content

Commit 5f98918

Browse files
authored
Merge pull request #5 from hg42/PR-button-name
name the button correctly, allow to choose from ISP or PLAY button
2 parents aec3123 + 965466c commit 5f98918

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

main.c

+8-5
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@
4343

4444
#include "lpc17xx_wdt.h"
4545

46-
#define ISP_BTN P2_12
46+
#define PLAY_BTN P2_12
47+
#define ISP_BTN P2_10
48+
49+
#define DFU_BTN PLAY_BTN
4750

4851
#ifndef DEBUG_MESSAGES
4952
#define printf(...) do {} while (0)
@@ -64,9 +67,9 @@ void setleds(int leds)
6467
GPIO_write(LED5, leds & 16);
6568
}
6669

67-
int isp_btn_pressed(void)
70+
int dfu_btn_pressed(void)
6871
{
69-
return GPIO_get(ISP_BTN);
72+
return GPIO_get(DFU_BTN);
7073
}
7174

7275
void start_dfu(void)
@@ -182,7 +185,7 @@ int main(void)
182185
{
183186
WDT_Feed();
184187

185-
GPIO_init(ISP_BTN); GPIO_input(ISP_BTN);
188+
GPIO_init(DFU_BTN); GPIO_input(DFU_BTN);
186189

187190
GPIO_init(LED1); GPIO_output(LED1);
188191
GPIO_init(LED2); GPIO_output(LED2);
@@ -210,7 +213,7 @@ int main(void)
210213
check_sd_firmware();
211214

212215
int dfu = 0;
213-
if (isp_btn_pressed() == 0)
216+
if (dfu_btn_pressed() == 0)
214217
{
215218
printf("ISP button pressed, entering DFU mode\n");
216219
dfu = 1;

0 commit comments

Comments
 (0)