diff --git a/io.hpp b/io.hpp index cf5f519..b9c29f2 100644 --- a/io.hpp +++ b/io.hpp @@ -172,7 +172,7 @@ static constexpr auto getBus(const P pin) return static_cast(port); } -static constexpr auto getPin(const P pin) +static constexpr auto getPinBit(const P pin) { // Lower 4 bits of pin encode which pin bit it is uint8_t pinBit = static_cast(pin) & 0x0F; @@ -242,7 +242,7 @@ class Pin { { constexpr auto bus = detail::getBus(pin); constexpr auto dirReg = detail::getDDR(bus); - constexpr auto pinBit = detail::getPin(pin); + constexpr auto pinBit = detail::getPinBit(pin); if (dir == Dir::IN) *dirReg &= ~(1 << pinBit); @@ -254,7 +254,7 @@ class Pin { { constexpr auto bus = detail::getBus(pin); constexpr auto portReg = detail::getPORT(bus); - constexpr auto pinBit = detail::getPin(pin); + constexpr auto pinBit = detail::getPinBit(pin); if (enable) *portReg |= (1 << pinBit); @@ -266,7 +266,7 @@ class Pin { { constexpr auto bus = detail::getBus(pin); constexpr auto portReg = detail::getPORT(bus); - constexpr auto pinBit = detail::getPin(pin); + constexpr auto pinBit = detail::getPinBit(pin); if (value) *portReg |= (1 << pinBit); @@ -279,13 +279,13 @@ class Pin { #ifdef HARDWARE_TOGGLE constexpr auto bus = detail::getBus(pin); constexpr auto pinReg = detail::getPIN(bus); - constexpr auto pinBit = detail::getPin(pin); + constexpr auto pinBit = detail::getPinBit(pin); *pinReg |= (1 << pinBit); #else constexpr auto bus = detail::getBus(pin); constexpr auto portReg = detail::getPORT(bus); - constexpr auto pinBit = detail::getPin(pin); + constexpr auto pinBit = detail::getPinBit(pin); *portReg ^= (1 << pinBit); #endif @@ -295,7 +295,7 @@ class Pin { { constexpr auto bus = detail::getBus(pin); constexpr auto pinReg = detail::getPIN(bus); - constexpr auto pinBit = detail::getPin(pin); + constexpr auto pinBit = detail::getPinBit(pin); if (*pinReg >> pinBit & 1) return true;