Implemented overloads for printing numbers
This commit is contained in:
parent
fe9e67036e
commit
8d07e2d4db
42
uart.hpp
42
uart.hpp
@ -153,6 +153,12 @@ class Uart {
|
||||
return *this;
|
||||
}
|
||||
|
||||
Uart &operator<<(const signed char &val)
|
||||
{
|
||||
txNumber(val);
|
||||
return *this;
|
||||
}
|
||||
|
||||
Uart &operator<<(const unsigned char &val)
|
||||
{
|
||||
txNumber(val);
|
||||
@ -165,10 +171,10 @@ class Uart {
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename... Ts>
|
||||
Uart &operator<<(unsigned short) const
|
||||
Uart &operator<<(unsigned short &val)
|
||||
{
|
||||
static_assert(util::always_false_v<Ts...>, "Not implemented");
|
||||
txNumber(val);
|
||||
return *this;
|
||||
}
|
||||
|
||||
Uart &operator<<(const int &val)
|
||||
@ -183,28 +189,28 @@ class Uart {
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename... Ts>
|
||||
Uart &operator<<(long) const
|
||||
Uart &operator<<(const long &val)
|
||||
{
|
||||
static_assert(util::always_false_v<Ts...>, "Not implemented");
|
||||
txNumber(val);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename... Ts>
|
||||
Uart &operator<<(unsigned long) const
|
||||
Uart &operator<<(unsigned long &val)
|
||||
{
|
||||
static_assert(util::always_false_v<Ts...>, "Not implemented");
|
||||
txNumber(val);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename... Ts>
|
||||
Uart &operator<<(long long) const
|
||||
Uart &operator<<(long long &val)
|
||||
{
|
||||
static_assert(util::always_false_v<Ts...>, "Not implemented");
|
||||
txNumber(val);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename... Ts>
|
||||
Uart &operator<<(unsigned long long) const
|
||||
Uart &operator<<(unsigned long long &val)
|
||||
{
|
||||
static_assert(util::always_false_v<Ts...>, "Not implemented");
|
||||
txNumber(val);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename... Ts>
|
||||
@ -231,10 +237,10 @@ class Uart {
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename... Ts>
|
||||
Uart &operator<<(const void *) const
|
||||
Uart &operator<<(const void *val)
|
||||
{
|
||||
static_assert(util::always_false_v<Ts...>, "Not implemented");
|
||||
txNumber(reinterpret_cast<uint16_t>(val));
|
||||
return *this;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
Loading…
Reference in New Issue
Block a user