Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change CapacityMode from 2 (%) to 1 (mWh) #14

Closed
wants to merge 1 commit into from

Commits on Sep 3, 2024

  1. Change CapacityMode from 2 (%) to 1 (mWh)

    This fixes abratchik#11 by also reporting battery capacity percentage on Windows laptops that already has a battery. This makes the sample more interesting to demonstrate.
    
    The `CapacityMode` units are documented in [Usage Tables for HID Power Devices](https://www.usb.org/sites/default/files/pdcv11.pdf) section 4.2.3 Battery Controls.
    
    The total battery charge % reported by Windows appear to be a weighted sum of each battery, weighted by their respective capacities. The Arduino battery is currently harcoded to `iFullChargeCapacity = 100` mWh, which is quite small. It does therefore have a relatively low influence on the total battery charge % on the laptop I've tested on.
    forderud committed Sep 3, 2024
    Configuration menu
    Copy the full SHA
    3743e0a View commit details
    Browse the repository at this point in the history