Moved interrupt vectors to their own translation unit to solve redefinition error

This commit is contained in:
2019-08-02 20:29:04 +02:00
parent 33c3cedb1e
commit 2cd4069654
4 changed files with 64 additions and 28 deletions

View File

@@ -63,20 +63,8 @@ constexpr int operator<<(const int &lhs, const ControlFlagsB0 &rhs) { return lhs
constexpr int operator<<(const int &lhs, const ControlFlagsC0 &rhs) { return lhs << static_cast<int>(rhs); }
// clang-format on
static void (*fnRx0IntHandler)() = nullptr;
static void (*fnDataReg0EmptyIntHandler)() = nullptr;
ISR(USART0_RX_vect)
{
if (fnRx0IntHandler)
fnRx0IntHandler();
}
ISR(USART0_UDRE_vect)
{
if (fnDataReg0EmptyIntHandler)
fnDataReg0EmptyIntHandler();
}
extern void (*fnRx0IntHandler)();
extern void (*fnDataReg0EmptyIntHandler)();
#else
#error "This chip is not supported"