We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e5df22a commit 78330a9Copy full SHA for 78330a9
examples/UPS/UPS.ino
@@ -20,7 +20,6 @@ byte bCapacityMode = 1; // unit: 0=mAh, 1=mWh, 2=%
20
21
// Physical parameters
22
uint16_t iVoltage =1499; // centiVolt
23
-uint16_t iManufacturerDate = 0; // initialized in setup function
24
25
// Parameters for ACPI compliancy
26
const uint32_t iDesignCapacity = 58003*360/iVoltage; // AmpSec=mWh*360/centiVolt (1 mAh = 3.6 As)
@@ -54,10 +53,6 @@ void setup() {
54
53
PowerDevice.setFeature(HID_PD_DESIGNCAPACITY, &iDesignCapacity, sizeof(iDesignCapacity));
55
PowerDevice.setFeature(HID_PD_FULLCHRGECAPACITY, &iFullChargeCapacity, sizeof(iFullChargeCapacity));
56
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));
61
}
62
63
void loop() {
src/HIDPowerDevice.cpp
@@ -68,11 +68,6 @@ static const uint8_t _hidReportDescriptor[] PROGMEM = {
68
0x81, 0xA3, // INPUT (Constant, Variable, Absolute, No Wrap, Linear, No Preferred, No Null Position, Bitfield)
69
0x09, 0x66, // USAGE (RemainingCapacity)
70
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)
76
0x05, 0x84, // USAGE_PAGE (Power Device) ====================
77
0x85, HID_PD_VOLTAGE, // REPORT_ID (11)
78
0x09, 0x30, // USAGE (Voltage)
src/HIDPowerDevice.h
@@ -44,7 +44,6 @@
44
#define IDEVICECHEMISTRY 0x04
45
46
#define HID_PD_PRESENTSTATUS 0x07 // INPUT OR FEATURE(required by Windows)
47
-#define HID_PD_MANUFACTUREDATE 0x09
48
#define HID_PD_VOLTAGE 0x0B // 11 INPUT (NA) OR FEATURE(implemented)
49
#define HID_PD_REMAININGCAPACITY 0x0C // 12 INPUT OR FEATURE(required by Windows)
50
#define HID_PD_FULLCHRGECAPACITY 0x0E // 14 FEATURE ONLY. Last Full Charge Capacity
0 commit comments