Changed template parameter order

This commit is contained in:
BlackMark 2019-08-05 20:05:59 +02:00
parent 87e6936051
commit c4f38cbcdf
4 changed files with 30 additions and 30 deletions

View File

@ -23,8 +23,8 @@ enum class Driven {
namespace detail { namespace detail {
template <class Registers, typename CtrlFlagsA, typename CtrlFlagsB, typename CtrlFlagsC, class cfg, Mode mode, template <class Registers, typename CtrlFlagsA, typename CtrlFlagsB, typename CtrlFlagsC, class cfg, Driven driven,
Driven driven> Mode mode>
class Hardware { class Hardware {
public: public:
static void init() FORCE_INLINE static void init() FORCE_INLINE

View File

@ -73,7 +73,7 @@ extern void (*fnDataReg0EmptyIntHandler)();
} // namespace detail } // namespace detail
template <Mode mode = Mode::ASYNCHRONOUS, class cfg = Config<>, Driven driven = Driven::INTERRUPT> template <class cfg = Config<>, Driven driven = Driven::INTERRUPT, Mode mode = Mode::ASYNCHRONOUS>
class Hardware0 { class Hardware0 {
public: public:
using data_t = typename cfg::data_t; using data_t = typename cfg::data_t;
@ -117,11 +117,11 @@ class Hardware0 {
private: private:
using HardwareImpl = detail::Hardware<detail::Registers0, detail::ControlFlagsA0, detail::ControlFlagsB0, using HardwareImpl = detail::Hardware<detail::Registers0, detail::ControlFlagsA0, detail::ControlFlagsB0,
detail::ControlFlagsC0, cfg, mode, driven>; detail::ControlFlagsC0, cfg, driven, mode>;
}; };
template <Mode mode, class cfg> template <class cfg, Mode mode>
class Hardware0<mode, cfg, Driven::INTERRUPT> { class Hardware0<cfg, Driven::INTERRUPT, mode> {
public: public:
using data_t = typename cfg::data_t; using data_t = typename cfg::data_t;
static constexpr auto DATA_BITS = cfg::DATA_BITS; static constexpr auto DATA_BITS = cfg::DATA_BITS;
@ -188,7 +188,7 @@ class Hardware0<mode, cfg, Driven::INTERRUPT> {
private: private:
using HardwareImpl = detail::Hardware<detail::Registers0, detail::ControlFlagsA0, detail::ControlFlagsB0, using HardwareImpl = detail::Hardware<detail::Registers0, detail::ControlFlagsA0, detail::ControlFlagsB0,
detail::ControlFlagsC0, cfg, mode, Driven::INTERRUPT>; detail::ControlFlagsC0, cfg, Driven::INTERRUPT, mode>;
static constexpr auto TX_BUFFER_SIZE = 16; static constexpr auto TX_BUFFER_SIZE = 16;
static constexpr auto RX_BUFFER_SIZE = 16; static constexpr auto RX_BUFFER_SIZE = 16;
@ -217,15 +217,15 @@ class Hardware0<mode, cfg, Driven::INTERRUPT> {
} }
}; };
template <Mode mode, class cfg> template <class cfg, Mode mode>
volatile detail::RingBuffer<typename Hardware0<mode, cfg, Driven::INTERRUPT>::data_t, volatile detail::RingBuffer<typename Hardware0<cfg, Driven::INTERRUPT, mode>::data_t,
Hardware0<mode, cfg, Driven::INTERRUPT>::TX_BUFFER_SIZE> Hardware0<cfg, Driven::INTERRUPT, mode>::TX_BUFFER_SIZE>
Hardware0<mode, cfg, Driven::INTERRUPT>::sm_txBuf = {0, 0, {0}}; Hardware0<cfg, Driven::INTERRUPT, mode>::sm_txBuf = {0, 0, {0}};
template <Mode mode, class cfg> template <class cfg, Mode mode>
volatile detail::RingBuffer<typename Hardware0<mode, cfg, Driven::INTERRUPT>::data_t, volatile detail::RingBuffer<typename Hardware0<cfg, Driven::INTERRUPT, mode>::data_t,
Hardware0<mode, cfg, Driven::INTERRUPT>::RX_BUFFER_SIZE> Hardware0<cfg, Driven::INTERRUPT, mode>::RX_BUFFER_SIZE>
Hardware0<mode, cfg, Driven::INTERRUPT>::sm_rxBuf = {0, 0, {0}}; Hardware0<cfg, Driven::INTERRUPT, mode>::sm_rxBuf = {0, 0, {0}};
} // namespace uart } // namespace uart

View File

@ -77,7 +77,7 @@ extern void (*fnDataReg1EmptyIntHandler)();
#ifdef HAS_UART1 #ifdef HAS_UART1
template <Mode mode = Mode::ASYNCHRONOUS, class cfg = Config<>, Driven driven = Driven::INTERRUPT> template <class cfg = Config<>, Driven driven = Driven::INTERRUPT, Mode mode = Mode::ASYNCHRONOUS>
class Hardware1 { class Hardware1 {
public: public:
using data_t = typename cfg::data_t; using data_t = typename cfg::data_t;
@ -121,11 +121,11 @@ class Hardware1 {
private: private:
using HardwareImpl = detail::Hardware<detail::Registers1, detail::ControlFlagsA1, detail::ControlFlagsB1, using HardwareImpl = detail::Hardware<detail::Registers1, detail::ControlFlagsA1, detail::ControlFlagsB1,
detail::ControlFlagsC1, cfg, mode, driven>; detail::ControlFlagsC1, cfg, driven, mode>;
}; };
template <Mode mode, class cfg> template <class cfg, Mode mode>
class Hardware1<mode, cfg, Driven::INTERRUPT> { class Hardware1<cfg, Driven::INTERRUPT, mode> {
public: public:
using data_t = typename cfg::data_t; using data_t = typename cfg::data_t;
static constexpr auto DATA_BITS = cfg::DATA_BITS; static constexpr auto DATA_BITS = cfg::DATA_BITS;
@ -192,7 +192,7 @@ class Hardware1<mode, cfg, Driven::INTERRUPT> {
private: private:
using HardwareImpl = detail::Hardware<detail::Registers1, detail::ControlFlagsA1, detail::ControlFlagsB1, using HardwareImpl = detail::Hardware<detail::Registers1, detail::ControlFlagsA1, detail::ControlFlagsB1,
detail::ControlFlagsC1, cfg, mode, Driven::INTERRUPT>; detail::ControlFlagsC1, cfg, Driven::INTERRUPT, mode>;
static constexpr auto TX_BUFFER_SIZE = 16; static constexpr auto TX_BUFFER_SIZE = 16;
static constexpr auto RX_BUFFER_SIZE = 16; static constexpr auto RX_BUFFER_SIZE = 16;
@ -221,15 +221,15 @@ class Hardware1<mode, cfg, Driven::INTERRUPT> {
} }
}; };
template <Mode mode, class cfg> template <class cfg, Mode mode>
volatile detail::RingBuffer<typename Hardware1<mode, cfg, Driven::INTERRUPT>::data_t, volatile detail::RingBuffer<typename Hardware1<cfg, Driven::INTERRUPT, mode>::data_t,
Hardware1<mode, cfg, Driven::INTERRUPT>::TX_BUFFER_SIZE> Hardware1<cfg, Driven::INTERRUPT, mode>::TX_BUFFER_SIZE>
Hardware1<mode, cfg, Driven::INTERRUPT>::sm_txBuf = {0, 0, {0}}; Hardware1<cfg, Driven::INTERRUPT, mode>::sm_txBuf = {0, 0, {0}};
template <Mode mode, class cfg> template <class cfg, Mode mode>
volatile detail::RingBuffer<typename Hardware1<mode, cfg, Driven::INTERRUPT>::data_t, volatile detail::RingBuffer<typename Hardware1<cfg, Driven::INTERRUPT, mode>::data_t,
Hardware1<mode, cfg, Driven::INTERRUPT>::RX_BUFFER_SIZE> Hardware1<cfg, Driven::INTERRUPT, mode>::RX_BUFFER_SIZE>
Hardware1<mode, cfg, Driven::INTERRUPT>::sm_rxBuf = {0, 0, {0}}; Hardware1<cfg, Driven::INTERRUPT, mode>::sm_rxBuf = {0, 0, {0}};
#endif #endif

View File

@ -369,11 +369,11 @@ class Uart {
}; };
template <typename cfg = Config<>> template <typename cfg = Config<>>
using Uart0 = Uart<Hardware0<Mode::ASYNCHRONOUS, cfg>>; using Uart0 = Uart<Hardware0<cfg, Driven::INTERRUPT, Mode::ASYNCHRONOUS>>;
#ifdef HAS_UART1 #ifdef HAS_UART1
template <typename cfg = Config<>> template <typename cfg = Config<>>
using Uart1 = Uart<Hardware1<Mode::ASYNCHRONOUS, cfg>>; using Uart1 = Uart<Hardware1<cfg, Driven::INTERRUPT, Mode::ASYNCHRONOUS>>;
#endif #endif
} // namespace uart } // namespace uart