Skip to content

Commit 2f48964

Browse files
committed
SIMPLIFY: Remove iDeviceChemistry from HID descriptor.
1 parent 78330a9 commit 2f48964

File tree

3 files changed

+0
-16
lines changed

3 files changed

+0
-16
lines changed

examples/UPS/UPS.ino

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@
88

99
int iIntTimer=0;
1010

11-
12-
// String constants
13-
const char STRING_DEVICECHEMISTRY[] PROGMEM = "LiP";
14-
15-
const byte bDeviceChemistry = IDEVICECHEMISTRY;
16-
1711
PresentStatus iPresentStatus = {}, iPreviousStatus = {};
1812

1913
byte bCapacityMode = 1; // unit: 0=mAh, 1=mWh, 2=%
@@ -48,8 +42,6 @@ void setup() {
4842
PowerDevice.setFeature(HID_PD_CAPACITYMODE, &bCapacityMode, sizeof(bCapacityMode));
4943
PowerDevice.setFeature(HID_PD_VOLTAGE, &iVoltage, sizeof(iVoltage));
5044

51-
PowerDevice.setStringFeature(HID_PD_IDEVICECHEMISTRY, &bDeviceChemistry, STRING_DEVICECHEMISTRY);
52-
5345
PowerDevice.setFeature(HID_PD_DESIGNCAPACITY, &iDesignCapacity, sizeof(iDesignCapacity));
5446
PowerDevice.setFeature(HID_PD_FULLCHRGECAPACITY, &iFullChargeCapacity, sizeof(iFullChargeCapacity));
5547
PowerDevice.setFeature(HID_PD_REMAININGCAPACITY, &iRemaining, sizeof(iRemaining));

src/HIDPowerDevice.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ static const uint8_t _hidReportDescriptor[] PROGMEM = {
4747
0x79, IMANUFACTURER, // STRING INDEX (1)
4848
0xB1, 0x23, // FEATURE (Constant, Variable, Absolute, No Wrap, Linear, No Preferred, No Null Position, Nonvolatile, Bitfield)
4949
0x05, 0x85, // USAGE_PAGE (Battery System) ====================
50-
0x85, HID_PD_IDEVICECHEMISTRY, // REPORT_ID (31)
51-
0x09, 0x89, // USAGE (iDeviceChemistry)
52-
0x79, IDEVICECHEMISTRY, // STRING INDEX (4)
53-
0xB1, 0x23, // FEATURE (Constant, Variable, Absolute, No Wrap, Linear, No Preferred, No Null Position, Nonvolatile, Bitfield)
5450
0x85, HID_PD_CAPACITYMODE, // REPORT_ID (22)
5551
0x09, 0x2C, // USAGE (CapacityMode)
5652
0xB1, 0x23, // FEATURE (Constant, Variable, Absolute, No Wrap, Linear, No Preferred, No Null Position, Nonvolatile, Bitfield)

src/HIDPowerDevice.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141

4242
#define HID_PD_IPRODUCT 0x01 // FEATURE ONLY
4343
#define HID_PD_MANUFACTURER 0x03 // FEATURE ONLY
44-
#define IDEVICECHEMISTRY 0x04
4544

4645
#define HID_PD_PRESENTSTATUS 0x07 // INPUT OR FEATURE(required by Windows)
4746
#define HID_PD_VOLTAGE 0x0B // 11 INPUT (NA) OR FEATURE(implemented)
@@ -50,9 +49,6 @@
5049
#define HID_PD_CAPACITYMODE 0x16
5150
#define HID_PD_DESIGNCAPACITY 0x17
5251

53-
#define HID_PD_IDEVICECHEMISTRY 0x1F // Feature
54-
55-
5652
// PresentStatus dynamic flags
5753
struct PresentStatus {
5854
uint8_t Charging : 1; // bit 0x00

0 commit comments

Comments
 (0)