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

Fix attenuation for some ESP32 pins #2144

Merged
merged 1 commit into from Apr 4, 2023

Conversation

pkendall64
Copy link
Collaborator

During the testing of a new target, it was found that some ADC pins are not using the 0dB attenuation that we have set our code up for, so this always sets the attenuation to 0dB for ADC pins used for VBAT measurement on ESP32 devices.

Also whilst testing said new target, it was found that at low voltages (1S i.e. 3.8V) the VBAT code was setting it to zero. This was simply a bug using the wrong scale value for the cutoff calculation. As the median calculator discards the min/max values from it's calculation so the sum is actually based on the MedianAvgFilter's scale NOT the configured number of elements in the moving average window.

Fix scale when checking low voltage scenarios
Copy link
Member

@CapnBry CapnBry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yarrrrrg! This was my mistake on both counts. Thank you

@JyeSmith JyeSmith merged commit a800803 into ExpressLRS:master Apr 4, 2023
38 checks passed
@pkendall64 pkendall64 deleted the vbat-fixes branch April 13, 2023 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants