mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-12-28 08:49:45 -05:00
Push M0 halt code into a function.
This commit is contained in:
parent
64da082306
commit
7fbe57931e
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -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__*/
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user