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 11// This file is part of the CircuitPython project: https://circuitpython.org
22//
33// SPDX-FileCopyrightText: Copyright (c) 2022 Scott Shawcroft for Adafruit Industries
4+ // SPDX-FileCopyrightText: Copyright (c) 2025 Sam Blenny
45//
56// SPDX-License-Identifier: MIT
67
@@ -70,14 +71,18 @@ void common_hal_usb_core_device_deinit(usb_core_device_obj_t *self) {
7071uint16_t common_hal_usb_core_device_get_idVendor (usb_core_device_obj_t * self ) {
7172 uint16_t vid ;
7273 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+ }
7477 return vid ;
7578}
7679
7780uint16_t common_hal_usb_core_device_get_idProduct (usb_core_device_obj_t * self ) {
7881 uint16_t vid ;
7982 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+ }
8186 return pid ;
8287}
8388
You can’t perform that action at this time.
0 commit comments