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

This commit is contained in:
jiangguangming 2022-07-19 10:57:04 +08:00
parent af928313ab
commit a7ce9ba63c
3 changed files with 6 additions and 6 deletions

View File

@ -93,7 +93,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,
@ -102,7 +102,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

@ -34,8 +34,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

@ -54,7 +54,7 @@ void app_main(void)
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,
@ -64,7 +64,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,