USB: make use of standard byte order functions
[bertos.git] / bertos / drv / usb_keyboard.c
index 89264c8e4c96fe5db3b1fa4ee1d8b1579ed2d8b0..69ad6417d3099eadaab86a397039b32cdbd36ef5 100644 (file)
@@ -155,11 +155,12 @@ static const usb_hid_descriptor_t usb_hid_descriptor =
 {
        .bLength = sizeof(usb_hid_descriptor),
        .bDescriptorType = HID_DT_HID,
-       .bcdHID = usb_cpu_to_le16(0x0110),
+       .bcdHID = usb_cpu_to_le16((uint16_t)0x0110),
        .bCountryCode = 0,
        .bNumDescriptors = 1,
        .bDescriptorHidType = HID_DT_REPORT,
-       .wDescriptorLength = usb_cpu_to_le16(sizeof(hid_report_descriptor)),
+       .wDescriptorLength =
+               usb_cpu_to_le16((uint16_t)sizeof(hid_report_descriptor)),
 };
 
 static const UsbEndpointDesc usb_hid_ep_descriptor =
@@ -168,7 +169,7 @@ static const UsbEndpointDesc usb_hid_ep_descriptor =
        .bDescriptorType = USB_DT_ENDPOINT,
        .bEndpointAddress = USB_HID_REPORT_EP,
        .bmAttributes = USB_ENDPOINT_XFER_INT,
-       .wMaxPacketSize = usb_cpu_to_le16(4),
+       .wMaxPacketSize = usb_cpu_to_le16((uint16_t)4),
        .bInterval = 10, /* resolution in ms */
 };