diff --git a/app/os/main.cpp b/app/os/main.cpp index 6cf597ac1b..9d4d4e5166 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