From 592f4a67cdcfad9a0d1010db11ed7f50ec1633ef Mon Sep 17 00:00:00 2001 From: hathach Date: Tue, 7 Mar 2017 17:03:34 +0700 Subject: [PATCH] print version if DEBUG level is 1+ --- cores/nRF5/debug.cpp | 8 ++++++++ cores/nRF5/debug.h | 2 ++ cores/nRF5/main.cpp | 4 ++++ 3 files changed, 14 insertions(+) diff --git a/cores/nRF5/debug.cpp b/cores/nRF5/debug.cpp index da725b87..7ee6ed81 100644 --- a/cores/nRF5/debug.cpp +++ b/cores/nRF5/debug.cpp @@ -200,6 +200,14 @@ void dbgMemInfo(void) } #endif +void dbgPrintVersion(void) +{ + Serial.println(); + Serial.println("BSP Library: " ARDUINO_BSP_VERSION); + Serial.printf ("Bootloader : %d.%d.%d\n", U32_BYTE2(bootloaderVersion), U32_BYTE3(bootloaderVersion), U32_BYTE4(bootloaderVersion)); + Serial.println("SoftDevice : S132 2.0.1"); + Serial.println(); +} /*------------------------------------------------------------------*/ /* diff --git a/cores/nRF5/debug.h b/cores/nRF5/debug.h index 51bd00aa..77d547f8 100644 --- a/cores/nRF5/debug.h +++ b/cores/nRF5/debug.h @@ -53,4 +53,6 @@ static inline int dbgHeapFree(void) void dbgMemInfo(void); +void dbgPrintVersion(void); + #endif diff --git a/cores/nRF5/main.cpp b/cores/nRF5/main.cpp index 28003149..29f95b07 100644 --- a/cores/nRF5/main.cpp +++ b/cores/nRF5/main.cpp @@ -33,6 +33,10 @@ static void loop_task(void* arg) setup(); +#if CFG_DEBUG + dbgPrintVersion(); +#endif + while (1) { loop();