Skip to content

Commit 099d8e8

Browse files
committed
Implement button for Olimex STM32-H103
1 parent eb14188 commit 099d8e8

1 file changed

Lines changed: 18 additions & 7 deletions

File tree

src/stm32f103/olimexstm32h103/config.h

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,24 @@
4545
#define LED_OPEN_DRAIN 1
4646
#endif
4747

48-
/* Technically, there is a button on PB8, but the button is
49-
also shorted to BOOT0, so it's not very useful for us to
50-
sample PB8 on boot, since pulling it high will already
51-
trigger the ROM serial bootloader and prevent us from
52-
running anyways. */
48+
/* "BUT" button on on PA0, pulled high by R18 */
5349
#ifndef HAVE_BUTTON
54-
#define HAVE_BUTTON 0
50+
#define HAVE_BUTTON 1
51+
#endif
52+
#ifndef BUTTON_ACTIVE_HIGH
53+
#define BUTTON_ACTIVE_HIGH 0
54+
#endif
55+
#ifndef BUTTON_GPIO_PORT
56+
#define BUTTON_GPIO_PORT GPIOA
57+
#endif
58+
#ifndef BUTTON_GPIO_PIN
59+
#define BUTTON_GPIO_PIN GPIO0
60+
#endif
61+
#ifndef BUTTON_USES_PULL
62+
#define BUTTON_USES_PULL 0
63+
#endif
64+
#ifndef BUTTON_SAMPLE_DELAY_CYCLES
65+
#define BUTTON_SAMPLE_DELAY_CYCLES 1440000
5566
#endif
5667

5768
#ifndef HAVE_USB_PULLUP_CONTROL
@@ -71,7 +82,7 @@
7182
#endif
7283

7384
#ifndef USES_GPIOA
74-
#define USES_GPIOA 0
85+
#define USES_GPIOA 1
7586
#endif
7687
#ifndef USES_GPIOB
7788
#define USES_GPIOB 0

0 commit comments

Comments
 (0)