Skip to content

Commit 75cd5cd

Browse files
committed
Remove BatteryPresent flag to simplify.
1 parent 8d5667d commit 75cd5cd

File tree

3 files changed

+8
-16
lines changed

3 files changed

+8
-16
lines changed

examples/UPS/UPS.ino

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,6 @@ void loop() {
8989
iPresentStatus.RemainingTimeLimitExpired = 0;
9090
}
9191

92-
iPresentStatus.BatteryPresent = 1;
93-
94-
95-
9692
//************ Delay ****************************************
9793
delay(1000);
9894
iIntTimer++;

src/HIDPowerDevice.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,6 @@ static const uint8_t _hidReportDescriptor[] PROGMEM = {
106106
0x81, 0xA3, // INPUT (Constant, Variable, Absolute, No Wrap, Linear, No Preferred, No Null Position, Bitfield)
107107
0x09, 0xD0, // USAGE (ACPresent)
108108
0xB1, 0xA3, // FEATURE (Constant, Variable, Absolute, No Wrap, Linear, No Preferred, No Null Position, Volatile, Bitfield)
109-
0x09, 0xD1, // USAGE (BatteryPresent)
110-
0x81, 0xA3, // INPUT (Constant, Variable, Absolute, No Wrap, Linear, No Preferred, No Null Position, Bitfield)
111-
0x09, 0xD1, // USAGE (BatteryPresent)
112-
0xB1, 0xA3, // FEATURE (Constant, Variable, Absolute, No Wrap, Linear, No Preferred, No Null Position, Volatile, Bitfield)
113109
0x09, 0x42, // USAGE (BelowRemainingCapacityLimit)
114110
0x81, 0xA3, // INPUT (Constant, Variable, Absolute, No Wrap, Linear, No Preferred, No Null Position, Bitfield)
115111
0x09, 0x42, // USAGE (BelowRemainingCapacityLimit)
@@ -134,7 +130,7 @@ static const uint8_t _hidReportDescriptor[] PROGMEM = {
134130
0x81, 0xA3, // INPUT (Constant, Variable, Absolute, No Wrap, Linear, No Preferred, No Null Position, Bitfield)
135131
0x09, 0x47, // USAGE (FullyDischarged)
136132
0xB1, 0xA3, // FEATURE (Constant, Variable, Absolute, No Wrap, Linear, No Preferred, No Null Position, Volatile, Bitfield)
137-
0x95, 0x06, // REPORT_COUNT (6) // padding bits to make the report byte aligned
133+
0x95, 0x07, // REPORT_COUNT (7) // padding bits to make the report byte aligned
138134
0x81, 0x01, // INPUT (Constant, Array, Absolute)
139135
0xB1, 0x01, // FEATURE (Constant, Array, Absolute, No Wrap, Linear, Preferred State, No Null Position, Nonvolatile, Bitfield)
140136
0xC0, // END_COLLECTION

src/HIDPowerDevice.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,20 +60,20 @@ struct PresentStatus {
6060
uint8_t Charging : 1; // bit 0x00
6161
uint8_t Discharging : 1; // bit 0x01
6262
uint8_t ACPresent : 1; // bit 0x02
63-
uint8_t BatteryPresent : 1; // bit 0x03
64-
uint8_t BelowRemainingCapacityLimit : 1;// bit 0x04
65-
uint8_t RemainingTimeLimitExpired : 1; // bit 0x05
66-
uint8_t NeedReplacement : 1; // bit 0x06
67-
uint8_t VoltageNotRegulated : 1; // bit 0x07
63+
uint8_t BelowRemainingCapacityLimit : 1;// bit 0x03
64+
uint8_t RemainingTimeLimitExpired : 1; // bit 0x04
65+
uint8_t NeedReplacement : 1; // bit 0x05
66+
uint8_t VoltageNotRegulated : 1; // bit 0x06
67+
uint8_t FullyCharged : 1; // bit 0x07
6868

69-
uint8_t FullyCharged : 1; // bit 0x08
70-
uint8_t FullyDischarged : 1; // bit 0x09
69+
uint8_t FullyDischarged : 1; // bit 0x08
7170
uint8_t unused1 : 1;
7271
uint8_t unused2 : 1;
7372
uint8_t unused3 : 1;
7473
uint8_t unused4 : 1;
7574
uint8_t unused5 : 1;
7675
uint8_t unused6 : 1;
76+
uint8_t unused7 : 1;
7777

7878
operator uint16_t () {
7979
return *(uint16_t*)(this); // switch to std::bit_cast after migrating to C++20

0 commit comments

Comments
 (0)