Added hardware invert for ports as well

This commit is contained in:
BlackMark 2019-07-26 19:48:43 +02:00
parent c1820f62f1
commit d64793770c

6
io.hpp
View File

@ -342,9 +342,15 @@ class Port {
static inline void invert() FORCE_INLINE static inline void invert() FORCE_INLINE
{ {
#if HARDWARE_TOGGLE
constexpr auto pinReg = detail::getPIN(port);
*pinReg = 0xFF;
#else
constexpr auto portReg = detail::getPORT(port); constexpr auto portReg = detail::getPORT(port);
*portReg = ~(*portReg); *portReg = ~(*portReg);
#endif
} }
static inline uint8_t read() FORCE_INLINE static inline uint8_t read() FORCE_INLINE