@@ -1927,18 +1927,18 @@ void BleGamepad::setMotionControls(int16_t gX, int16_t gY, int16_t gZ, int16_t a
19271927
19281928void BleGamepad::setPowerStateAll (uint8_t batteryPowerInformation, uint8_t dischargingState, uint8_t chargingState, uint8_t powerLevel)
19291929{
1930- uint8_t powerStateBits = B00000000 ;
1930+ uint8_t powerStateBits = 0b00000000 ;
19311931
19321932 _batteryPowerInformation = batteryPowerInformation;
19331933 _dischargingState = dischargingState;
19341934 _chargingState = chargingState;
19351935 _powerLevel = powerLevel;
19361936
19371937 // 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
19421942
19431943 powerStateBits |= (_batteryPowerInformation << 0 ); // Populate first 2 bits with data
19441944 powerStateBits |= (_dischargingState << 2 ); // Populate second 2 bits with data
@@ -2039,7 +2039,7 @@ void BleGamepad::taskServer(void *pvParameter)
20392039 NIMBLE_PROPERTY::READ | NIMBLE_PROPERTY::NOTIFY
20402040 );
20412041 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
20432043
20442044 BleGamepadInstance->hid ->setPnp (0x01 , vid, pid, guidVersion);
20452045 BleGamepadInstance->hid ->setHidInfo (0x00 , 0x01 );
0 commit comments