Skip to content

Commit d69d3ad

Browse files
committed
nicla-system: Rename function name.
1 parent 56b67be commit d69d3ad

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

libraries/Nicla_System/examples/NiclaSenseME_BatteryStatus/NiclaSenseME_BatteryStatus.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ bool updateBatteryLevel(bool enforceNewReading = false) {
2424
if (intervalFired || isFirstReading || enforceNewReading) {
2525
Serial.println("Checking the battery level...");
2626
updateTimestamp = millis();
27-
auto percentage = nicla::getBatteryPercentage();
27+
auto percentage = nicla::getBatteryVoltagePercentage();
2828

2929
if (percentage < 0) {
3030
return false; // Percentage couldn't be determined.
@@ -209,7 +209,7 @@ void loop()
209209
Serial.println(voltage);
210210

211211
Serial.print("Battery Percent: ");
212-
auto percent = nicla::getBatteryPercentage();
212+
auto percent = nicla::getBatteryVoltagePercentage();
213213
Serial.println(percent);
214214

215215
Serial.print("Battery Temperature: ");

libraries/Nicla_System/src/Nicla_System.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,14 +206,14 @@ void nicla::setRegulatedBatteryVoltage(float voltage){
206206
}
207207

208208
float nicla::getCurrentBatteryVoltage(){
209-
auto percentage = getBatteryPercentage();
209+
auto percentage = getBatteryVoltagePercentage();
210210
if (percentage < 0) {
211211
return 0;
212212
}
213213
return getRegulatedBatteryVoltage() / 100 * percentage;
214214
}
215215

216-
int8_t nicla::getBatteryPercentage(bool useLatchedValue) {
216+
int8_t nicla::getBatteryVoltagePercentage(bool useLatchedValue) {
217217
/*
218218
* 9.3.4 Voltage Based Battery Monitor (Page 20)
219219
* The device implements a simple voltage battery monitor which can be used to determine the depth of discharge.
@@ -293,7 +293,7 @@ int8_t nicla::getBatteryPercentage(bool useLatchedValue) {
293293
}
294294

295295
BatteryChargeLevel nicla::getBatteryChargeLevel() {
296-
auto percent = getBatteryPercentage();
296+
auto percent = getBatteryVoltagePercentage();
297297

298298
if (percent >= 98) {
299299
return BatteryChargeLevel::Full;

libraries/Nicla_System/src/Nicla_System.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class nicla {
9797
* @return int8_t The percentage of the regulated voltage in the range of 60% to 100%.
9898
* A value of < 0 indicates that the battery percentage could not be determined.
9999
*/
100-
static int8_t getBatteryPercentage(bool useLatchedValue = false);
100+
static int8_t getBatteryVoltagePercentage(bool useLatchedValue = false);
101101

102102
/**
103103
* @brief Get the Battery Charge level encoded as a number (0-5). The following values are possible:

0 commit comments

Comments
 (0)