USBD_LL_OpenEP(pdev, 0x81, USBD_EP_TYPE_BULK, 64);
pdev->ep_in[1].maxpacket = 64;
- // USBD_LL_PrepareReceive(pdev, 0x01, xxx_rx_buf, 64);
- USBD_LL_Transmit(pdev, 0x81, "brum", 4);
+ USBD_LL_PrepareReceive(pdev, 0x01, xxx_rx_buf, 64);
+ USBD_LL_Transmit(pdev, 0x81, (uint8_t *) "brum", 4);
return USBD_OK;
}
{
USBD_EndpointTypeDef *pep = &pdev->ep_out[1];
unsigned int len = USBD_LL_GetRxDataSize(pdev, 0x01);
+
+ USBD_LL_PrepareReceive(pdev, 0x01, xxx_rx_buf, 64);
return USBD_OK;
}
return USBD_OK;
}
-// FIXME: constify
-static uint8_t xxx_cfg_desc[] = {
+static const uint8_t xxx_cfg_desc[] = {
// Configuration descriptor
9, // bLength
USB_DESC_TYPE_CONFIGURATION, // bDescriptorType
static uint8_t *xxx_get_cfg_desc(uint16_t *len)
{
*len = sizeof(xxx_cfg_desc);
- return xxx_cfg_desc;
+ return (uint8_t *) xxx_cfg_desc;
}
-// FIXME: constify
-static uint8_t xxx_qual_desc[] = {
+static const uint8_t xxx_qual_desc[] = {
10, // bLength
USB_DESC_TYPE_DEVICE_QUALIFIER, // bDescriptorType
0x00, 0x02, // bcdUSB
static uint8_t *xxx_get_dev_qual_desc(uint16_t *len)
{
*len = sizeof(xxx_qual_desc);
- return xxx_qual_desc;
+ return (uint8_t *) xxx_qual_desc;
}
static uint8_t *xxx_get_usr_string_desc(USBD_HandleTypeDef *pdev, uint8_t index, uint16_t *len)
return NULL;
}
-USBD_ClassTypeDef xxx_class = {
+const USBD_ClassTypeDef xxx_class = {
xxx_init,
xxx_deinit,
xxx_setup,
USBD_DFU_RegisterMedia(&hUsbDeviceFS, &USBD_DFU_fops_FS);
#else
- USBD_RegisterClass(&hUsbDeviceFS, &xxx_class);
+ USBD_RegisterClass(&hUsbDeviceFS, (USBD_ClassTypeDef *) &xxx_class);
#endif
USBD_Start(&hUsbDeviceFS);