Consolidate M0-specific code.

This commit is contained in:
Jared Boone 2016-01-04 12:07:30 -08:00
parent a27489eb21
commit b058c0fe00
4 changed files with 11 additions and 7 deletions

View File

@ -29,10 +29,6 @@
#include "lpc43xx_cpp.hpp" #include "lpc43xx_cpp.hpp"
using namespace lpc43xx; using namespace lpc43xx;
void m4txevent_interrupt_enable() {
nvicEnableVector(M4CORE_IRQn, CORTEX_PRIORITY_MASK(LPC43XX_M4TXEVENT_IRQ_PRIORITY));
}
extern "C" { extern "C" {
CH_IRQ_HANDLER(M4Core_IRQHandler) { CH_IRQ_HANDLER(M4Core_IRQHandler) {

View File

@ -22,6 +22,4 @@
#ifndef __IRQ_IPC_H__ #ifndef __IRQ_IPC_H__
#define __IRQ_IPC_H__ #define __IRQ_IPC_H__
void m4txevent_interrupt_enable();
#endif/*__IRQ_IPC_H__*/ #endif/*__IRQ_IPC_H__*/

View File

@ -259,7 +259,7 @@ int main(void) {
controls_init(); controls_init();
lcd_frame_sync_configure(); lcd_frame_sync_configure();
rtc_interrupt_enable(); rtc_interrupt_enable();
m4txevent_interrupt_enable(); lpc43xx::creg::m4txevent::enable();
event_dispatcher.run(); event_dispatcher.run();

View File

@ -58,6 +58,16 @@ static_assert(offsetof(LPC_CREG_Type, USB1FLADJ) == 0x600, "USB1FLADJ offset wro
namespace m4txevent { 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) #if defined(LPC43XX_M4)
inline void assert() { inline void assert() {
__SEV(); __SEV();