Skip to content

Commit

Permalink
usb: cdc_acm: update state after RESUME event
Browse files Browse the repository at this point in the history
Update state after RESUME event.
Use LOG_INF for important events and log a
warning if the data is discarded.

Fixes zephyrproject-rtos#17488

Signed-off-by: Johann Fischer <[email protected]>
  • Loading branch information
jfischer-no authored and carlescufi committed Aug 23, 2019
1 parent 112ecb7 commit 5fb7c11
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions subsys/usb/class/cdc_acm.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,17 +408,18 @@ static void cdc_acm_do_cb(struct cdc_acm_dev_data_t *dev_data,
dev_data->tx_ready = true;
dev_data->tx_irq_ena = true;
dev_data->rx_irq_ena = true;
LOG_DBG("USB device configured");
LOG_INF("USB device configured");
break;
case USB_DC_DISCONNECTED:
LOG_DBG("USB device disconnected");
LOG_INF("USB device disconnected");
cdc_acm_reset_port(dev_data);
break;
case USB_DC_SUSPEND:
LOG_DBG("USB device suspended");
LOG_INF("USB device suspended");
break;
case USB_DC_RESUME:
LOG_DBG("USB device resumed");
dev_data->usb_status = USB_DC_CONFIGURED;
LOG_INF("USB device resumed");
break;
case USB_DC_SOF:
break;
Expand Down Expand Up @@ -548,6 +549,7 @@ static int cdc_acm_fifo_fill(struct device *dev,
dev_data, len, ring_buf_space_get(dev_data->tx_ringbuf));

if (dev_data->usb_status != USB_DC_CONFIGURED) {
LOG_WRN("Device not configured, drop %d bytes", len);
return 0;
}

Expand Down

0 comments on commit 5fb7c11

Please sign in to comment.