From d9ca67c84c9451b02befc078568cd3cedaa7de8e Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Tue, 13 Oct 2015 12:49:41 +0300 Subject: [PATCH] LPC11C24 - break on die() --- .../lpc11c24/test_olimex_lpc_p11c24/src/sys/board.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libuavcan_drivers/lpc11c24/test_olimex_lpc_p11c24/src/sys/board.cpp b/libuavcan_drivers/lpc11c24/test_olimex_lpc_p11c24/src/sys/board.cpp index 63d4f8ac54..d5495edbaf 100644 --- a/libuavcan_drivers/lpc11c24/test_olimex_lpc_p11c24/src/sys/board.cpp +++ b/libuavcan_drivers/lpc11c24/test_olimex_lpc_p11c24/src/sys/board.cpp @@ -134,7 +134,14 @@ void init() void die() { - while (true) { } + static const volatile unsigned& DHCSR = *reinterpret_cast(0xE000EDF0U); + while (true) + { + if ((DHCSR & 1U) != 0) + { + __asm volatile ("bkpt #0\n"); // Break into the debugger + } + } } #if __GNUC__