aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Buttons.h
diff options
context:
space:
mode:
Diffstat (limited to 'LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Buttons.h')
-rw-r--r--LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Buttons.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Buttons.h b/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Buttons.h
index 738279123..d4e208407 100644
--- a/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Buttons.h
+++ b/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Buttons.h
@@ -76,28 +76,28 @@
#if !defined(__DOXYGEN__)
static inline void Buttons_Init(void)
{
- PORTE_OUTCLR = BUTTONS_BUTTON1;
- PORTF_OUTCLR = (BUTTONS_BUTTON2 | BUTTONS_BUTTON3);
+ PORTE.OUTCLR = BUTTONS_BUTTON1;
+ PORTE.PIN5CTRL = (PORT_OPC_PULLUP_gc | PORT_INVEN_bm);
- PORTE_PIN5CTRL = PORT_OPC_PULLUP_gc;
- PORTF_PIN1CTRL = PORT_OPC_PULLUP_gc;
- PORTF_PIN2CTRL = PORT_OPC_PULLUP_gc;
+ PORTF.OUTCLR = (BUTTONS_BUTTON2 | BUTTONS_BUTTON3);
+ PORTF.PIN1CTRL = (PORT_OPC_PULLUP_gc | PORT_INVEN_bm);
+ PORTF.PIN2CTRL = (PORT_OPC_PULLUP_gc | PORT_INVEN_bm);
}
static inline void Buttons_Disable(void)
{
- PORTE_OUTCLR = BUTTONS_BUTTON1;
- PORTF_OUTCLR = (BUTTONS_BUTTON2 | BUTTONS_BUTTON3);
-
- PORTE_PIN5CTRL = 0;
- PORTF_PIN1CTRL = 0;
- PORTF_PIN2CTRL = 0;
+ PORTE.OUTCLR = BUTTONS_BUTTON1;
+ PORTE.PIN5CTRL = 0;
+
+ PORTF.OUTCLR = (BUTTONS_BUTTON2 | BUTTONS_BUTTON3);
+ PORTF.PIN1CTRL = 0;
+ PORTF.PIN2CTRL = 0;
}
static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT;
static inline uint8_t Buttons_GetStatus(void)
{
- return ((~PORTE_IN & BUTTONS_BUTTON1) | (~PORTF_IN & (BUTTONS_BUTTON2 | BUTTONS_BUTTON3)));
+ return ((PORTE_IN & BUTTONS_BUTTON1) | (PORTF_IN & (BUTTONS_BUTTON2 | BUTTONS_BUTTON3)));
}
#endif