From 8073a9db25bb88943d75df508833a7aab958d1ee Mon Sep 17 00:00:00 2001 From: Kevin Le Date: Thu, 17 Sep 2026 20:32:08 +0700 Subject: [PATCH] Fixed stm32 variants not compiling due to ltoa missing . https://github.com/meshcore-dev/MeshCore/pull/2655#issuecomment-5714564192 --- platformio.ini | 1 + src/helpers/TxtDataHelpers.cpp | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 28311ed7..87cf4557 100644 --- a/platformio.ini +++ b/platformio.ini @@ -133,6 +133,7 @@ build_flags = ${arduino_base.build_flags} -D STM32_PLATFORM -I src/helpers/stm32 -I $PROJECT_PACKAGES_DIR/framework-arduinoststm32/libraries/SubGhz/src + -fpermissive build_src_filter = ${arduino_base.build_src_filter} + lib_deps = ${arduino_base.lib_deps} diff --git a/src/helpers/TxtDataHelpers.cpp b/src/helpers/TxtDataHelpers.cpp index d327931f..05d72ab8 100644 --- a/src/helpers/TxtDataHelpers.cpp +++ b/src/helpers/TxtDataHelpers.cpp @@ -102,9 +102,16 @@ static void _ftoa(float f, char *p, int *status) *p++ = '0'; else { - ltoa(int_part, p, 10); + #if defined(STM32_PLATFORM) + int written = snprintf(p, 16, "%" PRId32, int_part); + if (written > 0) { + p += written; + } + #else + ltoa(int_part, p, 10); while (*p) p++; + #endif } *p++ = '.'; if (frac_part == 0)