Add breaks to switch/case statements.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user