diff --git a/firmware/targets/f7/ble_glue/ble_glue.c b/firmware/targets/f7/ble_glue/ble_glue.c index 6b527cfc..1cb5501d 100644 --- a/firmware/targets/f7/ble_glue/ble_glue.c +++ b/firmware/targets/f7/ble_glue/ble_glue.c @@ -2,6 +2,7 @@ #include "app_common.h" #include "ble_app.h" #include +#include #include #include @@ -72,6 +73,20 @@ void shci_register_io_bus(tSHciIO* fops) { fops->Send = ble_glue_TL_SYS_SendCmd; } +static int32_t ble_glue_TL_BLE_SendCmd(uint8_t* buffer, uint16_t size) { + if(furi_hal_bt_get_hardfault_info()) { + furi_crash("ST(R) Copro(R) HardFault"); + } + + return TL_BLE_SendCmd(buffer, size); +} + +void hci_register_io_bus(tHciIO* fops) { + /* Register IO bus services */ + fops->Init = TL_BLE_Init; + fops->Send = ble_glue_TL_BLE_SendCmd; +} + /////////////////////////////////////////////////////////////////////////////// void ble_glue_init() { diff --git a/lib/stm32wb.scons b/lib/stm32wb.scons index 7cb2fa8b..94a1c707 100644 --- a/lib/stm32wb.scons +++ b/lib/stm32wb.scons @@ -48,7 +48,10 @@ sources += Glob( ) sources += Glob( "stm32wb_copro/wpan/interface/patterns/ble_thread/tl/*_tl*.c", - exclude="stm32wb_copro/wpan/interface/patterns/ble_thread/tl/shci_tl_if.c", + exclude=[ + "stm32wb_copro/wpan/interface/patterns/ble_thread/tl/hci_tl_if.c", + "stm32wb_copro/wpan/interface/patterns/ble_thread/tl/shci_tl_if.c", + ], source=True, ) sources += [