summaryrefslogtreecommitdiffstats
path: root/quantum
diff options
context:
space:
mode:
Diffstat (limited to 'quantum')
-rw-r--r--quantum/quantum.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/quantum/quantum.h b/quantum/quantum.h
index 45f44f49a1..72b0a1021f 100644
--- a/quantum/quantum.h
+++ b/quantum/quantum.h
@@ -197,6 +197,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;
@@ -210,6 +212,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))