Allow targets to use 1 or two buttons.

This commit is contained in:
Hydra 2016-12-21 22:09:35 +00:00 committed by Dominic Clifton
parent cfba8ca055
commit 282b86c14d
1 changed files with 4 additions and 0 deletions

View File

@ -196,13 +196,17 @@ void init(void)
#endif
#if defined(BUTTONS)
#ifdef BUTTON_A_PIN
IO_t buttonAPin = IOGetByTag(IO_TAG(BUTTON_A_PIN));
IOInit(buttonAPin, OWNER_SYSTEM, 0);
IOConfigGPIO(buttonAPin, IOCFG_IPU);
#endif
#ifdef BUTTON_B_PIN
IO_t buttonBPin = IOGetByTag(IO_TAG(BUTTON_B_PIN));
IOInit(buttonBPin, OWNER_SYSTEM, 0);
IOConfigGPIO(buttonBPin, IOCFG_IPU);
#endif
// Check status of bind plug and exit if not active
delayMicroseconds(10); // allow configuration to settle