summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2019-06-25 15:43:54 +1000
committerDamien George <damien.p.george@gmail.com>2019-06-25 15:43:54 +1000
commitd21d57864426d56fa13104e82568fe94dcf079ab (patch)
treec94eca42a46ee5e5e902ce3f3dfeb6a8b6ec5970
parent2f262d5f9a8a77ec611548162100d6df8e9703c0 (diff)
stm32/usb: Fix regression with auto USB PID value giving PID=0xffff.
Commit 9e68eec8eac1188eab0bc059560b877928783978 introduced a regression where the PID of the USB device would be 0xffff if the default value was used. This commit fixes that by using a signed int type.
-rw-r--r--ports/stm32/usb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ports/stm32/usb.c b/ports/stm32/usb.c
index 2807d512b..69ba26c43 100644
--- a/ports/stm32/usb.c
+++ b/ports/stm32/usb.c
@@ -302,7 +302,7 @@ STATIC mp_obj_t pyb_usb_mode(size_t n_args, const mp_obj_t *pos_args, mp_map_t *
// note: PID=-1 means select PID based on mode
// note: we support CDC as a synonym for VCP for backward compatibility
uint16_t vid = args[ARG_vid].u_int;
- uint16_t pid = args[ARG_pid].u_int;
+ mp_int_t pid = args[ARG_pid].u_int;
uint8_t mode;
if (strcmp(mode_str, "CDC+MSC") == 0 || strcmp(mode_str, "VCP+MSC") == 0) {
if (pid == -1) {