mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-01-12 13:43:38 +00:00
Move baseband init/shutdown code to before/after main(), not inside.
This commit is contained in:
parent
ffa797b926
commit
ea143bd3fc
@ -42,27 +42,6 @@
|
|||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <array>
|
#include <array>
|
||||||
|
|
||||||
extern "C" {
|
|
||||||
|
|
||||||
void __late_init(void) {
|
|
||||||
/*
|
|
||||||
* System initializations.
|
|
||||||
* - HAL initialization, this also initializes the configured device drivers
|
|
||||||
* and performs the board-specific initializations.
|
|
||||||
* - Kernel initialization, the main() function becomes a thread and the
|
|
||||||
* RTOS is active.
|
|
||||||
*/
|
|
||||||
halInit();
|
|
||||||
|
|
||||||
/* After this call, scheduler, systick, heap, etc. are available. */
|
|
||||||
/* By doing chSysInit() here, it runs before C++ constructors, which may
|
|
||||||
* require the heap.
|
|
||||||
*/
|
|
||||||
chSysInit();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
static void init() {
|
static void init() {
|
||||||
audio::dma::init();
|
audio::dma::init();
|
||||||
audio::dma::configure();
|
audio::dma::configure();
|
||||||
@ -82,7 +61,9 @@ static void halt() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void shutdown() {
|
extern "C" {
|
||||||
|
|
||||||
|
void _default_exit(void) {
|
||||||
// TODO: Is this complete?
|
// TODO: Is this complete?
|
||||||
|
|
||||||
nvicDisableVector(DMA_IRQn);
|
nvicDisableVector(DMA_IRQn);
|
||||||
@ -99,10 +80,29 @@ static void shutdown() {
|
|||||||
halt();
|
halt();
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(void) {
|
void __late_init(void) {
|
||||||
init();
|
/*
|
||||||
run();
|
* System initializations.
|
||||||
shutdown();
|
* - HAL initialization, this also initializes the configured device drivers
|
||||||
|
* and performs the board-specific initializations.
|
||||||
|
* - Kernel initialization, the main() function becomes a thread and the
|
||||||
|
* RTOS is active.
|
||||||
|
*/
|
||||||
|
halInit();
|
||||||
|
|
||||||
|
/* After this call, scheduler, systick, heap, etc. are available. */
|
||||||
|
/* By doing chSysInit() here, it runs before C++ constructors, which may
|
||||||
|
* require the heap.
|
||||||
|
*/
|
||||||
|
chSysInit();
|
||||||
|
|
||||||
|
/* Baseband initialization */
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
run();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user