Skip to content

Commit b739f05

Browse files
committed
pbio/drv/usb_ev3: Implement wait for connection.
This lets the UI display the connection state correctly when connected or unplugged.
1 parent 147023e commit b739f05

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

lib/pbio/drv/usb/usb_ev3.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -989,12 +989,11 @@ void pbdrv_usb_init_device(void) {
989989
}
990990

991991
pbio_error_t pbdrv_usb_wait_until_configured(pbio_os_state_t *state) {
992-
return PBIO_ERROR_NOT_SUPPORTED;
992+
return pbdrv_usb_config ? PBIO_SUCCESS : PBIO_ERROR_AGAIN;
993993
}
994994

995995
bool pbdrv_usb_is_ready(void) {
996-
// REVISIT: Return whether physically plugged in.
997-
return true;
996+
return pbdrv_usb_config;
998997
}
999998

1000999
pbdrv_usb_bcd_t pbdrv_usb_get_bcd(void) {

0 commit comments

Comments
 (0)