usb: Fix BCD() macro used to set bcdDevice

According to API documentation, the bcdDevice field of the USB
descriptor is supposed to represents the Zephyr kernel major
and minor versions as a binary coded decimal value. However,
when using zephyr 2.0, bcdDevice is shown as 0.00 instead of 2.00.

This is due to a typo in the implementation of the BCD macro in
usb_commond.h. This commit fixes the macro.

Signed-off-by: Arnaud Taffanel <arnaud@bitcraze.io>
This commit is contained in:
Arnaud Taffanel 2019-11-19 16:25:30 +01:00 committed by Carles Cufí
commit a06a6da03b

View file

@ -45,7 +45,7 @@
#ifndef ZEPHYR_INCLUDE_USB_USB_COMMON_H_
#define ZEPHYR_INCLUDE_USB_USB_COMMON_H_
#define BCD(x) ((((x) / 10) << 4) | ((x) / 10))
#define BCD(x) ((((x) / 10) << 4) | ((x) % 10))
/* Descriptor size in bytes */
#define USB_DEVICE_DESC_SIZE 18