@@ -1927,18 +1927,18 @@ void BleGamepad::setMotionControls(int16_t gX, int16_t gY, int16_t gZ, int16_t a
1927
1927
1928
1928
void BleGamepad::setPowerStateAll (uint8_t batteryPowerInformation, uint8_t dischargingState, uint8_t chargingState, uint8_t powerLevel)
1929
1929
{
1930
- uint8_t powerStateBits = B00000000 ;
1930
+ uint8_t powerStateBits = 0b00000000 ;
1931
1931
1932
1932
_batteryPowerInformation = batteryPowerInformation;
1933
1933
_dischargingState = dischargingState;
1934
1934
_chargingState = chargingState;
1935
1935
_powerLevel = powerLevel;
1936
1936
1937
1937
// HID Battery Power State Bits:
1938
- // Bits 0 and 1: Battery Power Information : 0(B00 ) = Unknown, 1(B01 ) = Not Supported, 2(B10 ) = Not Present, 3(B11 ) = Present
1939
- // Bits 2 and 3: Discharging State : 0(B00 ) = Unknown, 1(B01 ) = Not Supported, 2(B10 ) = Not Discharging, 3(B11 ) = Discharging
1940
- // Bits 4 and 5: Charging State : 0(B00 ) = Unknown, 1(B01 ) = Not Chargeable, 2(B10 ) = Not Charging (Chargeable), 3(B11 ) = Charging (Chargeable)
1941
- // Bits 6 and 7: Power Level : 0(B00 ) = Unknown, 1(B01 ) = Not Supported, 2(B10 ) = Good Level, 3(B11 ) = Critically Low Level
1938
+ // Bits 0 and 1: Battery Power Information : 0(0b00 ) = Unknown, 1(0b01 ) = Not Supported, 2(0b10 ) = Not Present, 3(0b11 ) = Present
1939
+ // Bits 2 and 3: Discharging State : 0(0b00 ) = Unknown, 1(0b01 ) = Not Supported, 2(0b10 ) = Not Discharging, 3(0b11 ) = Discharging
1940
+ // Bits 4 and 5: Charging State : 0(0b00 ) = Unknown, 1(0b01 ) = Not Chargeable, 2(0b10 ) = Not Charging (Chargeable), 3(0b11 ) = Charging (Chargeable)
1941
+ // Bits 6 and 7: Power Level : 0(0b00 ) = Unknown, 1(0b01 ) = Not Supported, 2(0b10 ) = Good Level, 3(0b11 ) = Critically Low Level
1942
1942
1943
1943
powerStateBits |= (_batteryPowerInformation << 0 ); // Populate first 2 bits with data
1944
1944
powerStateBits |= (_dischargingState << 2 ); // Populate second 2 bits with data
@@ -2039,7 +2039,7 @@ void BleGamepad::taskServer(void *pvParameter)
2039
2039
NIMBLE_PROPERTY::READ | NIMBLE_PROPERTY::NOTIFY
2040
2040
);
2041
2041
BleGamepadInstance->pCharacteristic_Power_State = pCharacteristic_Power_State; // Assign the created characteristic
2042
- BleGamepadInstance->pCharacteristic_Power_State ->setValue (B00000000 ); // Now it's safe to call setValue <- Set all to unknown by default
2042
+ BleGamepadInstance->pCharacteristic_Power_State ->setValue (0b00000000 ); // Now it's safe to call setValue <- Set all to unknown by default
2043
2043
2044
2044
BleGamepadInstance->hid ->setPnp (0x01 , vid, pid, guidVersion);
2045
2045
BleGamepadInstance->hid ->setHidInfo (0x00 , 0x01 );
0 commit comments