From 5d6bc4761c2950fcccb043295b91cb625e3d4881 Mon Sep 17 00:00:00 2001 From: BlackMark Date: Fri, 2 Aug 2019 15:46:07 +0200 Subject: [PATCH] Changed interrupt order to match vector numbers --- hardware0.hpp | 20 ++++++++++---------- hardware1.hpp | 20 ++++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/hardware0.hpp b/hardware0.hpp index a171aab..848bbdc 100644 --- a/hardware0.hpp +++ b/hardware0.hpp @@ -59,22 +59,22 @@ constexpr int operator<<(const int &lhs, const ControlFlagsB0 &rhs) { return lhs constexpr int operator<<(const int &lhs, const ControlFlagsC0 &rhs) { return lhs << static_cast(rhs); } // clang-format on -static void (*fnDataReg0EmptyIntHandler)() = nullptr; static void (*fnRx0IntHandler)() = nullptr; +static void (*fnDataReg0EmptyIntHandler)() = nullptr; static void (*fnTx0IntHandler)() = nullptr; -ISR(USART0_UDRE_vect) -{ - if (fnDataReg0EmptyIntHandler) - fnDataReg0EmptyIntHandler(); -} - ISR(USART0_RX_vect) { if (fnRx0IntHandler) fnRx0IntHandler(); } +ISR(USART0_UDRE_vect) +{ + if (fnDataReg0EmptyIntHandler) + fnDataReg0EmptyIntHandler(); +} + ISR(USART0_TX_vect) { if (fnTx0IntHandler) @@ -120,8 +120,8 @@ class Hardware0 { static void init() FORCE_INLINE { - detail::fnDataReg0EmptyIntHandler = dataRegEmptyIntHandler; detail::fnRx0IntHandler = rxIntHandler; + detail::fnDataReg0EmptyIntHandler = dataRegEmptyIntHandler; detail::fnTx0IntHandler = txIntHandler; HardwareImpl::init(); @@ -140,12 +140,12 @@ class Hardware0 { using HardwareImpl = detail::Hardware; - static void dataRegEmptyIntHandler() + static void rxIntHandler() { // TODO } - static void rxIntHandler() + static void dataRegEmptyIntHandler() { // TODO } diff --git a/hardware1.hpp b/hardware1.hpp index 6e9c47b..78b28ca 100644 --- a/hardware1.hpp +++ b/hardware1.hpp @@ -59,22 +59,22 @@ constexpr int operator<<(const int &lhs, const ControlFlagsB1 &rhs) { return lhs constexpr int operator<<(const int &lhs, const ControlFlagsC1 &rhs) { return lhs << static_cast(rhs); } // clang-format on -static void (*fnDataReg1EmptyIntHandler)() = nullptr; static void (*fnRx1IntHandler)() = nullptr; +static void (*fnDataReg1EmptyIntHandler)() = nullptr; static void (*fnTx1IntHandler)() = nullptr; -ISR(USART1_UDRE_vect) -{ - if (fnDataReg1EmptyIntHandler) - fnDataReg1EmptyIntHandler(); -} - ISR(USART1_RX_vect) { if (fnRx1IntHandler) fnRx1IntHandler(); } +ISR(USART1_UDRE_vect) +{ + if (fnDataReg1EmptyIntHandler) + fnDataReg1EmptyIntHandler(); +} + ISR(USART1_TX_vect) { if (fnTx1IntHandler) @@ -124,8 +124,8 @@ class Hardware1 { static void init() FORCE_INLINE { - detail::fnDataReg1EmptyIntHandler = dataRegEmptyIntHandler; detail::fnRx1IntHandler = rxIntHandler; + detail::fnDataReg1EmptyIntHandler = dataRegEmptyIntHandler; detail::fnTx1IntHandler = txIntHandler; HardwareImpl::init(); @@ -144,12 +144,12 @@ class Hardware1 { using HardwareImpl = detail::Hardware; - static void dataRegEmptyIntHandler() + static void rxIntHandler() { // TODO } - static void rxIntHandler() + static void dataRegEmptyIntHandler() { // TODO }