diff options
| author | hathach <[email protected]> | 2026-04-29 15:01:16 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2026-04-29 15:01:16 +0700 |
| commit | f53a9ec9afee11dbbb57c4561ef3eeeb37e572a6 (patch) | |
| tree | ec061e7c6e53bb113fe25db58c3fa56d72b7d4e1 /hw | |
| parent | d11543a72260c340836aff505104e27cfdc92ccb (diff) | |
| parent | 096977889641be99815e31a12ab352650520e971 (diff) | |
Merge branch 'master' into hil_hfp
Diffstat (limited to 'hw')
| -rw-r--r-- | hw/bsp/tm4c/family.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/bsp/tm4c/family.c b/hw/bsp/tm4c/family.c index fe4737e50..4f85be220 100644 --- a/hw/bsp/tm4c/family.c +++ b/hw/bsp/tm4c/family.c @@ -58,6 +58,14 @@ static void board_button_init(GPIOA_Type* port, uint8_t PinMsk) { /* Set direction */ port->DIR &= ~PinMsk; + + /* Enable internal pull so the idle state is deterministic. LaunchPad buttons + * connect the pin to GND when pressed (active-low) and require a pull-up. */ +#if BUTTON_STATE_ACTIVE == 0 + port->PUR |= PinMsk; +#else + port->PDR |= PinMsk; +#endif } static void board_led_init(GPIOA_Type* port, uint8_t PinMsk, uint8_t dirmsk) { |
