Add breaks to switch/case statements.

This commit is contained in:
Daniel
2023-05-16 04:36:45 -07:00
parent 1dfd568b05
commit 58998da466

View File

@@ -13,11 +13,13 @@ void AXP192Component::setup()
case AXP192_M5STICKC:
{
begin(false, false, false, false, false);
break;
}
case AXP192_M5CORE2:
{
// disable LDO3 Vibration
begin(false, true, false, false, false);
break;
}
case AXP192_M5TOUGH:
{
@@ -30,7 +32,8 @@ void AXP192Component::setup()
// Reboot the ESP with the axp initialised
ESP.restart();
}
}
break;
}
}
}
@@ -69,6 +72,7 @@ void AXP192Component::begin(bool disableLDO2, bool disableLDO3, bool disableRTC,
{
// Set LDO2 & LDO3(TFT_LED & TFT) 3.0V
Write1Byte(0x28, 0xcc);
break;
}
case AXP192_M5CORE2:
{
@@ -76,6 +80,7 @@ void AXP192Component::begin(bool disableLDO2, bool disableLDO3, bool disableRTC,
Write1Byte(0x27, 0xcc);
// Set LDO2 & LDO3(TFT_LED & TFT) 3.0V
Write1Byte(0x28, 0xcc);
break;
}
case AXP192_M5TOUGH:
{
@@ -83,6 +88,7 @@ void AXP192Component::begin(bool disableLDO2, bool disableLDO3, bool disableRTC,
Write1Byte(0x27, 0xcc);
// Set LDO2 & LDO3(TFT_LED & TFT) 3.0V
Write1Byte(0x28, 0xcc);
break;
}
}
@@ -226,16 +232,19 @@ void AXP192Component::UpdateBrightness()
{
uint8_t buf = Read8bit( 0x28 );
Write1Byte( 0x28 , ((buf & 0x0f) | (ubri << 4)) );
break;
}
case AXP192_M5CORE2:
{
uint8_t buf = Read8bit( 0x27 );
Write1Byte( 0x27 , ((buf & 0x80) | (ubri << 3)) );
Write1Byte( 0x27 , ((buf & 0x80) | (ubri << 3)) );
break;
}
case AXP192_M5TOUGH:
{
uint8_t buf = Read8bit( 0x27 );
Write1Byte( 0x27 , ((buf & 0x80) | (ubri << 3)) );
Write1Byte( 0x27 , ((buf & 0x80) | (ubri << 3)) );
break;
}
}
}