Skip to content
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

chore(dsm): remove always zero sensors, use thread safe functions #5835

Merged
merged 4 commits into from
Jan 25, 2025

Conversation

frankiearzu
Copy link
Contributor

@frankiearzu frankiearzu commented Jan 25, 2025

Fixes #5834

Summary of changes:

  1. Replace calls for "sprintf" who internally use "malloc" for more basic formatting and concatenation functions. Someone recommended this change since malloc could not be thread-safe for the telemetry thread.

  2. Remove unused (or always 0) Smart Battery sensors. Even after using a "smart" charger with "smart" batteries, seems that they are not populating the telemetry values properly.

  • Cycl: (Charger Cycles) comes as 0,
  • BUse (MAh used) comes as 0,
  • CLMa (Cell max v) comes as 0

This helps reduce the list of sensors, especially useful for B&W radios.

remove "sprintf" and use more basic and efficient functions.  looks like sprintf uses malloc that is not recommended to be used in the telemetry thread.
Remove Smart battery sensors who are not used or always come as 0.
@frankiearzu
Copy link
Contributor Author

Before:
image

remove trying to decode SmartBattery ID info as well as Charging Limits
@frankiearzu
Copy link
Contributor Author

After:
image
FM works ok with the new formatting, and the unused sensors no longer shows

@frankiearzu frankiearzu changed the title Tel (Improvement): Spektrum Telemetry Chore: Spektrum Telemetry Improvements Jan 25, 2025
@pfeerick pfeerick added telemetry 📶 house keeping 🧹 Cleanup of code and house keeping labels Jan 25, 2025
@pfeerick pfeerick added this to the 2.11 milestone Jan 25, 2025
@pfeerick pfeerick changed the title Chore: Spektrum Telemetry Improvements chore(dsm): remove always zero sensors, use thread safe functions Jan 25, 2025
@pfeerick pfeerick merged commit 6464b9b into EdgeTX:main Jan 25, 2025
51 checks passed
@frankiearzu frankiearzu deleted the Spketrum_Tel_2 branch January 25, 2025 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
house keeping 🧹 Cleanup of code and house keeping telemetry 📶
Projects
None yet
Development

Successfully merging this pull request may close these issues.

chore(tel): Spektrum Telemetry Improvements
2 participants