From e12c25ec2c6d1cb0dd3c02bdc1947ae351ccad54 Mon Sep 17 00:00:00 2001 From: hathach Date: Thu, 11 Feb 2021 12:05:22 +0700 Subject: [PATCH 1/2] rename dfu_rt to dfu_runtime for easy reading also rename tud_dfu_rt_reboot_to_dfu to tud_dfu_runtime_reboot_to_dfu_cb --- examples/device/dfu_rt/src/main.c | 2 +- examples/device/dfu_rt/src/tusb_config.h | 2 +- src/class/dfu/dfu_rt_device.c | 4 ++-- src/class/dfu/dfu_rt_device.h | 2 +- src/device/usbd.c | 4 ++-- src/tusb.h | 2 +- src/tusb_option.h | 4 ++-- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/examples/device/dfu_rt/src/main.c b/examples/device/dfu_rt/src/main.c index 029ff7312..823c71ae5 100644 --- a/examples/device/dfu_rt/src/main.c +++ b/examples/device/dfu_rt/src/main.c @@ -112,7 +112,7 @@ void tud_resume_cb(void) } // Invoked on DFU_DETACH request to reboot to the bootloader -void tud_dfu_rt_reboot_to_dfu(void) +void tud_dfu_runtime_reboot_to_dfu_cb(void) { blink_interval_ms = BLINK_DFU_MODE; } diff --git a/examples/device/dfu_rt/src/tusb_config.h b/examples/device/dfu_rt/src/tusb_config.h index abdbe7526..bdae1d2e9 100644 --- a/examples/device/dfu_rt/src/tusb_config.h +++ b/examples/device/dfu_rt/src/tusb_config.h @@ -78,7 +78,7 @@ //------------- CLASS -------------// -#define CFG_TUD_DFU_RT 1 +#define CFG_TUD_DFU_RUNTIME 1 #ifdef __cplusplus } diff --git a/src/class/dfu/dfu_rt_device.c b/src/class/dfu/dfu_rt_device.c index 38644615a..5700615be 100644 --- a/src/class/dfu/dfu_rt_device.c +++ b/src/class/dfu/dfu_rt_device.c @@ -26,7 +26,7 @@ #include "tusb_option.h" -#if (TUSB_OPT_DEVICE_ENABLED && CFG_TUD_DFU_RT) +#if (TUSB_OPT_DEVICE_ENABLED && CFG_TUD_DFU_RUNTIME) #include "dfu_rt_device.h" #include "device/usbd_pvt.h" @@ -110,7 +110,7 @@ bool dfu_rtd_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_request { case DFU_REQUEST_DETACH: tud_control_status(rhport, request); - tud_dfu_rt_reboot_to_dfu(); + tud_dfu_runtime_reboot_to_dfu_cb(); break; case DFU_REQUEST_GETSTATUS: diff --git a/src/class/dfu/dfu_rt_device.h b/src/class/dfu/dfu_rt_device.h index 643e25d8f..cff43d035 100644 --- a/src/class/dfu/dfu_rt_device.h +++ b/src/class/dfu/dfu_rt_device.h @@ -58,7 +58,7 @@ typedef enum //--------------------------------------------------------------------+ // Invoked when received new data -TU_ATTR_WEAK void tud_dfu_rt_reboot_to_dfu(void); // TODO rename to _cb convention +TU_ATTR_WEAK void tud_dfu_runtime_reboot_to_dfu_cb(void); //--------------------------------------------------------------------+ // Internal Class Driver API diff --git a/src/device/usbd.c b/src/device/usbd.c index d871a53d4..f4e4e08f3 100644 --- a/src/device/usbd.c +++ b/src/device/usbd.c @@ -175,9 +175,9 @@ static usbd_class_driver_t const _usbd_driver[] = }, #endif - #if CFG_TUD_DFU_RT + #if CFG_TUD_DFU_RUNTIME { - DRIVER_NAME("DFU-RT") + DRIVER_NAME("DFU-RUNTIME") .init = dfu_rtd_init, .reset = dfu_rtd_reset, .open = dfu_rtd_open, diff --git a/src/tusb.h b/src/tusb.h index 8b0dd103c..cc82c440d 100644 --- a/src/tusb.h +++ b/src/tusb.h @@ -92,7 +92,7 @@ #include "class/usbtmc/usbtmc_device.h" #endif - #if CFG_TUD_DFU_RT + #if CFG_TUD_DFU_RUNTIME #include "class/dfu/dfu_rt_device.h" #endif diff --git a/src/tusb_option.h b/src/tusb_option.h index 73daf8592..6cbdefbf1 100644 --- a/src/tusb_option.h +++ b/src/tusb_option.h @@ -233,8 +233,8 @@ #define CFG_TUD_USBTMC 0 #endif -#ifndef CFG_TUD_DFU_RT - #define CFG_TUD_DFU_RT 0 +#ifndef CFG_TUD_DFU_RUNTIME + #define CFG_TUD_DFU_RUNTIME 0 #endif #ifndef CFG_TUD_NET From d2f3e70b64f4f40e70599816668de3bcaa59f086 Mon Sep 17 00:00:00 2001 From: hathach Date: Thu, 11 Feb 2021 12:08:09 +0700 Subject: [PATCH 2/2] rename examples folder dfu_rt to dfu_runtime --- .github/workflows/build.yml | 2 +- examples/device/{dfu_rt => dfu_runtime}/CMakeLists.txt | 0 examples/device/{dfu_rt => dfu_runtime}/Makefile | 0 examples/device/{dfu_rt => dfu_runtime}/src/main.c | 0 examples/device/{dfu_rt => dfu_runtime}/src/tusb_config.h | 0 examples/device/{dfu_rt => dfu_runtime}/src/usb_descriptors.c | 0 6 files changed, 1 insertion(+), 1 deletion(-) rename examples/device/{dfu_rt => dfu_runtime}/CMakeLists.txt (100%) rename examples/device/{dfu_rt => dfu_runtime}/Makefile (100%) rename examples/device/{dfu_rt => dfu_runtime}/src/main.c (100%) rename examples/device/{dfu_rt => dfu_runtime}/src/tusb_config.h (100%) rename examples/device/{dfu_rt => dfu_runtime}/src/usb_descriptors.c (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 567f31d54..5ec29686a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -107,7 +107,7 @@ jobs: - 'device/cdc_dual_ports' - 'device/cdc_msc' - 'device/cdc_msc_freertos' - - 'device/dfu_rt' + - 'device/dfu_runtime' - 'device/hid_composite' - 'device/hid_composite_freertos' - 'device/hid_generic_inout' diff --git a/examples/device/dfu_rt/CMakeLists.txt b/examples/device/dfu_runtime/CMakeLists.txt similarity index 100% rename from examples/device/dfu_rt/CMakeLists.txt rename to examples/device/dfu_runtime/CMakeLists.txt diff --git a/examples/device/dfu_rt/Makefile b/examples/device/dfu_runtime/Makefile similarity index 100% rename from examples/device/dfu_rt/Makefile rename to examples/device/dfu_runtime/Makefile diff --git a/examples/device/dfu_rt/src/main.c b/examples/device/dfu_runtime/src/main.c similarity index 100% rename from examples/device/dfu_rt/src/main.c rename to examples/device/dfu_runtime/src/main.c diff --git a/examples/device/dfu_rt/src/tusb_config.h b/examples/device/dfu_runtime/src/tusb_config.h similarity index 100% rename from examples/device/dfu_rt/src/tusb_config.h rename to examples/device/dfu_runtime/src/tusb_config.h diff --git a/examples/device/dfu_rt/src/usb_descriptors.c b/examples/device/dfu_runtime/src/usb_descriptors.c similarity index 100% rename from examples/device/dfu_rt/src/usb_descriptors.c rename to examples/device/dfu_runtime/src/usb_descriptors.c