From d64793770cd82513bedcb839b7878c9102aba258 Mon Sep 17 00:00:00 2001 From: BlackMark Date: Fri, 26 Jul 2019 19:48:43 +0200 Subject: [PATCH] Added hardware invert for ports as well --- io.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/io.hpp b/io.hpp index db5de65..10a0b99 100644 --- a/io.hpp +++ b/io.hpp @@ -342,9 +342,15 @@ class Port { static inline void invert() FORCE_INLINE { +#if HARDWARE_TOGGLE + constexpr auto pinReg = detail::getPIN(port); + + *pinReg = 0xFF; +#else constexpr auto portReg = detail::getPORT(port); *portReg = ~(*portReg); +#endif } static inline uint8_t read() FORCE_INLINE