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

Allow NRF52 ADC overrides; begin simplifying analog battery logic #3134

Merged
merged 9 commits into from
Jan 29, 2024

Conversation

code8buster
Copy link
Contributor

A special attempt at reducing the ugliness of our getBattVoltage function, which was peppered with preprocessor macros mainly to account for ESP32 platform quirks.

I have broken almost all the ESP32 stuff into its own function, which returns the averaged raw reads.

The nrf52 macro magic happening in the variant.h files really isn't required after this, as far as I can tell. I left them in, until reviewers leave feedback that we can remove them.
The calculation still uses the same numbers, just not hidden behind 3 macros; battery readings won't be impacted.

As a happy side effect, this now allows all nrf52 platforms to use the user-configurable operativeAdcMultiplier.

@code8buster code8buster marked this pull request as ready for review January 27, 2024 14:59
thebentern added a commit to meshtastic/artifacts that referenced this pull request Jan 28, 2024
@thebentern thebentern merged commit d1ea589 into meshtastic:master Jan 29, 2024
3 checks passed
@code8buster code8buster deleted the nrf52-adc-override branch January 30, 2024 08:28
Mictronics referenced this pull request in Mictronics/meshtastic_firmware Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants