Skip to content

Commit

Permalink
Switch to using HIDPowerDevice_::sendDate method now that the method …
Browse files Browse the repository at this point in the history
…have been fixed.
  • Loading branch information
forderud committed Oct 14, 2024
1 parent 6ed895a commit ed41a0a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions examples/UPS/UPS.ino
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ uint16_t iAvgTimeToEmpty = 7200;
uint16_t iRemainTimeLimit = 600;
int16_t iDelayBe4Reboot = -1;
int16_t iDelayBe4ShutDown = -1;
uint16_t iManufacturerDate = 0; // initialized in setup function
byte iAudibleAlarmCtrl = 2; // 1 - Disabled, 2 - Enabled, 3 - Muted


Expand Down Expand Up @@ -92,9 +91,7 @@ void setup() {
PowerDevice.setFeature(HID_PD_CPCTYGRANULARITY1, &bCapacityGranularity1, sizeof(bCapacityGranularity1));
PowerDevice.setFeature(HID_PD_CPCTYGRANULARITY2, &bCapacityGranularity2, sizeof(bCapacityGranularity2));

uint16_t year = 2024, month = 10, day = 12;
iManufacturerDate = (year - 1980)*512 + month*32 + day; // from 4.2.6 Battery Settings in "Universal Serial Bus Usage Tables for HID Power Devices"
PowerDevice.setFeature(HID_PD_MANUFACTUREDATE, &iManufacturerDate, sizeof(iManufacturerDate));
PowerDevice.sendDate(HID_PD_MANUFACTUREDATE, 2024, 10, 12);
}

void loop() {
Expand Down

0 comments on commit ed41a0a

Please sign in to comment.