Skip to content

Commit 6611794

Browse files
committed
Remove BelowRemainingCapacityLimit, RemainingTimeLimitExpired, NeedReplacement & VoltageNotRegulated flags to simplify.
1 parent e114efb commit 6611794

File tree

3 files changed

+1
-23
lines changed

3 files changed

+1
-23
lines changed

examples/UPS/UPS.ino

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ void loop() {
8585
}
8686
else {
8787
iPresentStatus.Discharging = 0;
88-
iPresentStatus.RemainingTimeLimitExpired = 0;
8988
}
9089

9190
//************ Delay ****************************************

src/HIDPowerDevice.cpp

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -106,23 +106,7 @@ 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, 0x42, // USAGE (BelowRemainingCapacityLimit)
110-
0x81, 0xA3, // INPUT (Constant, Variable, Absolute, No Wrap, Linear, No Preferred, No Null Position, Bitfield)
111-
0x09, 0x42, // USAGE (BelowRemainingCapacityLimit)
112-
0xB1, 0xA3, // FEATURE (Constant, Variable, Absolute, No Wrap, Linear, No Preferred, No Null Position, Volatile, Bitfield)
113-
0x09, 0x43, // USAGE (RemainingTimeLimitExpired)
114-
0x81, 0xA2, // INPUT (Data, Variable, Absolute, No Wrap, Linear, No Preferred, No Null Position, Bitfield)
115-
0x09, 0x43, // USAGE (RemainingTimeLimitExpired)
116-
0xB1, 0xA2, // FEATURE (Data, Variable, Absolute, No Wrap, Linear, No Preferred, No Null Position, Volatile, Bitfield)
117-
0x09, 0x4B, // USAGE (NeedReplacement)
118-
0x81, 0xA3, // INPUT (Constant, Variable, Absolute, No Wrap, Linear, No Preferred, No Null Position, Bitfield)
119-
0x09, 0x4B, // USAGE (NeedReplacement)
120-
0xB1, 0xA3, // FEATURE (Constant, Variable, Absolute, No Wrap, Linear, No Preferred, No Null Position, Volatile, Bitfield)
121-
0x09, 0xDB, // USAGE (VoltageNotRegulated)
122-
0x81, 0xA3, // INPUT (Constant, Variable, Absolute, No Wrap, Linear, No Preferred, No Null Position, Bitfield)
123-
0x09, 0xDB, // USAGE (VoltageNotRegulated)
124-
0xB1, 0xA3, // FEATURE (Constant, Variable, Absolute, No Wrap, Linear, No Preferred, No Null Position, Volatile, Bitfield)
125-
0x95, 0x01, // REPORT_COUNT (1) // padding bits to make the report byte aligned
109+
0x95, 0x05, // REPORT_COUNT (5) // padding bits to make the report byte aligned
126110
0x81, 0x01, // INPUT (Constant, Array, Absolute)
127111
0xB1, 0x01, // FEATURE (Constant, Array, Absolute, No Wrap, Linear, Preferred State, No Null Position, Nonvolatile, Bitfield)
128112
0xC0, // END_COLLECTION

src/HIDPowerDevice.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,6 @@ 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 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 unused1 : 1; // bit 0x07
6863

6964
operator uint8_t () {
7065
return *(uint8_t*)(this); // switch to std::bit_cast after migrating to C++20

0 commit comments

Comments
 (0)