File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 1
1
// This file is part of the CircuitPython project: https://circuitpython.org
2
2
//
3
3
// SPDX-FileCopyrightText: Copyright (c) 2022 Scott Shawcroft for Adafruit Industries
4
+ // SPDX-FileCopyrightText: Copyright (c) 2025 Sam Blenny
4
5
//
5
6
// SPDX-License-Identifier: MIT
6
7
@@ -70,14 +71,18 @@ void common_hal_usb_core_device_deinit(usb_core_device_obj_t *self) {
70
71
uint16_t common_hal_usb_core_device_get_idVendor (usb_core_device_obj_t * self ) {
71
72
uint16_t vid ;
72
73
uint16_t pid ;
73
- tuh_vid_pid_get (self -> device_address , & vid , & pid );
74
+ if (!tuh_vid_pid_get (self -> device_address , & vid , & pid )) {
75
+ mp_raise_usb_core_USBError (NULL );
76
+ }
74
77
return vid ;
75
78
}
76
79
77
80
uint16_t common_hal_usb_core_device_get_idProduct (usb_core_device_obj_t * self ) {
78
81
uint16_t vid ;
79
82
uint16_t pid ;
80
- tuh_vid_pid_get (self -> device_address , & vid , & pid );
83
+ if (!tuh_vid_pid_get (self -> device_address , & vid , & pid )) {
84
+ mp_raise_usb_core_USBError (NULL );
85
+ }
81
86
return pid ;
82
87
}
83
88
You can’t perform that action at this time.
0 commit comments