Made library header only again and provided way to disable interrupt vectors
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#pragma once
|
||||
#ifndef UART_HARDWARE_1_HPP
|
||||
#define UART_HARDWARE_1_HPP
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
@@ -118,3 +119,40 @@ class Hardware1<cfg, Driven::INTERRUPT, mode>
|
||||
} // namespace uart
|
||||
|
||||
#undef FORCE_INLINE
|
||||
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef UART1_INT_VECTORS
|
||||
|
||||
#include <avr/interrupt.h>
|
||||
|
||||
namespace uart {
|
||||
namespace detail {
|
||||
|
||||
#if defined(__AVR_ATmega1284P__)
|
||||
|
||||
void (*fnRx1IntHandler)() = nullptr;
|
||||
void (*fnDataReg1EmptyIntHandler)() = nullptr;
|
||||
|
||||
ISR(USART1_RX_vect)
|
||||
{
|
||||
if (fnRx1IntHandler)
|
||||
fnRx1IntHandler();
|
||||
}
|
||||
|
||||
ISR(USART1_UDRE_vect)
|
||||
{
|
||||
if (fnDataReg1EmptyIntHandler)
|
||||
fnDataReg1EmptyIntHandler();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace detail
|
||||
} // namespace uart
|
||||
|
||||
#undef UART1_INT_VECTORS
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user