update usb enum return codes
Should have been fixed in commit 85be1e5e7b when we updated the library, but was... missed.
travis caught it after the fact at least.
This commit is contained in:
@@ -192,15 +192,15 @@ static enum usbd_request_return_codes cdcacm_control_request(usbd_device *usbd_d
|
||||
local_buf[8] = req->wValue & 3;
|
||||
local_buf[9] = 0;
|
||||
// usbd_ep_write_packet(0x83, buf, 10);
|
||||
return 1;
|
||||
return USBD_REQ_HANDLED;
|
||||
}
|
||||
case USB_CDC_REQ_SET_LINE_CODING:
|
||||
if (*len < sizeof(struct usb_cdc_line_coding))
|
||||
return 0;
|
||||
return USBD_REQ_NOTSUPP;
|
||||
|
||||
return 1;
|
||||
return USBD_REQ_HANDLED;
|
||||
}
|
||||
return 0;
|
||||
return USBD_REQ_NOTSUPP;
|
||||
}
|
||||
|
||||
static void cdcacm_data_rx_cb(usbd_device *usbd_dev, uint8_t ep)
|
||||
|
||||
@@ -174,39 +174,38 @@ static void usbdfu_getstatus_complete(usbd_device *usbd_dev, struct usb_setup_da
|
||||
}
|
||||
}
|
||||
|
||||
static int usbdfu_control_request(usbd_device *usbd_dev, struct usb_setup_data *req, uint8_t **buf,
|
||||
static enum usbd_request_return_codes usbdfu_control_request(usbd_device *usbd_dev, struct usb_setup_data *req, uint8_t **buf,
|
||||
uint16_t *len, void (**complete)(usbd_device *usbd_dev, struct usb_setup_data *req))
|
||||
{
|
||||
(void)usbd_dev;
|
||||
|
||||
if ((req->bmRequestType & 0x7F) != 0x21)
|
||||
return 0; /* Only accept class request. */
|
||||
return USBD_REQ_NOTSUPP; /* Only accept class request. */
|
||||
|
||||
switch (req->bRequest) {
|
||||
case DFU_DNLOAD:
|
||||
if ((len == NULL) || (*len == 0)) {
|
||||
usbdfu_state = STATE_DFU_MANIFEST_SYNC;
|
||||
return 1;
|
||||
} else {
|
||||
/* Copy download data for use on GET_STATUS. */
|
||||
prog.blocknum = req->wValue;
|
||||
prog.len = *len;
|
||||
memcpy(prog.buf, *buf, *len);
|
||||
usbdfu_state = STATE_DFU_DNLOAD_SYNC;
|
||||
return 1;
|
||||
}
|
||||
return USBD_REQ_HANDLED;
|
||||
case DFU_CLRSTATUS:
|
||||
/* Clear error and return to dfuIDLE. */
|
||||
if (usbdfu_state == STATE_DFU_ERROR)
|
||||
usbdfu_state = STATE_DFU_IDLE;
|
||||
return 1;
|
||||
return USBD_REQ_HANDLED;
|
||||
case DFU_ABORT:
|
||||
/* Abort returns to dfuIDLE state. */
|
||||
usbdfu_state = STATE_DFU_IDLE;
|
||||
return 1;
|
||||
return USBD_REQ_HANDLED;
|
||||
case DFU_UPLOAD:
|
||||
/* Upload not supported for now. */
|
||||
return 0;
|
||||
return USBD_REQ_NOTSUPP;
|
||||
case DFU_GETSTATUS: {
|
||||
uint32_t bwPollTimeout = 0; /* 24-bit integer in DFU class spec */
|
||||
(*buf)[0] = usbdfu_getstatus(&bwPollTimeout);
|
||||
@@ -217,16 +216,16 @@ static int usbdfu_control_request(usbd_device *usbd_dev, struct usb_setup_data *
|
||||
(*buf)[5] = 0; /* iString not used here */
|
||||
*len = 6;
|
||||
*complete = usbdfu_getstatus_complete;
|
||||
return 1;
|
||||
return USBD_REQ_HANDLED;
|
||||
}
|
||||
case DFU_GETSTATE:
|
||||
/* Return state with no state transision. */
|
||||
*buf[0] = usbdfu_state;
|
||||
*len = 1;
|
||||
return 1;
|
||||
return USBD_REQ_HANDLED;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return USBD_REQ_NOTSUPP;
|
||||
}
|
||||
|
||||
static void usbdfu_set_config(usbd_device *usbd_dev, uint16_t wValue)
|
||||
|
||||
@@ -214,13 +214,13 @@ static enum usbd_request_return_codes hid_control_request(usbd_device *dev, stru
|
||||
if((req->bmRequestType != 0x81) ||
|
||||
(req->bRequest != USB_REQ_GET_DESCRIPTOR) ||
|
||||
(req->wValue != 0x2200))
|
||||
return 0;
|
||||
return USBD_REQ_NOTSUPP;
|
||||
|
||||
/* Handle the HID report descriptor. */
|
||||
*buf = (uint8_t *)hid_report_descriptor;
|
||||
*len = sizeof(hid_report_descriptor);
|
||||
|
||||
return 1;
|
||||
return USBD_REQ_HANDLED;
|
||||
}
|
||||
|
||||
#ifdef INCLUDE_DFU_INTERFACE
|
||||
@@ -244,11 +244,11 @@ static enum usbd_request_return_codes dfu_control_request(usbd_device *dev, stru
|
||||
(void)dev;
|
||||
|
||||
if ((req->bmRequestType != 0x21) || (req->bRequest != DFU_DETACH))
|
||||
return 0; /* Only accept class request. */
|
||||
return USBD_REQ_NOTSUPP; /* Only accept class request. */
|
||||
|
||||
*complete = dfu_detach_complete;
|
||||
|
||||
return 1;
|
||||
return USBD_REQ_HANDLED;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -166,7 +166,7 @@ static const char *usb_strings[] = {
|
||||
/* Buffer to be used for control requests. */
|
||||
uint8_t usbd_control_buffer[128];
|
||||
|
||||
static int cdcacm_control_request(usbd_device *usbd_dev, struct usb_setup_data *req, uint8_t **buf,
|
||||
static enum usbd_request_return_codes cdcacm_control_request(usbd_device *usbd_dev, struct usb_setup_data *req, uint8_t **buf,
|
||||
uint16_t *len, void (**complete)(usbd_device *usbd_dev, struct usb_setup_data *req))
|
||||
{
|
||||
(void)complete;
|
||||
@@ -192,15 +192,15 @@ static int cdcacm_control_request(usbd_device *usbd_dev, struct usb_setup_data *
|
||||
local_buf[8] = req->wValue & 3;
|
||||
local_buf[9] = 0;
|
||||
// usbd_ep_write_packet(0x83, buf, 10);
|
||||
return 1;
|
||||
return USBD_REQ_HANDLED;
|
||||
}
|
||||
case USB_CDC_REQ_SET_LINE_CODING:
|
||||
if(*len < sizeof(struct usb_cdc_line_coding))
|
||||
return 0;
|
||||
return USBD_REQ_NOTSUPP;
|
||||
|
||||
return 1;
|
||||
return USBD_REQ_HANDLED;
|
||||
}
|
||||
return 0;
|
||||
return USBD_REQ_NOTSUPP;
|
||||
}
|
||||
|
||||
static void cdcacm_data_rx_cb(usbd_device *usbd_dev, uint8_t ep)
|
||||
|
||||
@@ -174,39 +174,38 @@ static void usbdfu_getstatus_complete(usbd_device *usbd_dev, struct usb_setup_da
|
||||
}
|
||||
}
|
||||
|
||||
static int usbdfu_control_request(usbd_device *usbd_dev, struct usb_setup_data *req, uint8_t **buf,
|
||||
static enum usbd_request_return_codes usbdfu_control_request(usbd_device *usbd_dev, struct usb_setup_data *req, uint8_t **buf,
|
||||
uint16_t *len, void (**complete)(usbd_device *usbd_dev, struct usb_setup_data *req))
|
||||
{
|
||||
(void)usbd_dev;
|
||||
|
||||
if ((req->bmRequestType & 0x7F) != 0x21)
|
||||
return 0; /* Only accept class request. */
|
||||
return USBD_REQ_NOTSUPP; /* Only accept class request. */
|
||||
|
||||
switch (req->bRequest) {
|
||||
case DFU_DNLOAD:
|
||||
if ((len == NULL) || (*len == 0)) {
|
||||
usbdfu_state = STATE_DFU_MANIFEST_SYNC;
|
||||
return 1;
|
||||
} else {
|
||||
/* Copy download data for use on GET_STATUS. */
|
||||
prog.blocknum = req->wValue;
|
||||
prog.len = *len;
|
||||
memcpy(prog.buf, *buf, *len);
|
||||
usbdfu_state = STATE_DFU_DNLOAD_SYNC;
|
||||
return 1;
|
||||
}
|
||||
return USBD_REQ_HANDLED;
|
||||
case DFU_CLRSTATUS:
|
||||
/* Clear error and return to dfuIDLE. */
|
||||
if (usbdfu_state == STATE_DFU_ERROR)
|
||||
usbdfu_state = STATE_DFU_IDLE;
|
||||
return 1;
|
||||
return USBD_REQ_HANDLED;
|
||||
case DFU_ABORT:
|
||||
/* Abort returns to dfuIDLE state. */
|
||||
usbdfu_state = STATE_DFU_IDLE;
|
||||
return 1;
|
||||
return USBD_REQ_HANDLED;
|
||||
case DFU_UPLOAD:
|
||||
/* Upload not supported for now. */
|
||||
return 0;
|
||||
return USBD_REQ_NOTSUPP;
|
||||
case DFU_GETSTATUS: {
|
||||
uint32_t bwPollTimeout = 0; /* 24-bit integer in DFU class spec */
|
||||
(*buf)[0] = usbdfu_getstatus(&bwPollTimeout);
|
||||
@@ -217,16 +216,16 @@ static int usbdfu_control_request(usbd_device *usbd_dev, struct usb_setup_data *
|
||||
(*buf)[5] = 0; /* iString not used here */
|
||||
*len = 6;
|
||||
*complete = usbdfu_getstatus_complete;
|
||||
return 1;
|
||||
return USBD_REQ_HANDLED;
|
||||
}
|
||||
case DFU_GETSTATE:
|
||||
/* Return state with no state transision. */
|
||||
*buf[0] = usbdfu_state;
|
||||
*len = 1;
|
||||
return 1;
|
||||
return USBD_REQ_HANDLED;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return USBD_REQ_NOTSUPP;
|
||||
}
|
||||
|
||||
static void usbdfu_set_config(usbd_device *usbd_dev, uint16_t wValue)
|
||||
|
||||
@@ -201,7 +201,7 @@ static const char *usb_strings[] = {
|
||||
/* Buffer to be used for control requests. */
|
||||
uint8_t usbd_control_buffer[128];
|
||||
|
||||
static int hid_control_request(usbd_device *dev, struct usb_setup_data *req, uint8_t **buf, uint16_t *len,
|
||||
static enum usbd_request_return_codes hid_control_request(usbd_device *dev, struct usb_setup_data *req, uint8_t **buf, uint16_t *len,
|
||||
void (**complete)(usbd_device *, struct usb_setup_data *))
|
||||
{
|
||||
(void)complete;
|
||||
@@ -210,13 +210,13 @@ static int hid_control_request(usbd_device *dev, struct usb_setup_data *req, uin
|
||||
if((req->bmRequestType != 0x81) ||
|
||||
(req->bRequest != USB_REQ_GET_DESCRIPTOR) ||
|
||||
(req->wValue != 0x2200))
|
||||
return 0;
|
||||
return USBD_REQ_NOTSUPP;
|
||||
|
||||
/* Handle the HID report descriptor. */
|
||||
*buf = (uint8_t *)hid_report_descriptor;
|
||||
*len = sizeof(hid_report_descriptor);
|
||||
|
||||
return 1;
|
||||
return USBD_REQ_HANDLED;
|
||||
}
|
||||
|
||||
#ifdef INCLUDE_DFU_INTERFACE
|
||||
@@ -231,7 +231,7 @@ static void dfu_detach_complete(usbd_device *dev, struct usb_setup_data *req)
|
||||
scb_reset_core();
|
||||
}
|
||||
|
||||
static int dfu_control_request(usbd_device *dev, struct usb_setup_data *req, uint8_t **buf, uint16_t *len,
|
||||
static enum usbd_request_return_codes dfu_control_request(usbd_device *dev, struct usb_setup_data *req, uint8_t **buf, uint16_t *len,
|
||||
void (**complete)(usbd_device *, struct usb_setup_data *))
|
||||
{
|
||||
(void)buf;
|
||||
@@ -239,11 +239,11 @@ static int dfu_control_request(usbd_device *dev, struct usb_setup_data *req, uin
|
||||
(void)dev;
|
||||
|
||||
if ((req->bmRequestType != 0x21) || (req->bRequest != DFU_DETACH))
|
||||
return 0; /* Only accept class request. */
|
||||
return USBD_REQ_NOTSUPP; /* Only accept class request. */
|
||||
|
||||
*complete = dfu_detach_complete;
|
||||
|
||||
return 1;
|
||||
return USBD_REQ_HANDLED;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -166,7 +166,7 @@ static const char *usb_strings[] = {
|
||||
/* Buffer to be used for control requests. */
|
||||
uint8_t usbd_control_buffer[128];
|
||||
|
||||
static int cdcacm_control_request(usbd_device *usbd_dev, struct usb_setup_data *req, uint8_t **buf,
|
||||
static enum usbd_request_return_codes cdcacm_control_request(usbd_device *usbd_dev, struct usb_setup_data *req, uint8_t **buf,
|
||||
uint16_t *len, void (**complete)(usbd_device *usbd_dev, struct usb_setup_data *req))
|
||||
{
|
||||
(void)complete;
|
||||
@@ -192,14 +192,14 @@ static int cdcacm_control_request(usbd_device *usbd_dev, struct usb_setup_data *
|
||||
local_buf[8] = req->wValue & 3;
|
||||
local_buf[9] = 0;
|
||||
// usbd_ep_write_packet(0x83, buf, 10);
|
||||
return 1;
|
||||
return USBD_REQ_HANDLED;
|
||||
}
|
||||
case USB_CDC_REQ_SET_LINE_CODING:
|
||||
if (*len < sizeof(struct usb_cdc_line_coding))
|
||||
return 0;
|
||||
return 1;
|
||||
return USBD_REQ_NOTSUPP;
|
||||
return USBD_REQ_HANDLED;
|
||||
}
|
||||
return 0;
|
||||
return USBD_REQ_NOTSUPP;
|
||||
}
|
||||
|
||||
static void cdcacm_data_rx_cb(usbd_device *usbd_dev, uint8_t ep)
|
||||
|
||||
@@ -176,37 +176,36 @@ static void usbdfu_getstatus_complete(usbd_device *usbd_dev, struct usb_setup_da
|
||||
}
|
||||
}
|
||||
|
||||
static int usbdfu_control_request(usbd_device *usbd_dev, struct usb_setup_data *req, uint8_t **buf,
|
||||
static enum usbd_request_return_codes usbdfu_control_request(usbd_device *usbd_dev, struct usb_setup_data *req, uint8_t **buf,
|
||||
uint16_t *len, void (**complete)(usbd_device *usbd_dev, struct usb_setup_data *req))
|
||||
{
|
||||
if ((req->bmRequestType & 0x7F) != 0x21)
|
||||
return 0; /* Only accept class request. */
|
||||
return USBD_REQ_NOTSUPP; /* Only accept class request. */
|
||||
|
||||
switch (req->bRequest) {
|
||||
case DFU_DNLOAD:
|
||||
if ((len == NULL) || (*len == 0)) {
|
||||
usbdfu_state = STATE_DFU_MANIFEST_SYNC;
|
||||
return 1;
|
||||
} else {
|
||||
/* Copy download data for use on GET_STATUS. */
|
||||
prog.blocknum = req->wValue;
|
||||
prog.len = *len;
|
||||
memcpy(prog.buf, *buf, *len);
|
||||
usbdfu_state = STATE_DFU_DNLOAD_SYNC;
|
||||
return 1;
|
||||
}
|
||||
return USBD_REQ_HANDLED;
|
||||
case DFU_CLRSTATUS:
|
||||
/* Clear error and return to dfuIDLE. */
|
||||
if (usbdfu_state == STATE_DFU_ERROR)
|
||||
usbdfu_state = STATE_DFU_IDLE;
|
||||
return 1;
|
||||
return USBD_REQ_HANDLED;
|
||||
case DFU_ABORT:
|
||||
/* Abort returns to dfuIDLE state. */
|
||||
usbdfu_state = STATE_DFU_IDLE;
|
||||
return 1;
|
||||
return USBD_REQ_HANDLED;
|
||||
case DFU_UPLOAD:
|
||||
/* Upload not supported for now. */
|
||||
return 0;
|
||||
return USBD_REQ_NOTSUPP;
|
||||
case DFU_GETSTATUS: {
|
||||
uint32_t bwPollTimeout = 0; /* 24-bit integer in DFU class spec */
|
||||
(*buf)[0] = usbdfu_getstatus(usbd_dev, &bwPollTimeout);
|
||||
@@ -217,16 +216,16 @@ static int usbdfu_control_request(usbd_device *usbd_dev, struct usb_setup_data *
|
||||
(*buf)[5] = 0; /* iString not used here */
|
||||
*len = 6;
|
||||
*complete = usbdfu_getstatus_complete;
|
||||
return 1;
|
||||
return USBD_REQ_HANDLED;
|
||||
}
|
||||
case DFU_GETSTATE:
|
||||
/* Return state with no state transision. */
|
||||
*buf[0] = usbdfu_state;
|
||||
*len = 1;
|
||||
return 1;
|
||||
return USBD_REQ_HANDLED;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return USBD_REQ_NOTSUPP;
|
||||
}
|
||||
|
||||
static void usbdfu_set_config(usbd_device *usbd_dev, uint16_t wValue)
|
||||
|
||||
@@ -176,37 +176,36 @@ static void usbdfu_getstatus_complete(usbd_device *usbd_dev, struct usb_setup_da
|
||||
}
|
||||
}
|
||||
|
||||
static int usbdfu_control_request(usbd_device *usbd_dev, struct usb_setup_data *req, uint8_t **buf,
|
||||
static enum usbd_request_return_codes usbdfu_control_request(usbd_device *usbd_dev, struct usb_setup_data *req, uint8_t **buf,
|
||||
uint16_t *len, void (**complete)(usbd_device *usbd_dev, struct usb_setup_data *req))
|
||||
{
|
||||
if ((req->bmRequestType & 0x7F) != 0x21)
|
||||
return 0; /* Only accept class request. */
|
||||
return USBD_REQ_NOTSUPP; /* Only accept class request. */
|
||||
|
||||
switch (req->bRequest) {
|
||||
case DFU_DNLOAD:
|
||||
if ((len == NULL) || (*len == 0)) {
|
||||
usbdfu_state = STATE_DFU_MANIFEST_SYNC;
|
||||
return 1;
|
||||
} else {
|
||||
/* Copy download data for use on GET_STATUS. */
|
||||
prog.blocknum = req->wValue;
|
||||
prog.len = *len;
|
||||
memcpy(prog.buf, *buf, *len);
|
||||
usbdfu_state = STATE_DFU_DNLOAD_SYNC;
|
||||
return 1;
|
||||
}
|
||||
return USBD_REQ_HANDLED;
|
||||
case DFU_CLRSTATUS:
|
||||
/* Clear error and return to dfuIDLE. */
|
||||
if (usbdfu_state == STATE_DFU_ERROR)
|
||||
usbdfu_state = STATE_DFU_IDLE;
|
||||
return 1;
|
||||
return USBD_REQ_HANDLED;
|
||||
case DFU_ABORT:
|
||||
/* Abort returns to dfuIDLE state. */
|
||||
usbdfu_state = STATE_DFU_IDLE;
|
||||
return 1;
|
||||
return USBD_REQ_HANDLED;
|
||||
case DFU_UPLOAD:
|
||||
/* Upload not supported for now. */
|
||||
return 0;
|
||||
return USBD_REQ_NOTSUPP;
|
||||
case DFU_GETSTATUS: {
|
||||
uint32_t bwPollTimeout = 0; /* 24-bit integer in DFU class spec */
|
||||
(*buf)[0] = usbdfu_getstatus(usbd_dev, &bwPollTimeout);
|
||||
@@ -217,16 +216,16 @@ static int usbdfu_control_request(usbd_device *usbd_dev, struct usb_setup_data *
|
||||
(*buf)[5] = 0; /* iString not used here */
|
||||
*len = 6;
|
||||
*complete = usbdfu_getstatus_complete;
|
||||
return 1;
|
||||
return USBD_REQ_HANDLED;
|
||||
}
|
||||
case DFU_GETSTATE:
|
||||
/* Return state with no state transision. */
|
||||
*buf[0] = usbdfu_state;
|
||||
*len = 1;
|
||||
return 1;
|
||||
return USBD_REQ_HANDLED;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return USBD_REQ_NOTSUPP;
|
||||
}
|
||||
|
||||
static void usbdfu_set_config(usbd_device *usbd_dev, uint16_t wValue)
|
||||
|
||||
@@ -77,7 +77,7 @@ const char *usb_strings[] = {
|
||||
/* Buffer to be used for control requests. */
|
||||
uint8_t usbd_control_buffer[128];
|
||||
|
||||
static int simple_control_callback(usbd_device *usbd_dev, struct usb_setup_data *req, uint8_t **buf,
|
||||
static enum usbd_request_return_codes simple_control_callback(usbd_device *usbd_dev, struct usb_setup_data *req, uint8_t **buf,
|
||||
uint16_t *len, void (**complete)(usbd_device *usbd_dev, struct usb_setup_data *req))
|
||||
{
|
||||
(void)buf;
|
||||
@@ -86,14 +86,14 @@ static int simple_control_callback(usbd_device *usbd_dev, struct usb_setup_data
|
||||
(void)usbd_dev;
|
||||
|
||||
if (req->bmRequestType != 0x40)
|
||||
return 0; /* Only accept vendor request. */
|
||||
return USBD_REQ_NOTSUPP; /* Only accept vendor request. */
|
||||
|
||||
if (req->wValue & 1)
|
||||
gpio_set(GPIOC, GPIO6);
|
||||
else
|
||||
gpio_clear(GPIOC, GPIO6);
|
||||
|
||||
return 1;
|
||||
return USBD_REQ_HANDLED;
|
||||
}
|
||||
|
||||
static void usb_set_config_cb(usbd_device *usbd_dev, uint16_t wValue)
|
||||
|
||||
@@ -167,7 +167,7 @@ static const char *usb_strings[] = {
|
||||
/* Buffer to be used for control requests. */
|
||||
uint8_t usbd_control_buffer[128];
|
||||
|
||||
static int cdcacm_control_request(usbd_device *usbd_dev, struct usb_setup_data *req, uint8_t **buf,
|
||||
static enum usbd_request_return_codes cdcacm_control_request(usbd_device *usbd_dev, struct usb_setup_data *req, uint8_t **buf,
|
||||
uint16_t *len, void (**complete)(usbd_device *usbd_dev, struct usb_setup_data *req))
|
||||
{
|
||||
(void)complete;
|
||||
@@ -193,14 +193,14 @@ static int cdcacm_control_request(usbd_device *usbd_dev, struct usb_setup_data *
|
||||
local_buf[8] = req->wValue & 3;
|
||||
local_buf[9] = 0;
|
||||
// usbd_ep_write_packet(0x83, buf, 10);
|
||||
return 1;
|
||||
return USBD_REQ_HANDLED;
|
||||
}
|
||||
case USB_CDC_REQ_SET_LINE_CODING:
|
||||
if (*len < sizeof(struct usb_cdc_line_coding))
|
||||
return 0;
|
||||
return 1;
|
||||
return USBD_REQ_NOTSUPP;
|
||||
return USBD_REQ_HANDLED;
|
||||
}
|
||||
return 0;
|
||||
return USBD_REQ_NOTSUPP;
|
||||
}
|
||||
|
||||
static void cdcacm_data_rx_cb(usbd_device *usbd_dev, uint8_t ep)
|
||||
|
||||
@@ -205,13 +205,13 @@ static enum usbd_request_return_codes cdcacm_control_request(usbd_device *usbd_d
|
||||
local_buf[8] = req->wValue & 3;
|
||||
local_buf[9] = 0;
|
||||
// usbd_ep_write_packet(0x83, buf, 10);
|
||||
return 1;
|
||||
return USBD_REQ_HANDLED;
|
||||
}
|
||||
case USB_CDC_REQ_SET_LINE_CODING:
|
||||
if(*len < sizeof(struct usb_cdc_line_coding)) {
|
||||
return 0;
|
||||
return USBD_REQ_NOTSUPP;
|
||||
}
|
||||
return 1;
|
||||
return USBD_REQ_HANDLED;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -192,14 +192,14 @@ static enum usbd_request_return_codes cdcacm_control_request(usbd_device *usbd_d
|
||||
local_buf[8] = req->wValue & 3;
|
||||
local_buf[9] = 0;
|
||||
// usbd_ep_write_packet(0x83, buf, 10);
|
||||
return 1;
|
||||
return USBD_REQ_HANDLED;
|
||||
}
|
||||
case USB_CDC_REQ_SET_LINE_CODING:
|
||||
if (*len < sizeof(struct usb_cdc_line_coding))
|
||||
return 0;
|
||||
return 1;
|
||||
return USBD_REQ_NOTSUPP;
|
||||
return USBD_REQ_HANDLED;
|
||||
}
|
||||
return 0;
|
||||
return USBD_REQ_NOTSUPP;
|
||||
}
|
||||
|
||||
static void cdcacm_data_rx_cb(usbd_device *usbd_dev, uint8_t ep)
|
||||
|
||||
@@ -167,7 +167,7 @@ static const char * usb_strings[] = {
|
||||
/* Buffer to be used for control requests. */
|
||||
uint8_t usbd_control_buffer[128];
|
||||
|
||||
static int cdcacm_control_request(usbd_device *usbd_dev,
|
||||
static enum usbd_request_return_codes cdcacm_control_request(usbd_device *usbd_dev,
|
||||
struct usb_setup_data *req, uint8_t **buf, uint16_t *len,
|
||||
void (**complete)(usbd_device *usbd_dev, struct usb_setup_data *req))
|
||||
{
|
||||
@@ -182,16 +182,16 @@ static int cdcacm_control_request(usbd_device *usbd_dev,
|
||||
* even though it's optional in the CDC spec, and we don't
|
||||
* advertise it in the ACM functional descriptor.
|
||||
*/
|
||||
return 1;
|
||||
return USBD_REQ_HANDLED;
|
||||
}
|
||||
case USB_CDC_REQ_SET_LINE_CODING:
|
||||
if (*len < sizeof(struct usb_cdc_line_coding)) {
|
||||
return 0;
|
||||
return USBD_REQ_NOTSUPP;
|
||||
}
|
||||
|
||||
return 1;
|
||||
return USBD_REQ_HANDLED;
|
||||
}
|
||||
return 0;
|
||||
return USBD_REQ_NOTSUPP;
|
||||
}
|
||||
|
||||
static void cdcacm_data_rx_cb(usbd_device *usbd_dev, uint8_t ep)
|
||||
|
||||
@@ -168,7 +168,7 @@ static const char *usb_strings[] = {
|
||||
/* Buffer to be used for control requests. */
|
||||
uint8_t usbd_control_buffer[128];
|
||||
|
||||
static int cdcacm_control_request(usbd_device *usbd_dev,
|
||||
static enum usbd_request_return_codes cdcacm_control_request(usbd_device *usbd_dev,
|
||||
struct usb_setup_data *req, uint8_t **buf, uint16_t *len,
|
||||
void (**complete)(usbd_device *usbd_dev, struct usb_setup_data *req))
|
||||
{
|
||||
@@ -183,16 +183,16 @@ static int cdcacm_control_request(usbd_device *usbd_dev,
|
||||
* even though it's optional in the CDC spec, and we don't
|
||||
* advertise it in the ACM functional descriptor.
|
||||
*/
|
||||
return 1;
|
||||
return USBD_REQ_HANDLED;
|
||||
}
|
||||
case USB_CDC_REQ_SET_LINE_CODING:
|
||||
if (*len < sizeof(struct usb_cdc_line_coding)) {
|
||||
return 0;
|
||||
return USBD_REQ_NOTSUPP;
|
||||
}
|
||||
|
||||
return 1;
|
||||
return USBD_REQ_HANDLED;
|
||||
}
|
||||
return 0;
|
||||
return USBD_REQ_NOTSUPP;
|
||||
}
|
||||
|
||||
static void cdcacm_data_rx_cb(usbd_device *usbd_dev, uint8_t ep)
|
||||
|
||||
Reference in New Issue
Block a user