summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--quantum/quantum.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/quantum/quantum.h b/quantum/quantum.h
index 74da544b63..05eee39ef9 100644
--- a/quantum/quantum.h
+++ b/quantum/quantum.h
@@ -206,6 +206,8 @@ typedef uint8_t pin_t;
# define readPin(pin) ((bool)(PINx_ADDRESS(pin) & _BV((pin)&0xF)))
+# define togglePin(pin) (PORTx_ADDRESS(pin) ^= _BV((pin)&0xF))
+
#elif defined(PROTOCOL_CHIBIOS)
typedef ioline_t pin_t;
@@ -219,6 +221,8 @@ typedef ioline_t pin_t;
# define writePin(pin, level) ((level) ? writePinHigh(pin) : writePinLow(pin))
# define readPin(pin) palReadLine(pin)
+
+# define togglePin(pin) palToggleLine(pin)
#endif
#define SEND_STRING(string) send_string_P(PSTR(string))