VirtualBox

Changeset 14464 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Nov 21, 2008 3:03:53 PM (16 years ago)
Author:
vboxsync
Message:

PDM_ACPI_BAT_STATE_DISCHARGING / PDM_ACPI_BAT_STATE_CHARGING mixed up

Location:
trunk/src/VBox/Devices/PC
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/DevACPI.cpp

    r13079 r14464  
    142142#define BAT_TECH_PRIMARY                        1
    143143#define BAT_TECH_SECONDARY                      2
    144 
    145 #define BAT_STATUS_DISCHARGING_MASK             RT_BIT(0)
    146 #define BAT_STATUS_CHARGING_MASK                RT_BIT(1)
    147 #define BAT_STATUS_CRITICAL_MASK                RT_BIT(2)
    148144
    149145#define STA_DEVICE_PRESENT_MASK                 RT_BIT(0)
  • trunk/src/VBox/Devices/PC/DrvACPI.cpp

    r12642 r14464  
    211211        uint32_t uBs = PDM_ACPI_BAT_STATE_CHARGED;
    212212        if (powerStatus.BatteryFlag & 8)
     213            uBs = PDM_ACPI_BAT_STATE_CHARGING;
     214        else if (powerStatus.ACLineStatus == 0 || powerStatus.ACLineStatus == 255)
    213215            uBs = PDM_ACPI_BAT_STATE_DISCHARGING;
    214         else if (powerStatus.ACLineStatus == 0 || powerStatus.ACLineStatus == 255)
    215             uBs = PDM_ACPI_BAT_STATE_CHARGING;
    216216        if (powerStatus.BatteryFlag & 4)
    217217            uBs |= PDM_ACPI_BAT_STATE_CRITICAL;
     
    396396    uint32_t uBs = PDM_ACPI_BAT_STATE_CHARGED;
    397397    if (fDischarging)
     398        uBs = PDM_ACPI_BAT_STATE_DISCHARGING;
     399    else if (fCharging)
    398400        uBs = PDM_ACPI_BAT_STATE_CHARGING;
    399     else if (fCharging)
    400         uBs = PDM_ACPI_BAT_STATE_DISCHARGING;
    401401    if (fCritical)
    402402        uBs |= PDM_ACPI_BAT_STATE_CRITICAL;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette