Skip to content

Commit 78330a9

Browse files
committed
SIMPLIFY: Remove ManufacturerDate from HID descriptor.
1 parent e5df22a commit 78330a9

File tree

3 files changed

+0
-11
lines changed

3 files changed

+0
-11
lines changed

examples/UPS/UPS.ino

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ byte bCapacityMode = 1; // unit: 0=mAh, 1=mWh, 2=%
2020

2121
// Physical parameters
2222
uint16_t iVoltage =1499; // centiVolt
23-
uint16_t iManufacturerDate = 0; // initialized in setup function
2423

2524
// Parameters for ACPI compliancy
2625
const uint32_t iDesignCapacity = 58003*360/iVoltage; // AmpSec=mWh*360/centiVolt (1 mAh = 3.6 As)
@@ -54,10 +53,6 @@ void setup() {
5453
PowerDevice.setFeature(HID_PD_DESIGNCAPACITY, &iDesignCapacity, sizeof(iDesignCapacity));
5554
PowerDevice.setFeature(HID_PD_FULLCHRGECAPACITY, &iFullChargeCapacity, sizeof(iFullChargeCapacity));
5655
PowerDevice.setFeature(HID_PD_REMAININGCAPACITY, &iRemaining, sizeof(iRemaining));
57-
58-
uint16_t year = 2024, month = 10, day = 12;
59-
iManufacturerDate = (year - 1980)*512 + month*32 + day; // from 4.2.6 Battery Settings in "Universal Serial Bus Usage Tables for HID Power Devices"
60-
PowerDevice.setFeature(HID_PD_MANUFACTUREDATE, &iManufacturerDate, sizeof(iManufacturerDate));
6156
}
6257

6358
void loop() {

src/HIDPowerDevice.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,6 @@ static const uint8_t _hidReportDescriptor[] PROGMEM = {
6868
0x81, 0xA3, // INPUT (Constant, Variable, Absolute, No Wrap, Linear, No Preferred, No Null Position, Bitfield)
6969
0x09, 0x66, // USAGE (RemainingCapacity)
7070
0xB1, 0xA3, // FEATURE (Constant, Variable, Absolute, No Wrap, Linear, No Preferred, No Null Position, Volatile, Bitfield)
71-
0x85, HID_PD_MANUFACTUREDATE, // REPORT_ID (9)
72-
0x09, 0x85, // USAGE (ManufacturerDate)
73-
0x75, 0x10, // REPORT_SIZE (16)
74-
0x27, 0xFF, 0xFF, 0x00, 0x00, // LOGICAL_MAXIMUM (65534)
75-
0xB1, 0xA3, // FEATURE (Constant, Variable, Absolute, No Wrap, Linear, No Preferred, No Null Position, Volatile, Bitfield)
7671
0x05, 0x84, // USAGE_PAGE (Power Device) ====================
7772
0x85, HID_PD_VOLTAGE, // REPORT_ID (11)
7873
0x09, 0x30, // USAGE (Voltage)

src/HIDPowerDevice.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
#define IDEVICECHEMISTRY 0x04
4545

4646
#define HID_PD_PRESENTSTATUS 0x07 // INPUT OR FEATURE(required by Windows)
47-
#define HID_PD_MANUFACTUREDATE 0x09
4847
#define HID_PD_VOLTAGE 0x0B // 11 INPUT (NA) OR FEATURE(implemented)
4948
#define HID_PD_REMAININGCAPACITY 0x0C // 12 INPUT OR FEATURE(required by Windows)
5049
#define HID_PD_FULLCHRGECAPACITY 0x0E // 14 FEATURE ONLY. Last Full Charge Capacity

0 commit comments

Comments
 (0)