From 4c91690d8de713dfba78fa2452c93e033f626572 Mon Sep 17 00:00:00 2001 From: paulchilton Date: Sat, 31 Dec 2022 20:41:23 +0000 Subject: [PATCH] Update axp192.cpp --- components/axp192/axp192.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/components/axp192/axp192.cpp b/components/axp192/axp192.cpp index 981bcca..a0adc26 100644 --- a/components/axp192/axp192.cpp +++ b/components/axp192/axp192.cpp @@ -229,7 +229,12 @@ void AXP192Component::UpdateBrightness() case AXP192_M5CORE2: { uint8_t buf = Read8bit( 0x27 ); - Write1Byte( 0x27 , ((buf & 0x80) | (ubri << 3)) ); + Write1Byte( 0x27 , ((buf & 0x80) | (ubri << 3)) ); + } + case AXP192_M5TOUGH: + { + uint8_t buf = Read8bit( 0x27 ); + Write1Byte( 0x27 , ((buf & 0x80) | (ubri << 3)) ); } } } @@ -563,7 +568,6 @@ void AXP192Component::SetLDO3(bool State) Write1Byte( 0x12 , buf ); } - void AXP192Component::SetChargeCurrent(uint8_t current) { uint8_t buf = Read8bit(0x33); @@ -603,6 +607,7 @@ std::string AXP192InitComponent::GetStartupReason() { return "ESP_SLEEP_WAKEUP_UART"; return std::string{"WAKEUP_UNKNOWN_REASON"}; } + if (reset_reason == ESP_RST_UNKNOWN) return "ESP_RST_UNKNOWN"; if (reset_reason == ESP_RST_POWERON)