Adapt to moved type submodule
This commit is contained in:
parent
8f88cdccea
commit
119de32445
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include "../clock.hpp"
|
#include "../clock.hpp"
|
||||||
|
|
||||||
#include "../type/type.hpp"
|
#include "../util/type.hpp"
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -294,7 +294,7 @@ class BlockingHardware {
|
|||||||
|
|
||||||
static bool peek(data_t &) FORCE_INLINE
|
static bool peek(data_t &) FORCE_INLINE
|
||||||
{
|
{
|
||||||
static_assert(type::always_false_v<data_t>, "Peek with data is not supported in blocking mode");
|
static_assert(util::always_false_v<data_t>, "Peek with data is not supported in blocking mode");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,13 +3,13 @@
|
|||||||
#include "config.hpp"
|
#include "config.hpp"
|
||||||
|
|
||||||
#include "../io/io.hpp"
|
#include "../io/io.hpp"
|
||||||
#include "../type/type.hpp"
|
#include "../util/type.hpp"
|
||||||
|
|
||||||
namespace uart {
|
namespace uart {
|
||||||
|
|
||||||
template <io::P rxPin, io::P txPin, class cfg = Config<>>
|
template <io::P rxPin, io::P txPin, class cfg = Config<>>
|
||||||
class Software {
|
class Software {
|
||||||
static_assert(type::always_false_v<cfg>, "Not implemented");
|
static_assert(util::always_false_v<cfg>, "Not implemented");
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using data_t = typename cfg::data_t;
|
using data_t = typename cfg::data_t;
|
||||||
|
42
uart.hpp
42
uart.hpp
@ -33,8 +33,8 @@ static constexpr size_t cntDigits()
|
|||||||
template <typename T, size_t Base>
|
template <typename T, size_t Base>
|
||||||
static constexpr size_t maxNumDigits()
|
static constexpr size_t maxNumDigits()
|
||||||
{
|
{
|
||||||
constexpr T MinVal = type::numeric_limits<T>::min();
|
constexpr T MinVal = util::numeric_limits<T>::min();
|
||||||
constexpr T MaxVal = type::numeric_limits<T>::max();
|
constexpr T MaxVal = util::numeric_limits<T>::max();
|
||||||
|
|
||||||
constexpr T MinDigits = cntDigits<T, MinVal, Base>();
|
constexpr T MinDigits = cntDigits<T, MinVal, Base>();
|
||||||
constexpr T MaxDigits = cntDigits<T, MaxVal, Base>();
|
constexpr T MaxDigits = cntDigits<T, MaxVal, Base>();
|
||||||
@ -112,7 +112,7 @@ class Uart {
|
|||||||
template <typename T, size_t Base = 10, size_t Padding = 0, char PadChar = '0', bool LowerCase = true>
|
template <typename T, size_t Base = 10, size_t Padding = 0, char PadChar = '0', bool LowerCase = true>
|
||||||
static void txNumber(const T &val)
|
static void txNumber(const T &val)
|
||||||
{
|
{
|
||||||
static_assert(type::is_integral_v<T>, "Only supported on integral types");
|
static_assert(util::is_integral_v<T>, "Only supported on integral types");
|
||||||
static_assert(Base >= 2, "Numbers with base less than 2 make no sense");
|
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(Base <= 16, "Numbers with base higher than 16 are not supported");
|
||||||
static_assert(Padding <= detail::maxNumDigits<T, Base>(), "Cannot pad more than maximum length of number");
|
static_assert(Padding <= detail::maxNumDigits<T, Base>(), "Cannot pad more than maximum length of number");
|
||||||
@ -234,19 +234,19 @@ class Uart {
|
|||||||
template <typename... Ts>
|
template <typename... Ts>
|
||||||
Uart &operator<<(float) const
|
Uart &operator<<(float) const
|
||||||
{
|
{
|
||||||
static_assert(type::always_false_v<Ts...>, "Not supported by hardware");
|
static_assert(util::always_false_v<Ts...>, "Not supported by hardware");
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename... Ts>
|
template <typename... Ts>
|
||||||
Uart &operator<<(double) const
|
Uart &operator<<(double) const
|
||||||
{
|
{
|
||||||
static_assert(type::always_false_v<Ts...>, "Not supported by hardware");
|
static_assert(util::always_false_v<Ts...>, "Not supported by hardware");
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename... Ts>
|
template <typename... Ts>
|
||||||
Uart &operator<<(long double) const
|
Uart &operator<<(long double) const
|
||||||
{
|
{
|
||||||
static_assert(type::always_false_v<Ts...>, "Not supported by hardware");
|
static_assert(util::always_false_v<Ts...>, "Not supported by hardware");
|
||||||
}
|
}
|
||||||
|
|
||||||
Uart &operator<<(const bool &val)
|
Uart &operator<<(const bool &val)
|
||||||
@ -268,91 +268,91 @@ class Uart {
|
|||||||
template <typename... Ts>
|
template <typename... Ts>
|
||||||
Uart &operator>>(char &) const
|
Uart &operator>>(char &) const
|
||||||
{
|
{
|
||||||
static_assert(type::always_false_v<Ts...>, "Not implemented");
|
static_assert(util::always_false_v<Ts...>, "Not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename... Ts>
|
template <typename... Ts>
|
||||||
Uart &operator>>(unsigned char &) const
|
Uart &operator>>(unsigned char &) const
|
||||||
{
|
{
|
||||||
static_assert(type::always_false_v<Ts...>, "Not implemented");
|
static_assert(util::always_false_v<Ts...>, "Not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename... Ts>
|
template <typename... Ts>
|
||||||
Uart &operator>>(short &) const
|
Uart &operator>>(short &) const
|
||||||
{
|
{
|
||||||
static_assert(type::always_false_v<Ts...>, "Not implemented");
|
static_assert(util::always_false_v<Ts...>, "Not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename... Ts>
|
template <typename... Ts>
|
||||||
Uart &operator>>(unsigned short &) const
|
Uart &operator>>(unsigned short &) const
|
||||||
{
|
{
|
||||||
static_assert(type::always_false_v<Ts...>, "Not implemented");
|
static_assert(util::always_false_v<Ts...>, "Not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename... Ts>
|
template <typename... Ts>
|
||||||
Uart &operator>>(int &) const
|
Uart &operator>>(int &) const
|
||||||
{
|
{
|
||||||
static_assert(type::always_false_v<Ts...>, "Not implemented");
|
static_assert(util::always_false_v<Ts...>, "Not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename... Ts>
|
template <typename... Ts>
|
||||||
Uart &operator>>(unsigned int &) const
|
Uart &operator>>(unsigned int &) const
|
||||||
{
|
{
|
||||||
static_assert(type::always_false_v<Ts...>, "Not implemented");
|
static_assert(util::always_false_v<Ts...>, "Not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename... Ts>
|
template <typename... Ts>
|
||||||
Uart &operator>>(long &) const
|
Uart &operator>>(long &) const
|
||||||
{
|
{
|
||||||
static_assert(type::always_false_v<Ts...>, "Not implemented");
|
static_assert(util::always_false_v<Ts...>, "Not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename... Ts>
|
template <typename... Ts>
|
||||||
Uart &operator>>(unsigned long &) const
|
Uart &operator>>(unsigned long &) const
|
||||||
{
|
{
|
||||||
static_assert(type::always_false_v<Ts...>, "Not implemented");
|
static_assert(util::always_false_v<Ts...>, "Not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename... Ts>
|
template <typename... Ts>
|
||||||
Uart &operator>>(long long &) const
|
Uart &operator>>(long long &) const
|
||||||
{
|
{
|
||||||
static_assert(type::always_false_v<Ts...>, "Not implemented");
|
static_assert(util::always_false_v<Ts...>, "Not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename... Ts>
|
template <typename... Ts>
|
||||||
Uart &operator>>(unsigned long long &) const
|
Uart &operator>>(unsigned long long &) const
|
||||||
{
|
{
|
||||||
static_assert(type::always_false_v<Ts...>, "Not implemented");
|
static_assert(util::always_false_v<Ts...>, "Not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename... Ts>
|
template <typename... Ts>
|
||||||
Uart &operator>>(float &) const
|
Uart &operator>>(float &) const
|
||||||
{
|
{
|
||||||
static_assert(type::always_false_v<Ts...>, "Not supported by hardware");
|
static_assert(util::always_false_v<Ts...>, "Not supported by hardware");
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename... Ts>
|
template <typename... Ts>
|
||||||
Uart &operator>>(double &) const
|
Uart &operator>>(double &) const
|
||||||
{
|
{
|
||||||
static_assert(type::always_false_v<Ts...>, "Not supported by hardware");
|
static_assert(util::always_false_v<Ts...>, "Not supported by hardware");
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename... Ts>
|
template <typename... Ts>
|
||||||
Uart &operator>>(long double &) const
|
Uart &operator>>(long double &) const
|
||||||
{
|
{
|
||||||
static_assert(type::always_false_v<Ts...>, "Not supported by hardware");
|
static_assert(util::always_false_v<Ts...>, "Not supported by hardware");
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename... Ts>
|
template <typename... Ts>
|
||||||
Uart &operator>>(bool &) const
|
Uart &operator>>(bool &) const
|
||||||
{
|
{
|
||||||
static_assert(type::always_false_v<Ts...>, "Not implemented");
|
static_assert(util::always_false_v<Ts...>, "Not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename... Ts>
|
template <typename... Ts>
|
||||||
Uart &operator>>(const void *&) const
|
Uart &operator>>(const void *&) const
|
||||||
{
|
{
|
||||||
static_assert(type::always_false_v<Ts...>, "Not implemented");
|
static_assert(util::always_false_v<Ts...>, "Not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
Reference in New Issue
Block a user