fix(el18): Prevent power on when USB is disconnected while radio is charging (#3325)
This commit is contained in:
@@ -195,19 +195,23 @@ void boardInit()
|
|||||||
if (UNEXPECTED_SHUTDOWN()) {
|
if (UNEXPECTED_SHUTDOWN()) {
|
||||||
pwrOn();
|
pwrOn();
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// prime debounce state...
|
// prime debounce state...
|
||||||
usbPlugged();
|
uint8_t usb_state = usbPlugged();
|
||||||
|
usb_state |= usbPlugged();
|
||||||
while (usbPlugged()) {
|
while (usb_state) {
|
||||||
|
pwrOn();
|
||||||
uint32_t now = get_tmr10ms();
|
uint32_t now = get_tmr10ms();
|
||||||
if (pwrPressed()) {
|
if (pwrPressed()) {
|
||||||
press_end = now;
|
press_end = now;
|
||||||
if (press_start == 0) press_start = now;
|
if (press_start == 0) press_start = now;
|
||||||
if ((now - press_start) > POWER_ON_DELAY) {
|
if ((now - press_start) > POWER_ON_DELAY) {
|
||||||
pwrOn();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
} else if (!usbPlugged()){
|
||||||
|
delay_ms(20);
|
||||||
|
if(!usbPlugged()){
|
||||||
|
boardOff();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
uint32_t press_end_touch = press_end;
|
uint32_t press_end_touch = press_end;
|
||||||
if (touchPanelEventOccured()) {
|
if (touchPanelEventOccured()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user