From 9db7bce22005f34c669ec10109e9c406594bd9d6 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Mon, 22 Jun 2015 23:17:46 +0200 Subject: [PATCH] implement Reset for Bluetooth Hardware error on Arduino ARM using NVIC_SystemReset() --- platforms/arduino/BTstack.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/platforms/arduino/BTstack.cpp b/platforms/arduino/BTstack.cpp index a2e679ff0..cb9baa618 100644 --- a/platforms/arduino/BTstack.cpp +++ b/platforms/arduino/BTstack.cpp @@ -9,6 +9,10 @@ #include #endif +#if __arm__ +#include // also provides NVIC_SystemReset +#endif + #include "BTstack.h" #include "btstack_memory.h" @@ -684,6 +688,10 @@ void bluetooth_hardware_error(){ wdt_enable(WDTO_15MS); // wait for watchdog to trigger #endif + +#ifdef __arm__ + NVIC_SystemReset(); +#endif while(1); }