stm32/usb: Fix regression with auto USB PID value giving PID=0xffff.

Commit 9e68eec8ea 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.
pull/4715/head
Damien George 2019-06-25 15:43:54 +10:00
rodzic 2f262d5f9a
commit d21d578644
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -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) {