Skip to content

Commit a448444

Browse files
committed
Change voltage, capacity & chemistry to more closely match an actual battery.
Using a Dell Latitude 5330 battery pack as template.
1 parent 8fdf490 commit a448444

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

examples/UPS/UPS.ino

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ int iIntTimer=0;
1010

1111

1212
// String constants
13-
const char STRING_DEVICECHEMISTRY[] PROGMEM = "PbAc";
13+
const char STRING_DEVICECHEMISTRY[] PROGMEM = "LiP";
1414
const char STRING_SERIAL[] PROGMEM = "UPS10";
1515

1616
const byte bDeviceChemistry = IDEVICECHEMISTRY;
@@ -20,14 +20,14 @@ PresentStatus iPresentStatus = {}, iPreviousStatus = {};
2020
byte bCapacityMode = 1; // unit: 0=mAh, 1=mWh, 2=%
2121

2222
// Physical parameters
23-
const uint16_t iConfigVoltage = 1380; // centiVolt
24-
uint16_t iVoltage =1300; // centiVolt
23+
const uint16_t iConfigVoltage = 1509; // centiVolt
24+
uint16_t iVoltage =1499; // centiVolt
2525
uint16_t iRunTimeToEmpty = 0, iPrevRunTimeToEmpty = 0;
2626
uint16_t iManufacturerDate = 0; // initialized in setup function
2727

2828
// Parameters for ACPI compliancy
29-
const uint32_t iDesignCapacity = 100*360/iVoltage; // AmpSec=mWh*360/centiVolt (1 mAh = 3.6 As)
30-
uint32_t iFullChargeCapacity = 100*360/iVoltage; // AmpSec=mWh*360/centiVolt (1 mAh = 3.6 As)
29+
const uint32_t iDesignCapacity = 58003*360/iVoltage; // AmpSec=mWh*360/centiVolt (1 mAh = 3.6 As)
30+
uint32_t iFullChargeCapacity = 40690*360/iVoltage; // AmpSec=mWh*360/centiVolt (1 mAh = 3.6 As)
3131

3232
uint32_t iRemaining =0, iPrevRemaining=0;
3333
bool bCharging = false;

0 commit comments

Comments
 (0)