Fixed battery charging and USB detection

This commit is contained in:
Richard Li
2025-01-24 19:00:12 +01:00
committed by Malte Langermann
parent 48d0ec49ed
commit 11c0bb55e0
4 changed files with 21 additions and 4 deletions
+4
View File
@@ -237,6 +237,10 @@ int usbPlugged()
static uint8_t lastState = 0;
uint8_t state = gpio_read(UCHARGER_GPIO) ? 1 : 0;
#if defined(UCHARGER_GPIO_PIN_INV)
state = !state;
#endif
if (state == lastState)
debouncedState = state;
else