diff --git a/firmware/application/irq_ipc.cpp b/firmware/application/irq_ipc.cpp index a4c7504bf..5ee5a97e3 100644 --- a/firmware/application/irq_ipc.cpp +++ b/firmware/application/irq_ipc.cpp @@ -29,10 +29,6 @@ #include "lpc43xx_cpp.hpp" using namespace lpc43xx; -void m4txevent_interrupt_enable() { - nvicEnableVector(M4CORE_IRQn, CORTEX_PRIORITY_MASK(LPC43XX_M4TXEVENT_IRQ_PRIORITY)); -} - extern "C" { CH_IRQ_HANDLER(M4Core_IRQHandler) { diff --git a/firmware/application/irq_ipc.hpp b/firmware/application/irq_ipc.hpp index 70d59d15e..de768c80f 100644 --- a/firmware/application/irq_ipc.hpp +++ b/firmware/application/irq_ipc.hpp @@ -22,6 +22,4 @@ #ifndef __IRQ_IPC_H__ #define __IRQ_IPC_H__ -void m4txevent_interrupt_enable(); - #endif/*__IRQ_IPC_H__*/ diff --git a/firmware/application/main.cpp b/firmware/application/main.cpp index 21a5874ea..b40fff241 100755 --- a/firmware/application/main.cpp +++ b/firmware/application/main.cpp @@ -259,7 +259,7 @@ int main(void) { controls_init(); lcd_frame_sync_configure(); rtc_interrupt_enable(); - m4txevent_interrupt_enable(); + lpc43xx::creg::m4txevent::enable(); event_dispatcher.run(); diff --git a/firmware/common/lpc43xx_cpp.hpp b/firmware/common/lpc43xx_cpp.hpp index d2917f9b6..92ca64ec1 100644 --- a/firmware/common/lpc43xx_cpp.hpp +++ b/firmware/common/lpc43xx_cpp.hpp @@ -58,6 +58,16 @@ static_assert(offsetof(LPC_CREG_Type, USB1FLADJ) == 0x600, "USB1FLADJ offset wro namespace m4txevent { +#if defined(LPC43XX_M0) +inline void enable() { + nvicEnableVector(M4CORE_IRQn, CORTEX_PRIORITY_MASK(LPC43XX_M4TXEVENT_IRQ_PRIORITY)); +} + +inline void disable() { + nvicDisableVector(M4CORE_IRQn); +} +#endif + #if defined(LPC43XX_M4) inline void assert() { __SEV();