From 9a4d94f485e55fb9f77c6b4b07104bf6b8ff596b Mon Sep 17 00:00:00 2001 From: hathach Date: Fri, 2 Nov 2018 19:57:34 +0700 Subject: [PATCH] clean up --- cores/nRF5/utility/debug.cpp | 8 ++++++++ .../Bluefruit52Lib/examples/Peripheral/ancs/ancs.ino | 1 + .../examples/External_Format/External_Format.ino | 2 -- .../examples/Internal_Format/Internal_Format.ino | 2 -- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/cores/nRF5/utility/debug.cpp b/cores/nRF5/utility/debug.cpp index f8a8a65a..c91d26e6 100644 --- a/cores/nRF5/utility/debug.cpp +++ b/cores/nRF5/utility/debug.cpp @@ -56,6 +56,12 @@ extern uint32_t __StackLimit[]; extern "C" { +void HardFault_Handler(void) +{ + // reset on hardfault + NVIC_SystemReset(); +} + int cprintf(const char * format, ...) { char buf[256]; @@ -65,6 +71,8 @@ int cprintf(const char * format, ...) va_start(ap, format); len = vsnprintf(buf, 256, format, ap); + +// SEGGER_SYSVIEW_Print(buf); Serial.write(buf, len); va_end(ap); diff --git a/libraries/Bluefruit52Lib/examples/Peripheral/ancs/ancs.ino b/libraries/Bluefruit52Lib/examples/Peripheral/ancs/ancs.ino index ad178bda..cbf33975 100644 --- a/libraries/Bluefruit52Lib/examples/Peripheral/ancs/ancs.ino +++ b/libraries/Bluefruit52Lib/examples/Peripheral/ancs/ancs.ino @@ -51,6 +51,7 @@ void setup() Bluefruit.configPrphBandwidth(BANDWIDTH_MAX); Bluefruit.begin(); + // Set max power. Accepted values are: -40, -30, -20, -16, -12, -8, -4, 0, 4 Bluefruit.setTxPower(4); Bluefruit.setName("Bluefruit52"); diff --git a/libraries/FileSystem/examples/External_Format/External_Format.ino b/libraries/FileSystem/examples/External_Format/External_Format.ino index b7d52478..ae0819d4 100644 --- a/libraries/FileSystem/examples/External_Format/External_Format.ino +++ b/libraries/FileSystem/examples/External_Format/External_Format.ino @@ -34,14 +34,12 @@ void setup() ExternalFS.begin(); Serial.print("Formating ..."); - Serial.flush(); // Format without erase // Pass true for full external flash erasing (take time) ExternalFS.format(false); Serial.println("Done"); - Serial.flush(); } // the loop function runs over and over again forever diff --git a/libraries/FileSystem/examples/Internal_Format/Internal_Format.ino b/libraries/FileSystem/examples/Internal_Format/Internal_Format.ino index df5bcf99..940ad49c 100644 --- a/libraries/FileSystem/examples/Internal_Format/Internal_Format.ino +++ b/libraries/FileSystem/examples/Internal_Format/Internal_Format.ino @@ -34,14 +34,12 @@ void setup() InternalFS.begin(); Serial.print("Formating ..."); - Serial.flush(); // Format without erase // Pass true for full external flash erasing (take time) InternalFS.format(true); Serial.println("Done"); - Serial.flush(); } // the loop function runs over and over again forever