From 0532bf48b03ecf8de7f77686ffedd54ebc0ca33b Mon Sep 17 00:00:00 2001 From: BlackMark Date: Thu, 15 Aug 2019 18:58:25 +0200 Subject: [PATCH] Changed library so that user has to explicitly include hardware header with int vector define set to get ISR --- hardware0.hpp | 4 +++- hardware1.hpp | 4 +++- uart.hpp | 7 +++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/hardware0.hpp b/hardware0.hpp index 9260d68..009241d 100644 --- a/hardware0.hpp +++ b/hardware0.hpp @@ -128,7 +128,7 @@ class Hardware0 ////////////////////////////////////////////////////////////////////////// -#ifndef UART0_NO_INT_VECTORS +#ifdef UART0_INT_VECTORS #include @@ -164,4 +164,6 @@ ISR(USART0_UDRE_vect) } // namespace detail } // namespace uart +#undef UART0_INT_VECTORS + #endif diff --git a/hardware1.hpp b/hardware1.hpp index 42a8c41..97b2b3a 100644 --- a/hardware1.hpp +++ b/hardware1.hpp @@ -132,7 +132,7 @@ class Hardware1 ////////////////////////////////////////////////////////////////////////// -#ifndef UART1_NO_INT_VECTORS +#ifdef UART1_INT_VECTORS #include @@ -161,4 +161,6 @@ ISR(USART1_UDRE_vect) } // namespace detail } // namespace uart +#undef UART1_INT_VECTORS + #endif diff --git a/uart.hpp b/uart.hpp index 77aa096..fb2f715 100644 --- a/uart.hpp +++ b/uart.hpp @@ -3,11 +3,14 @@ #include #include "config.hpp" -#include "hardware0.hpp" -#include "hardware1.hpp" #include "software.hpp" #include "utils.hpp" +#undef UART0_INT_VECTORS +#include "hardware0.hpp" +#undef UART1_INT_VECTORS +#include "hardware1.hpp" + #include "../flash/flash.hpp" #define FORCE_INLINE __attribute__((always_inline))