From 7ea36daf5de6b5de7ff0b73690a9b6df8106fe50 Mon Sep 17 00:00:00 2001 From: Dr John Vidler Date: Fri, 22 Sep 2023 16:01:38 +0100 Subject: [PATCH] Added typescript access to heap debug functionality --- libs/core/control.cpp | 11 +++++++++++ libs/core/pxt.json | 2 +- pxtarget.json | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/libs/core/control.cpp b/libs/core/control.cpp index c8074f48e75..1ff81c7b8eb 100644 --- a/libs/core/control.cpp +++ b/libs/core/control.cpp @@ -227,6 +227,17 @@ namespace control { release_fiber(); } + /** + * CODAL Heap Debug Output + */ + void printCodalHeap() { + #if MICROBIT_CODAL && CODAL_DEBUG > 0 + device_heap_print(); + #else + dmesg( "CODAL debug disabled." ); + #endif + } + /** * Gets the number of milliseconds elapsed since power on. */ diff --git a/libs/core/pxt.json b/libs/core/pxt.json index beee1fa152e..8c61bddbf4c 100644 --- a/libs/core/pxt.json +++ b/libs/core/pxt.json @@ -108,7 +108,7 @@ "DMESG_ENABLE": 1, "DEVICE_DMESG_BUFFER_SIZE": 1024, "DMESG_SERIAL_DEBUG": 1, - "CODAL_DEBUG": 3, + "CODAL_DEBUG": 1, "CODAL_DEFAULT_STREAM_RECORDING_MAX_LENGTH": 60000 }, "optionalConfig": { diff --git a/pxtarget.json b/pxtarget.json index 026bf2f8491..6db28ddc2b0 100644 --- a/pxtarget.json +++ b/pxtarget.json @@ -197,7 +197,7 @@ "codalTarget": { "name": "codal-microbit-v2", "url": "https://github.com/lancaster-university/codal-microbit-v2", - "branch": "v0.2.61-master.0", + "branch": "v0.2.61-master.2", "type": "git" }, "codalBinary": "MICROBIT",