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)