diff options
| author | Ha Thach <[email protected]> | 2025-10-29 19:15:53 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-10-29 19:15:53 +0700 |
| commit | 3ff54153d42c83fc0a1e13106c6632c3237b1670 (patch) | |
| tree | a6ec29546beafa69c752a8b6dfad5c2b809633cd /examples/device/usbtmc/src | |
| parent | a6efc7d722f7869da76cf70e37ebf3593c66484e (diff) | |
| parent | 78bd6230649aee3f7731ffbce603742f31c2295e (diff) | |
Merge pull request #3320 from hathach/more-sast
fix warnings
Diffstat (limited to 'examples/device/usbtmc/src')
| -rw-r--r-- | examples/device/usbtmc/src/usb_descriptors.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/device/usbtmc/src/usb_descriptors.c b/examples/device/usbtmc/src/usb_descriptors.c index d03c64102..16bd176f8 100644 --- a/examples/device/usbtmc/src/usb_descriptors.c +++ b/examples/device/usbtmc/src/usb_descriptors.c @@ -34,9 +34,9 @@ * Auto ProductID layout's Bitmap: * [MSB] HID | MSC | CDC [LSB] */ -#define _PID_MAP(itf, n) ( (CFG_TUD_##itf) << (n) ) -#define USB_PID (0x4000 | _PID_MAP(CDC, 0) | _PID_MAP(MSC, 1) | _PID_MAP(HID, 2) | \ - _PID_MAP(MIDI, 3) | _PID_MAP(VENDOR, 4) ) +#define PID_MAP(itf, n) ((CFG_TUD_##itf) ? (1 << (n)) : 0) +#define USB_PID (0x4000 | PID_MAP(CDC, 0) | PID_MAP(MSC, 1) | PID_MAP(HID, 2) | \ + PID_MAP(MIDI, 3) | PID_MAP(VENDOR, 4) ) #define USB_VID 0xcafe #define USB_BCD 0x0200 |
