mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-16 17:42:51 +00:00
print warning and reboot on bluetooth hardware error
This commit is contained in:
parent
d23838ec66
commit
03d7978d74
@ -4,7 +4,8 @@
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <SPI.h>
|
||||
|
||||
#include <avr/wdt.h>
|
||||
|
||||
#include "BTstack.h"
|
||||
|
||||
#include "btstack_memory.h"
|
||||
@ -596,6 +597,14 @@ void BTstackManager::setPublicBdAddr(bd_addr_t addr){
|
||||
|
||||
// static hci_uart_config_t config;
|
||||
|
||||
|
||||
void bluetooth_hardware_error(){
|
||||
printf("Bluetooth Hardware Error event. Restarting...\n\n\n");
|
||||
wdt_enable(WDTO_15MS);
|
||||
// wait for watchdog to trigger
|
||||
while(1);
|
||||
}
|
||||
|
||||
void BTstackManager::setup(void){
|
||||
|
||||
#ifdef PIN_LED
|
||||
@ -617,6 +626,8 @@ void BTstackManager::setup(void){
|
||||
hci_set_bd_addr(public_bd_addr);
|
||||
}
|
||||
|
||||
hci_set_hardware_error_callback(&bluetooth_hardware_error);
|
||||
|
||||
l2cap_init();
|
||||
|
||||
// setup central device db
|
||||
|
Loading…
x
Reference in New Issue
Block a user