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

Read voltage during init fixes #5276 #5332

Merged

Conversation

Blake-Latchford
Copy link
Contributor

Power::readPowerStatus is called on startup,
but AnalogBatteryLevel::getBattVoltage
skips the read because 5 seconds have not
elapsed since last_read_time_ms, which
is initialized to zero.

batMv=3100 is reported because
AnalogBatteryLevel::last_read_value is
initialized as:

float last_read_value = (OCV[NUM_OCV_POINTS - 1] * NUM_CELLS);

Power::readPowerStatus is called on startup,
but AnalogBatteryLevel::getBattVoltage
skips the read because 5 seconds have not
elapsed since last_read_time_ms, which
is initialized to zero.

`batMv=3100` is reported because
AnalogBatteryLevel::last_read_value is
initialized as:
```
float last_read_value = (OCV[NUM_OCV_POINTS - 1] * NUM_CELLS);
```
@CLAassistant
Copy link

CLAassistant commented Nov 13, 2024

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@Blake-Latchford
Copy link
Contributor Author

Apologies for posting this a bit early. My first meshtastic device arrives tomorrow, so I should be able to test this then.

@fifieldt
Copy link
Contributor

No problem at all! Welcome to Meshtastic :)

Copy link
Contributor

@todd-herbert todd-herbert left a comment

Choose a reason for hiding this comment

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

Well spotted! Tested without issue on Heltec Wireless Paper

@thebentern thebentern merged commit 8fcfe7f into meshtastic:master Nov 13, 2024
43 of 47 checks passed
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.

5 participants