kopia lustrzana https://github.com/espressif/esp-idf
Merge branch 'bugfix/corrected_typo_in_example_peripherals_usb_device' into 'master'
example: peripherals/usb/device: fix typo naming of local variables See merge request espressif/esp-idf!19080pull/9408/head
commit
6cab124d7c
|
@ -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.
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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");
|
||||
|
|
Ładowanie…
Reference in New Issue