mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-05-23 17:01:31 -04:00
Capture M4 chDbgPanic msg, show in application.
This commit is contained in:
parent
97ba19af24
commit
eac4cf678a
4 changed files with 52 additions and 0 deletions
|
@ -24,6 +24,8 @@
|
|||
#include <ch.h>
|
||||
#include <hal.h>
|
||||
|
||||
#include "portapack_shared_memory.hpp"
|
||||
|
||||
#if defined(LPC43XX_M0)
|
||||
static void debug_indicate_error_init() {
|
||||
// TODO: Get knowledge of LED GPIO port/bit from shared place.
|
||||
|
@ -75,6 +77,16 @@ void __early_init(void) {
|
|||
}
|
||||
|
||||
void port_halt(void) {
|
||||
// Copy debug panic message to M0 region.
|
||||
const auto* p = dbg_panic_msg;
|
||||
for(size_t i=0; i<sizeof(shared_memory.m4_panic_msg); i++) {
|
||||
if( *p == 0 ) {
|
||||
shared_memory.m4_panic_msg[i] = 0;
|
||||
} else {
|
||||
shared_memory.m4_panic_msg[i] = *(p++);
|
||||
}
|
||||
}
|
||||
|
||||
port_disable();
|
||||
runtime_error();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue