From d1154484d8658b1c7f29db9c72346f141e7e9f99 Mon Sep 17 00:00:00 2001 From: Yann Locatelli Date: Mon, 29 Jan 2024 15:47:19 +0100 Subject: [PATCH] :wrench: (DeepSleep): Set macro MBED_SLEEP_TRACING_ENABLED + retarget mbed_override_console --- app/os/main.cpp | 10 ++++++++++ config/mbed_app.json | 5 +++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/app/os/main.cpp b/app/os/main.cpp index 13f6636019..fc45fb247f 100644 --- a/app/os/main.cpp +++ b/app/os/main.cpp @@ -2,6 +2,7 @@ // Copyright 2020-2022 APF France handicap // SPDX-License-Identifier: Apache-2.0 +#include "mbed_retarget.h" #include "mbed_stats.h" #include "drivers/Watchdog.h" @@ -75,6 +76,15 @@ using namespace leka; using namespace std::chrono; +// +// MARK: - Mbed retarget +// + +auto mbed::mbed_override_console([[maybe_unused]] int fd) -> mbed::FileHandle * +{ + return leka::logger::internal::filehandle; +} + // // MARK: - Global definitions // diff --git a/config/mbed_app.json b/config/mbed_app.json index f9bb933cae..4b11467213 100644 --- a/config/mbed_app.json +++ b/config/mbed_app.json @@ -30,7 +30,8 @@ "target.features_add": [ "EXPERIMENTAL_API" ], - "platform.stdio-baud-rate": 115200 + "platform.stdio-baud-rate": 115200, + "platform.deepsleep-stats-enabled": true }, "LEKA_DISCO": { "target_name": "\"LEKA_DISCO\"" @@ -39,4 +40,4 @@ "target_name": "\"LEKA_V1_2_DEV\"" } } -} +} \ No newline at end of file