[FL-3302] ble: attempt to handle hardfaulted c2 (#2653)

* ble: attempt to handle hardfaulted c2
* MfKey32: nicer macros
* FuriHal: slightly different core2 hardfault message
* Update ReadMe

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
hedger
2023-05-09 13:06:44 +09:00
committed by GitHub
co-authored by あく
parent d5403a089c
commit eebc6241b7
5 changed files with 56 additions and 25 deletions
+20
View File
@@ -54,6 +54,26 @@ void ble_glue_set_key_storage_changed_callback(
ble_glue->context = context;
}
///////////////////////////////////////////////////////////////////////////////
/* TL hook to catch hardfaults */
int32_t ble_glue_TL_SYS_SendCmd(uint8_t* buffer, uint16_t size) {
if(furi_hal_bt_get_hardfault_info()) {
furi_crash("ST(R) Copro(R) HardFault");
}
return TL_SYS_SendCmd(buffer, size);
}
void shci_register_io_bus(tSHciIO* fops) {
/* Register IO bus services */
fops->Init = TL_SYS_Init;
fops->Send = ble_glue_TL_SYS_SendCmd;
}
///////////////////////////////////////////////////////////////////////////////
void ble_glue_init() {
ble_glue = malloc(sizeof(BleGlue));
ble_glue->status = BleGlueStatusStartup;