Enable M4 interrupt on M0 core only when M4 image is running.

This commit is contained in:
Jared Boone 2016-06-24 11:32:24 -07:00
parent c7497577a0
commit e263420ea3
2 changed files with 4 additions and 4 deletions

View File

@ -85,9 +85,13 @@ void stop() {
void run_image(const portapack::spi_flash::region_t image_region) { void run_image(const portapack::spi_flash::region_t image_region) {
m4_init(image_region, portapack::memory::map::m4_code); m4_init(image_region, portapack::memory::map::m4_code);
creg::m4txevent::enable();
} }
void shutdown() { void shutdown() {
creg::m4txevent::disable();
ShutdownMessage shutdown_message; ShutdownMessage shutdown_message;
shared_memory.baseband_queue.push_and_wait(shutdown_message); shared_memory.baseband_queue.push_and_wait(shutdown_message);
} }

View File

@ -105,14 +105,10 @@ EventDispatcher::EventDispatcher(
} }
void EventDispatcher::run() { void EventDispatcher::run() {
creg::m4txevent::enable();
while(is_running) { while(is_running) {
const auto events = wait(); const auto events = wait();
dispatch(events); dispatch(events);
} }
creg::m4txevent::disable();
} }
void EventDispatcher::request_stop() { void EventDispatcher::request_stop() {