example: peripherals/usb: fix typo naming of local variables

This commit is contained in:
jiangguangming 2022-07-18 11:11:25 +08:00
parent 3c2c9206dd
commit e0d9220a6e
4 changed files with 12 additions and 12 deletions

View File

@ -103,7 +103,7 @@ If the CDC option is enabled in Menuconfig, the USB Serial Device could be initi
.. code-block:: c
tinyusb_config_cdcacm_t amc_cfg = {
tinyusb_config_cdcacm_t acm_cfg = {
.usb_dev = TINYUSB_USBDEV_0,
.cdc_port = TINYUSB_CDC_ACM_0,
.rx_unread_buf_sz = 64,
@ -112,7 +112,7 @@ If the CDC option is enabled in Menuconfig, the USB Serial Device could be initi
.callback_line_state_changed = NULL,
.callback_line_coding_changed = NULL
};
tusb_cdc_acm_init(&amc_cfg);
tusb_cdc_acm_init(&acm_cfg);
To specify callbacks you can either set the pointer to your :cpp:type:`tusb_cdcacm_callback_t` function in the configuration structure or call :cpp:func:`tinyusb_cdcacm_register_callback` after initialization.

View File

@ -31,8 +31,8 @@ void app_main(void)
tinyusb_config_t tusb_cfg = { 0 }; // the configuration uses default values
ESP_ERROR_CHECK(tinyusb_driver_install(&tusb_cfg));
tinyusb_config_cdcacm_t amc_cfg = { 0 }; // the configuration uses default values
ESP_ERROR_CHECK(tusb_cdc_acm_init(&amc_cfg));
tinyusb_config_cdcacm_t acm_cfg = { 0 }; // the configuration uses default values
ESP_ERROR_CHECK(tusb_cdc_acm_init(&acm_cfg));
ESP_LOGI(TAG, "USB initialization DONE");
while (1) {

View File

@ -47,7 +47,7 @@ void app_main(void)
const tinyusb_config_t tusb_cfg = {}; // the configuration using default values
ESP_ERROR_CHECK(tinyusb_driver_install(&tusb_cfg));
tinyusb_config_cdcacm_t amc_cfg = {
tinyusb_config_cdcacm_t acm_cfg = {
.usb_dev = TINYUSB_USBDEV_0,
.cdc_port = TINYUSB_CDC_ACM_0,
.rx_unread_buf_sz = 64,
@ -57,7 +57,7 @@ void app_main(void)
.callback_line_coding_changed = NULL
};
ESP_ERROR_CHECK(tusb_cdc_acm_init(&amc_cfg));
ESP_ERROR_CHECK(tusb_cdc_acm_init(&acm_cfg));
/* the second way to register a callback */
ESP_ERROR_CHECK(tinyusb_cdcacm_register_callback(
TINYUSB_CDC_ACM_0,
@ -65,8 +65,8 @@ void app_main(void)
&tinyusb_cdc_line_state_changed_callback));
#if (CONFIG_TINYUSB_CDC_COUNT > 1)
amc_cfg.cdc_port = TINYUSB_CDC_ACM_1;
ESP_ERROR_CHECK(tusb_cdc_acm_init(&amc_cfg));
acm_cfg.cdc_port = TINYUSB_CDC_ACM_1;
ESP_ERROR_CHECK(tusb_cdc_acm_init(&acm_cfg));
ESP_ERROR_CHECK(tinyusb_cdcacm_register_callback(
TINYUSB_CDC_ACM_1,
CDC_EVENT_LINE_STATE_CHANGED,

View File

@ -51,7 +51,7 @@ void run_usb_dual_cdc_device(void)
};
ESP_ERROR_CHECK(tinyusb_driver_install(&tusb_cfg));
tinyusb_config_cdcacm_t amc_cfg = {
tinyusb_config_cdcacm_t acm_cfg = {
.usb_dev = TINYUSB_USBDEV_0,
.cdc_port = TINYUSB_CDC_ACM_0,
.rx_unread_buf_sz = 64,
@ -61,10 +61,10 @@ void run_usb_dual_cdc_device(void)
.callback_line_coding_changed = NULL
};
ESP_ERROR_CHECK(tusb_cdc_acm_init(&amc_cfg));
ESP_ERROR_CHECK(tusb_cdc_acm_init(&acm_cfg));
#if (CONFIG_TINYUSB_CDC_COUNT > 1)
amc_cfg.cdc_port = TINYUSB_CDC_ACM_1;
ESP_ERROR_CHECK(tusb_cdc_acm_init(&amc_cfg));
acm_cfg.cdc_port = TINYUSB_CDC_ACM_1;
ESP_ERROR_CHECK(tusb_cdc_acm_init(&acm_cfg));
#endif
printf("USB initialization DONE\n");