-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Unsupported use of %f in printf #21001
Fix: Unsupported use of %f in printf #21001
Conversation
Bugfix 2.0.x
Bugfix 2.0.x
Bugfix 2.0.x
Bugfix 2.0.x
Bugfix 2.0.x
Bugfix 2.0.x
Bugfix 2.0.x
Bugfix 2.0.x
Bugfix 2.0.x
Wouldn't it be easier to set the right linker flags to use the full sprintf version, instead of relying on such painful code? |
@MKS-Sean Can you take a look if it's working after Scott reviews? |
@X-Ryl669 — For now Marlin is keen to retain Arduino IDE build support, even for code (such as FSMC LCD) that theoretically might never be compiled and run on an AVR. |
What would be very useful would be a lightweight C++ string class with operator overrides that would turn our ugly string code into something more elegant. The entire codebase would benefit. I wrote my own C++ string class once many moons ago, but there are probably a million examples around that we could use as a starting-point. Our only caveat is no dynamic allocation. All buffers must be provided by the caller or allocated on the stack. But, given the ubiquity of "string stuff" it wouldn't be the worst thing to add a dedicated buffer for "current string" work, thus making many function stack frames smaller. |
* bugfix-2.0.x: (177 commits) [cron] Bump distribution date (2021-02-11) chmod and paths [cron] Bump distribution date (2021-02-10) Reheat bed first Ender 3 V2 DWIN cleanup (MarlinFirmware#21026) Update M808 comment MAX Thermocouples rework (MarlinFirmware#20447) [cron] Bump distribution date (2021-02-09) Serial refactor. Default 8-bit ECHO to int, not char (MarlinFirmware#20985) Fix STM32F1 emergency parser (MarlinFirmware#21011) Allow SERVO0_PIN override on Creality Melzi (MarlinFirmware#21007) Fix animated boot screen Fix: Unsupported use of %f in printf (MarlinFirmware#21001) Fix mini12864 v2.1 + PSU control + NeoPixel backlight (MarlinFirmware#21021) [cron] Bump distribution date (2021-02-08) Fix LVGL "more" menu user items (MarlinFirmware#21004) Fix TEMP_0_TR_ENABLE, rename temp conditions (MarlinFirmware#21016) Fix ESP32 I2S init placement (MarlinFirmware#21019) Improve RPi host kernel panic mitigation Melzi, comments cleanup ...
…rmpel/Marlin into rmpel/bugfix-2.0.x/ender-3-skr-14-turbo * 'rmpel/bugfix-2.0.x/ender-3-skr-14-turbo' of github.com:rmpel/Marlin: (177 commits) [cron] Bump distribution date (2021-02-11) chmod and paths [cron] Bump distribution date (2021-02-10) Reheat bed first Ender 3 V2 DWIN cleanup (MarlinFirmware#21026) Update M808 comment MAX Thermocouples rework (MarlinFirmware#20447) [cron] Bump distribution date (2021-02-09) Serial refactor. Default 8-bit ECHO to int, not char (MarlinFirmware#20985) Fix STM32F1 emergency parser (MarlinFirmware#21011) Allow SERVO0_PIN override on Creality Melzi (MarlinFirmware#21007) Fix animated boot screen Fix: Unsupported use of %f in printf (MarlinFirmware#21001) Fix mini12864 v2.1 + PSU control + NeoPixel backlight (MarlinFirmware#21021) [cron] Bump distribution date (2021-02-08) Fix LVGL "more" menu user items (MarlinFirmware#21004) Fix TEMP_0_TR_ENABLE, rename temp conditions (MarlinFirmware#21016) Fix ESP32 I2S init placement (MarlinFirmware#21019) Improve RPi host kernel panic mitigation Melzi, comments cleanup ...
* bugfix-2.0.x: (177 commits) [cron] Bump distribution date (2021-02-11) chmod and paths [cron] Bump distribution date (2021-02-10) Reheat bed first Ender 3 V2 DWIN cleanup (MarlinFirmware#21026) Update M808 comment MAX Thermocouples rework (MarlinFirmware#20447) [cron] Bump distribution date (2021-02-09) Serial refactor. Default 8-bit ECHO to int, not char (MarlinFirmware#20985) Fix STM32F1 emergency parser (MarlinFirmware#21011) Allow SERVO0_PIN override on Creality Melzi (MarlinFirmware#21007) Fix animated boot screen Fix: Unsupported use of %f in printf (MarlinFirmware#21001) Fix mini12864 v2.1 + PSU control + NeoPixel backlight (MarlinFirmware#21021) [cron] Bump distribution date (2021-02-08) Fix LVGL "more" menu user items (MarlinFirmware#21004) Fix TEMP_0_TR_ENABLE, rename temp conditions (MarlinFirmware#21016) Fix ESP32 I2S init placement (MarlinFirmware#21019) Improve RPi host kernel panic mitigation Melzi, comments cleanup ...
Description
When using the arduinoststm32 library (robin nano v3.0), using sprintf_P to copy float variables will make an error, but the test in the maple library is normal (robin nano v2.0)
Tested in MKS Robin nano V3.0 motherboard:
Before modification:
After modification:
Requirements
Use arduinoststm32 library (MKS Robin nano V3.0 mainboard using it).
Use sprintf_P(buf,PSTR(“%.1f”),float_var);
Benefits
LVGL UI can display float type variable parameters normally
Configurations
default_envs = mks_robin_nano_v3_usb_flash_drive_msc
Configurations.zip
Related Issues
No