mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-10-01 01:26:06 -04: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 "hal.h"
|
||||||
|
|
||||||
|
#include "lpc43xx_cpp.hpp"
|
||||||
|
using namespace lpc43xx;
|
||||||
|
|
||||||
#include "message.hpp"
|
#include "message.hpp"
|
||||||
#include "baseband_api.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() {
|
void m4_request_shutdown() {
|
||||||
baseband::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_init(const portapack::spi_flash::region_t from, const portapack::memory::region_t to);
|
||||||
void m4_request_shutdown();
|
void m4_request_shutdown();
|
||||||
|
|
||||||
|
void m0_halt();
|
||||||
|
|
||||||
#endif/*__M4_STARTUP_H__*/
|
#endif/*__M4_STARTUP_H__*/
|
||||||
|
@ -47,9 +47,6 @@
|
|||||||
|
|
||||||
#include "gcc.hpp"
|
#include "gcc.hpp"
|
||||||
|
|
||||||
#include "lpc43xx_cpp.hpp"
|
|
||||||
using namespace lpc43xx;
|
|
||||||
|
|
||||||
#include "sd_card.hpp"
|
#include "sd_card.hpp"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -100,8 +97,7 @@ int main(void) {
|
|||||||
|
|
||||||
portapack::shutdown();
|
portapack::shutdown();
|
||||||
m4_init(portapack::spi_flash::hackrf, portapack::memory::map::m4_code_hackrf);
|
m4_init(portapack::spi_flash::hackrf, portapack::memory::map::m4_code_hackrf);
|
||||||
|
m0_halt();
|
||||||
rgu::reset(rgu::Reset::M0APP);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user