Added static_assert for transmitting numbers
This commit is contained in:
parent
ecdefe40e7
commit
2a07744575
14
uart.hpp
14
uart.hpp
@ -107,7 +107,7 @@ class Uart {
|
|||||||
template <typename T, size_t Base = 10>
|
template <typename T, size_t Base = 10>
|
||||||
static inline void txNumber(const T &val)
|
static inline void txNumber(const T &val)
|
||||||
{
|
{
|
||||||
// static_assert(util::is_integral_v<T>, "Only supported on integral types");
|
static_assert(util::is_integral_v<T>, "Only supported on integral types");
|
||||||
|
|
||||||
constexpr size_t numDigits = detail::maxNumDigits<T, Base>();
|
constexpr size_t numDigits = detail::maxNumDigits<T, Base>();
|
||||||
typename Driver::data_t buffer[numDigits];
|
typename Driver::data_t buffer[numDigits];
|
||||||
@ -175,10 +175,10 @@ class Uart {
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename... Ts>
|
Uart &operator<<(const unsigned int &val)
|
||||||
Uart &operator<<(unsigned int) const
|
|
||||||
{
|
{
|
||||||
static_assert(util::always_false_v<Ts...>, "Not implemented");
|
txNumber(val);
|
||||||
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename... Ts>
|
template <typename... Ts>
|
||||||
@ -223,10 +223,10 @@ class Uart {
|
|||||||
static_assert(util::always_false_v<Ts...>, "Not implemented");
|
static_assert(util::always_false_v<Ts...>, "Not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename... Ts>
|
Uart &operator<<(const bool &val)
|
||||||
Uart &operator<<(bool) const
|
|
||||||
{
|
{
|
||||||
static_assert(util::always_false_v<Ts...>, "Not implemented");
|
txString(val ? F("true") : F("false"));
|
||||||
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename... Ts>
|
template <typename... Ts>
|
||||||
|
Loading…
Reference in New Issue
Block a user