usb: Fix CDC format errors
Related to https://github.com/espressif/idf-extra-components/issues/65
This commit is contained in:
parent
d7056e85ea
commit
a45de9cf24
|
@ -13,5 +13,3 @@ idf_component_register(SRCS ${srcs}
|
||||||
INCLUDE_DIRS ${include}
|
INCLUDE_DIRS ${include}
|
||||||
REQUIRES ${require}
|
REQUIRES ${require}
|
||||||
)
|
)
|
||||||
|
|
||||||
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")
|
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
|
#include "inttypes.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/queue.h>
|
#include <sys/queue.h>
|
||||||
|
@ -17,7 +18,7 @@
|
||||||
#include "esp_check.h"
|
#include "esp_check.h"
|
||||||
#include "esp_system.h"
|
#include "esp_system.h"
|
||||||
|
|
||||||
#define TAG "cdc_acm"
|
static const char *TAG = "cdc_acm";
|
||||||
|
|
||||||
// CDC devices often implement Interface Association Descriptor (IAD). Parse IAD only when
|
// CDC devices often implement Interface Association Descriptor (IAD). Parse IAD only when
|
||||||
// bDeviceClass = 0xEF (Miscellaneous Device Class), bDeviceSubClass = 0x02 (Common Class), bDeviceProtocol = 0x01 (Interface Association Descriptor)
|
// bDeviceClass = 0xEF (Miscellaneous Device Class), bDeviceSubClass = 0x02 (Common Class), bDeviceProtocol = 0x01 (Interface Association Descriptor)
|
||||||
|
@ -1102,7 +1103,7 @@ esp_err_t cdc_acm_host_line_coding_get(cdc_acm_dev_hdl_t cdc_hdl, cdc_acm_line_c
|
||||||
ESP_RETURN_ON_ERROR(
|
ESP_RETURN_ON_ERROR(
|
||||||
send_cdc_request((cdc_dev_t *)cdc_hdl, true, USB_CDC_REQ_GET_LINE_CODING, (uint8_t *)line_coding, sizeof(cdc_acm_line_coding_t), 0),
|
send_cdc_request((cdc_dev_t *)cdc_hdl, true, USB_CDC_REQ_GET_LINE_CODING, (uint8_t *)line_coding, sizeof(cdc_acm_line_coding_t), 0),
|
||||||
TAG,);
|
TAG,);
|
||||||
ESP_LOGD(TAG, "Line Get: Rate: %d, Stop bits: %d, Parity: %d, Databits: %d", line_coding->dwDTERate,
|
ESP_LOGD(TAG, "Line Get: Rate: %"PRIu32", Stop bits: %d, Parity: %d, Databits: %d", line_coding->dwDTERate,
|
||||||
line_coding->bCharFormat, line_coding->bParityType, line_coding->bDataBits);
|
line_coding->bCharFormat, line_coding->bParityType, line_coding->bDataBits);
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
@ -1114,7 +1115,7 @@ esp_err_t cdc_acm_host_line_coding_set(cdc_acm_dev_hdl_t cdc_hdl, const cdc_acm_
|
||||||
ESP_RETURN_ON_ERROR(
|
ESP_RETURN_ON_ERROR(
|
||||||
send_cdc_request((cdc_dev_t *)cdc_hdl, false, USB_CDC_REQ_SET_LINE_CODING, (uint8_t *)line_coding, sizeof(cdc_acm_line_coding_t), 0),
|
send_cdc_request((cdc_dev_t *)cdc_hdl, false, USB_CDC_REQ_SET_LINE_CODING, (uint8_t *)line_coding, sizeof(cdc_acm_line_coding_t), 0),
|
||||||
TAG,);
|
TAG,);
|
||||||
ESP_LOGD(TAG, "Line Set: Rate: %d, Stop bits: %d, Parity: %d, Databits: %d", line_coding->dwDTERate,
|
ESP_LOGD(TAG, "Line Set: Rate: %"PRIu32", Stop bits: %d, Parity: %d, Databits: %d", line_coding->dwDTERate,
|
||||||
line_coding->bCharFormat, line_coding->bParityType, line_coding->bDataBits);
|
line_coding->bCharFormat, line_coding->bParityType, line_coding->bDataBits);
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
version: "1.0.1"
|
version: "1.0.2"
|
||||||
description: USB Host CDC-ACM driver
|
description: USB Host CDC-ACM driver
|
||||||
url: https://github.com/espressif/idf-extra-components/tree/master/usb/usb_host_cdc_acm
|
url: https://github.com/espressif/idf-extra-components/tree/master/usb/usb_host_cdc_acm
|
||||||
dependencies:
|
dependencies:
|
||||||
|
|
Loading…
Reference in New Issue