Push M0 halt code into a function.

This commit is contained in:
Jared Boone 2016-02-16 11:04:35 -08:00
parent 64da082306
commit 7fbe57931e
3 changed files with 13 additions and 5 deletions

View File

@ -23,6 +23,9 @@
#include "hal.h"
#include "lpc43xx_cpp.hpp"
using namespace lpc43xx;
#include "message.hpp"
#include "baseband_api.hpp"
@ -51,3 +54,10 @@ void m4_init(const portapack::spi_flash::region_t from, const portapack::memory:
void m4_request_shutdown() {
baseband::shutdown();
}
void m0_halt() {
rgu::reset(rgu::Reset::M0APP);
while(true) {
port_wait_for_interrupt();
}
}

View File

@ -30,4 +30,6 @@
void m4_init(const portapack::spi_flash::region_t from, const portapack::memory::region_t to);
void m4_request_shutdown();
void m0_halt();
#endif/*__M4_STARTUP_H__*/

View File

@ -47,9 +47,6 @@
#include "gcc.hpp"
#include "lpc43xx_cpp.hpp"
using namespace lpc43xx;
#include "sd_card.hpp"
#include <string.h>
@ -100,8 +97,7 @@ int main(void) {
portapack::shutdown();
m4_init(portapack::spi_flash::hackrf, portapack::memory::map::m4_code_hackrf);
rgu::reset(rgu::Reset::M0APP);
m0_halt();
return 0;
}