Fixed battery charging and USB detection
This commit is contained in:
committed by
Malte Langermann
parent
48d0ec49ed
commit
11c0bb55e0
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user