diff --git a/uart.hpp b/uart.hpp index c56f541..8e199ef 100644 --- a/uart.hpp +++ b/uart.hpp @@ -36,18 +36,6 @@ static constexpr size_t maxNumDigits() constexpr T minVal = util::NumericLimits::min(); constexpr T maxVal = util::NumericLimits::max(); - T minDigits = cntDigits() + ((minVal < 0) ? 1 : 0); - T maxDigits = cntDigits() + ((maxVal < 0) ? 1 : 0); - - return (minDigits < maxDigits) ? maxDigits : minDigits; -} - -template -static constexpr size_t maxPadding() -{ - constexpr T minVal = util::NumericLimits::min(); - constexpr T maxVal = util::NumericLimits::max(); - T minDigits = cntDigits(); T maxDigits = cntDigits(); @@ -125,9 +113,9 @@ class Uart { static void txNumber(const T &val) { static_assert(util::is_integral_v, "Only supported on integral types"); - static_assert(Base >= 2, "Numbers with bases less than 2 make no sense"); - static_assert(Base <= 16, "Numbers with bases higher than 16 are not supported"); - static_assert(Padding <= detail::maxPadding(), "Cannot pad more than maximum length of number"); + static_assert(Base >= 2, "Numbers with base less than 2 make no sense"); + static_assert(Base <= 16, "Numbers with base higher than 16 are not supported"); + static_assert(Padding <= detail::maxNumDigits(), "Cannot pad more than maximum length of number"); constexpr char alphaChar = (LowerCase) ? 'a' : 'A'; constexpr size_t numDigits = detail::maxNumDigits();