31 lines
460 B
C++
31 lines
460 B
C++
#include "hardware0.hpp"
|
|
|
|
#include <avr/interrupt.h>
|
|
|
|
namespace uart {
|
|
namespace detail {
|
|
|
|
#if defined(__AVR_ATmega1284P__)
|
|
|
|
void (*fnRx0IntHandler)() = nullptr;
|
|
void (*fnDataReg0EmptyIntHandler)() = nullptr;
|
|
|
|
ISR(USART0_RX_vect)
|
|
{
|
|
if (fnRx0IntHandler)
|
|
fnRx0IntHandler();
|
|
}
|
|
|
|
ISR(USART0_UDRE_vect)
|
|
{
|
|
if (fnDataReg0EmptyIntHandler)
|
|
fnDataReg0EmptyIntHandler();
|
|
}
|
|
|
|
#else
|
|
#error "This chip is not supported"
|
|
#endif
|
|
|
|
} // namespace detail
|
|
} // namespace uart
|