From 0ca0bf1d7dc91fcc51fbdddd39a3ad6bdeb59011 Mon Sep 17 00:00:00 2001 From: xross Date: Mon, 6 Sep 2021 12:05:27 +0100 Subject: [PATCH 01/13] Added XUD_Manager() wrapper for XUD_Main() (legacy API support) --- lib_xud/api/xud.h | 11 +++++++++++ lib_xud/src/core/XUD_Main.xc | 14 ++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/lib_xud/api/xud.h b/lib_xud/api/xud.h index d5517d84..23afc1f8 100644 --- a/lib_xud/api/xud.h +++ b/lib_xud/api/xud.h @@ -154,6 +154,17 @@ int XUD_Main(/*tileref * unsafe usbtileXUD_res_t &xudres, */ XUD_EpType epTypeTableOut[], XUD_EpType epTypeTableIn[], XUD_BusSpeed_t desiredSpeed, XUD_PwrConfig pwrConfig); + +/* Legacy API support */ +__attribute__((deprecated)) int XUD_Manager(chanend c_epOut[], int noEpOut, + chanend c_epIn[], int noEpIn, + NULLABLE_RESOURCE(chanend, c_sof), + XUD_EpType epTypeTableOut[], XUD_EpType epTypeTableIn[], + NULLABLE_RESOURCE(out port, p_usb_rst), + NULLABLE_RESOURCE(clock, clk), + unsigned rstMask, + XUD_BusSpeed_t desiredSpeed, + XUD_PwrConfig pwrConfig); #endif /** diff --git a/lib_xud/src/core/XUD_Main.xc b/lib_xud/src/core/XUD_Main.xc index 95b0c0c3..78c4e8df 100755 --- a/lib_xud/src/core/XUD_Main.xc +++ b/lib_xud/src/core/XUD_Main.xc @@ -594,3 +594,17 @@ int XUD_Main(chanend c_ep_out[], int noEpOut, return 0; } +/* Legacy API support */ +int XUD_Manager(chanend c_epOut[], int noEpOut, + chanend c_epIn[], int noEpIn, + NULLABLE_RESOURCE(chanend, c_sof), + XUD_EpType epTypeTableOut[], XUD_EpType epTypeTableIn[], + NULLABLE_RESOURCE(out port, p_usb_rst), + NULLABLE_RESOURCE(clock, clk), + unsigned rstMask, + XUD_BusSpeed_t desiredSpeed, + XUD_PwrConfig pwrConfig) +{ + XUD_Main(c_xud_out, noEpOut, c_xud_in, noEpIn, c_sof, epTypeTableOut, epTypeTableIn, desiredSpeed, pwrConfig); +} + From 4f177e3a3ec67fa2a30f814775ab295cdb6f5559 Mon Sep 17 00:00:00 2001 From: xross Date: Mon, 6 Sep 2021 12:24:21 +0100 Subject: [PATCH 02/13] Moved XUD_Manager wrapper to C to allow use of deprecation attribute --- lib_xud/api/xud.h | 4 +--- lib_xud/src/core/XUD_Main.xc | 14 +------------- lib_xud/src/core/XUD_Manager.c | 16 ++++++++++++++++ 3 files changed, 18 insertions(+), 16 deletions(-) create mode 100644 lib_xud/src/core/XUD_Manager.c diff --git a/lib_xud/api/xud.h b/lib_xud/api/xud.h index 23afc1f8..5581b272 100644 --- a/lib_xud/api/xud.h +++ b/lib_xud/api/xud.h @@ -108,7 +108,6 @@ typedef enum XUD_Result XUD_RES_ERR = 2, } XUD_Result_t; -#if defined(__XC__) || defined(__DOXYGEN__) /** This performs the low-level USB I/O operations. Note that this * needs to run in a thread with at least 80 MIPS worst case execution * speed. @@ -160,12 +159,11 @@ __attribute__((deprecated)) int XUD_Manager(chanend c_epOut[], int noEpOut, chanend c_epIn[], int noEpIn, NULLABLE_RESOURCE(chanend, c_sof), XUD_EpType epTypeTableOut[], XUD_EpType epTypeTableIn[], - NULLABLE_RESOURCE(out port, p_usb_rst), + NULLABLE_RESOURCE(port, p_usb_rst), NULLABLE_RESOURCE(clock, clk), unsigned rstMask, XUD_BusSpeed_t desiredSpeed, XUD_PwrConfig pwrConfig); -#endif /** * \brief This function must be called by a thread that deals with an OUT endpoint. diff --git a/lib_xud/src/core/XUD_Main.xc b/lib_xud/src/core/XUD_Main.xc index 78c4e8df..d81eee18 100755 --- a/lib_xud/src/core/XUD_Main.xc +++ b/lib_xud/src/core/XUD_Main.xc @@ -594,17 +594,5 @@ int XUD_Main(chanend c_ep_out[], int noEpOut, return 0; } -/* Legacy API support */ -int XUD_Manager(chanend c_epOut[], int noEpOut, - chanend c_epIn[], int noEpIn, - NULLABLE_RESOURCE(chanend, c_sof), - XUD_EpType epTypeTableOut[], XUD_EpType epTypeTableIn[], - NULLABLE_RESOURCE(out port, p_usb_rst), - NULLABLE_RESOURCE(clock, clk), - unsigned rstMask, - XUD_BusSpeed_t desiredSpeed, - XUD_PwrConfig pwrConfig) -{ - XUD_Main(c_xud_out, noEpOut, c_xud_in, noEpIn, c_sof, epTypeTableOut, epTypeTableIn, desiredSpeed, pwrConfig); -} + diff --git a/lib_xud/src/core/XUD_Manager.c b/lib_xud/src/core/XUD_Manager.c new file mode 100644 index 00000000..24e0291a --- /dev/null +++ b/lib_xud/src/core/XUD_Manager.c @@ -0,0 +1,16 @@ +#include "xud.h" +#include "xccompat.h" + +/* Legacy API support */ +__attribute__((deprecated)) int XUD_Manager(chanend c_epOut[], int noEpOut, + chanend c_epIn[], int noEpIn, + NULLABLE_RESOURCE(chanend, c_sof), + XUD_EpType epTypeTableOut[], XUD_EpType epTypeTableIn[], + NULLABLE_RESOURCE(port, p_usb_rst), + NULLABLE_RESOURCE(clock, clk), + unsigned rstMask, + XUD_BusSpeed_t desiredSpeed, + XUD_PwrConfig pwrConfig) +{ + return XUD_Main(c_epOut, noEpOut, c_epIn, noEpIn, c_sof, epTypeTableOut, epTypeTableIn, desiredSpeed, pwrConfig); +} From 5dad609a4e7018034f953b7f2f561abe0d1921a7 Mon Sep 17 00:00:00 2001 From: xross Date: Mon, 6 Sep 2021 12:55:11 +0100 Subject: [PATCH 03/13] Add legacy wrapper header files --- lib_xud/api/legacy/usb_defs.h | 2 ++ lib_xud/api/legacy/usb_device.h | 2 ++ lib_xud/api/legacy/usb_std_descriptors.h | 2 ++ lib_xud/api/legacy/usb_std_requests.h | 2 ++ lib_xud/module_build_info | 3 ++- 5 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 lib_xud/api/legacy/usb_defs.h create mode 100644 lib_xud/api/legacy/usb_device.h create mode 100644 lib_xud/api/legacy/usb_std_descriptors.h create mode 100644 lib_xud/api/legacy/usb_std_requests.h diff --git a/lib_xud/api/legacy/usb_defs.h b/lib_xud/api/legacy/usb_defs.h new file mode 100644 index 00000000..1eae6c82 --- /dev/null +++ b/lib_xud/api/legacy/usb_defs.h @@ -0,0 +1,2 @@ +#include "XUD_USB_Defines.h" + diff --git a/lib_xud/api/legacy/usb_device.h b/lib_xud/api/legacy/usb_device.h new file mode 100644 index 00000000..bd132b99 --- /dev/null +++ b/lib_xud/api/legacy/usb_device.h @@ -0,0 +1,2 @@ +#include "xud_device.h" + diff --git a/lib_xud/api/legacy/usb_std_descriptors.h b/lib_xud/api/legacy/usb_std_descriptors.h new file mode 100644 index 00000000..0b87fab6 --- /dev/null +++ b/lib_xud/api/legacy/usb_std_descriptors.h @@ -0,0 +1,2 @@ +#include "xud_std_descriptors.h" + diff --git a/lib_xud/api/legacy/usb_std_requests.h b/lib_xud/api/legacy/usb_std_requests.h new file mode 100644 index 00000000..c4116f77 --- /dev/null +++ b/lib_xud/api/legacy/usb_std_requests.h @@ -0,0 +1,2 @@ +#include "xud_std_requests.h" + diff --git a/lib_xud/module_build_info b/lib_xud/module_build_info index c84082d9..7b9c753e 100644 --- a/lib_xud/module_build_info +++ b/lib_xud/module_build_info @@ -29,7 +29,8 @@ OPTIONAL_HEADERS += xud_conf.h DEPENDENT_MODULES = EXPORT_INCLUDE_DIRS = api \ - src/user + src/user \ + api/legacy INCLUDE_DIRS = $(EXPORT_INCLUDE_DIRS) \ src/core \ From 7b38f28cc88b13310d518dae6e319a782a5a2314 Mon Sep 17 00:00:00 2001 From: xross Date: Tue, 7 Sep 2021 13:35:47 +0100 Subject: [PATCH 04/13] Added DXCORE_USE_LEGACY_CLOCK_NAMING --- lib_xud/module_build_info | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib_xud/module_build_info b/lib_xud/module_build_info index 7b9c753e..ff78eac7 100644 --- a/lib_xud/module_build_info +++ b/lib_xud/module_build_info @@ -5,7 +5,8 @@ MODULE_XCC_FLAGS = $(XCC_FLAGS) \ -DREF_CLK_FREQ=100 \ -fasm-linenum \ -fcomment-asm \ - -DXUD_FULL_PIDTABLE=1 + -DXUD_FULL_PIDTABLE=1 \ + -DXCORE_USE_LEGACY_CLOCK_NAMING=1 XCC_FLAGS_XUD_IoLoop.S = $(MODULE_XCC_FLAGS) -fschedule -g0 From 233f1444b5af6ab74d23e6c1d197ce8b75eefbf5 Mon Sep 17 00:00:00 2001 From: xross Date: Tue, 7 Sep 2021 13:37:10 +0100 Subject: [PATCH 05/13] Removed duplicate include of xccompat --- lib_xud/src/core/XUD_Manager.c | 1 - 1 file changed, 1 deletion(-) diff --git a/lib_xud/src/core/XUD_Manager.c b/lib_xud/src/core/XUD_Manager.c index 24e0291a..dfaa9339 100644 --- a/lib_xud/src/core/XUD_Manager.c +++ b/lib_xud/src/core/XUD_Manager.c @@ -1,5 +1,4 @@ #include "xud.h" -#include "xccompat.h" /* Legacy API support */ __attribute__((deprecated)) int XUD_Manager(chanend c_epOut[], int noEpOut, From c1a8fbffb8a47be3c4b61250dd455ed3143e0013 Mon Sep 17 00:00:00 2001 From: xross Date: Tue, 7 Sep 2021 13:42:56 +0100 Subject: [PATCH 06/13] Added missing copyright comment --- lib_xud/src/core/XUD_Manager.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib_xud/src/core/XUD_Manager.c b/lib_xud/src/core/XUD_Manager.c index dfaa9339..b02d474f 100644 --- a/lib_xud/src/core/XUD_Manager.c +++ b/lib_xud/src/core/XUD_Manager.c @@ -1,3 +1,5 @@ +// Copyright 2011-2021 XMOS LIMITED. +// This Software is subject to the terms of the XMOS Public Licence: Version 1. #include "xud.h" /* Legacy API support */ From 37024914c1c1f45186ff37074761630bbe27d355 Mon Sep 17 00:00:00 2001 From: xross Date: Tue, 7 Sep 2021 13:56:28 +0100 Subject: [PATCH 07/13] Update example makefiles with DXCORE_USE_LEGACY_CLOCK_NAMING. Additionally removed SERIES_SUPPORT defines --- examples/AN00124_CDC_VCOM_class/Makefile | 8 ++++---- examples/AN00125_mass_storage_class/Makefile | 8 ++++---- examples/AN00126_printer_class/Makefile | 8 ++++---- examples/AN00127_video_class/Makefile | 8 ++++---- examples/AN00129_hid_class/Makefile | 2 +- examples/AN00131_CDC_EDC_class/Makefile | 8 ++++---- examples/AN00132_image_class/Makefile | 8 ++++---- examples/AN00135_test_and_measurement_class/Makefile | 8 ++++---- examples/AN00136_vendor_specific/Makefile | 8 ++++---- 9 files changed, 33 insertions(+), 33 deletions(-) diff --git a/examples/AN00124_CDC_VCOM_class/Makefile b/examples/AN00124_CDC_VCOM_class/Makefile index 42e269e1..e11b6939 100644 --- a/examples/AN00124_CDC_VCOM_class/Makefile +++ b/examples/AN00124_CDC_VCOM_class/Makefile @@ -12,16 +12,16 @@ APP_NAME = app_usb_cdc_demo # If the variable XCC_MAP_FLAGS is set it overrides the flags passed to # xcc for the final link (mapping) stage. -BUILD_FLAGS = -O3 -g -report +BUILD_FLAGS = -O3 -g -report -DXCORE_USE_LEGACY_CLOCK_NAMING=1 -XCC_FLAGS_xcore200 = $(BUILD_FLAGS) -DXUD_SERIES_SUPPORT=XUD_X200_SERIES -XCC_FLAGS_xcoreai = $(BUILD_FLAGS) +XCC_FLAGS_200 = $(BUILD_FLAGS) -DXUD_CORE_CLOCK=500 +XCC_FLAGS_AI = $(BUILD_FLAGS) -DXUD_CORE_CLOCK=600 # The TARGET variable determines what target system the application is # compiled for. It either refers to an XN file in the source directories # or a valid argument for the --target option when compiling. -ifeq ($(CONFIG),xcoreai) +ifeq ($(CONFIG),AI) TARGET = XCORE-AI-EXPLORER else TARGET = XCORE-200-EXPLORER diff --git a/examples/AN00125_mass_storage_class/Makefile b/examples/AN00125_mass_storage_class/Makefile index 35f5d7ef..7d6ee07a 100644 --- a/examples/AN00125_mass_storage_class/Makefile +++ b/examples/AN00125_mass_storage_class/Makefile @@ -12,16 +12,16 @@ APP_NAME = app_mass_storage_demo # If the variable XCC_MAP_FLAGS is set it overrides the flags passed to # xcc for the final link (mapping) stage. -BUILD_FLAGS = -O3 -report -DUSE_XSCOPE=1 -fxscope -lflash +BUILD_FLAGS = -O3 -report -DUSE_XSCOPE=1 -fxscope -lflash -DXCORE_USE_LEGACY_CLOCK_NAMING=1 -XCC_FLAGS_xcore200 = $(BUILD_FLAGS) -DXUD_SERIES_SUPPORT=XUD_X200_SERIES -XCC_FLAGS_xcoreai = $(BUILD_FLAGS) +XCC_FLAGS_200 = $(BUILD_FLAGS) -DXUD_CORE_CLOCK=500 +XCC_FLAGS_AI = $(BUILD_FLAGS) -DXUD_CORE_CLOCK=600 # The TARGET variable determines what target system the application is # compiled for. It either refers to an XN file in the source directories # or a valid argument for the --target option when compiling. -ifeq ($(CONFIG),xcoreai) +ifeq ($(CONFIG),AI) TARGET = XCORE-AI-EXPLORER else TARGET = XCORE-200-EXPLORER diff --git a/examples/AN00126_printer_class/Makefile b/examples/AN00126_printer_class/Makefile index 271b2ad9..9acb738a 100644 --- a/examples/AN00126_printer_class/Makefile +++ b/examples/AN00126_printer_class/Makefile @@ -12,16 +12,16 @@ APP_NAME = app_printer_demo # If the variable XCC_MAP_FLAGS is set it overrides the flags passed to # xcc for the final link (mapping) stage. -BUILD_FLAGS = -O3 -report -DUSE_XSCOPE=1 -fxscope +BUILD_FLAGS = -O3 -report -DUSE_XSCOPE=1 -fxscope -DXCORE_USE_LEGACY_CLOCK_NAMING=1 -XCC_FLAGS_xcore200 = $(BUILD_FLAGS) -DXUD_SERIES_SUPPORT=XUD_X200_SERIES -XCC_FLAGS_xcoreai = $(BUILD_FLAGS) +XCC_FLAGS_200 = $(BUILD_FLAGS) -DXUD_CORE_CLOCK=500 +XCC_FLAGS_AI = $(BUILD_FLAGS) -DXUD_CORE_CLOCK=600 # The TARGET variable determines what target system the application is # compiled for. It either refers to an XN file in the source directories # or a valid argument for the --target option when compiling. -ifeq ($(CONFIG),xcoreai) +ifeq ($(CONFIG),AI) TARGET = XCORE-AI-EXPLORER else TARGET = XCORE-200-EXPLORER diff --git a/examples/AN00127_video_class/Makefile b/examples/AN00127_video_class/Makefile index c5f24dc4..2c8c78df 100644 --- a/examples/AN00127_video_class/Makefile +++ b/examples/AN00127_video_class/Makefile @@ -12,16 +12,16 @@ APP_NAME = app_video_demo # If the variable XCC_MAP_FLAGS is set it overrides the flags passed to # xcc for the final link (mapping) stage. -BUILD_FLAGS = -O3 -report +BUILD_FLAGS = -O3 -report -DXCORE_USE_LEGACY_CLOCK_NAMING=1 -XCC_FLAGS_xcore200 = $(BUILD_FLAGS) -DXUD_SERIES_SUPPORT=XUD_X200_SERIES -XCC_FLAGS_xcoreai = $(BUILD_FLAGS) +XCC_FLAGS_200 = $(BUILD_FLAGS) -DXUD_CORE_CLOCK=500 +XCC_FLAGS_AI = $(BUILD_FLAGS) -DXUD_CORE_CLOCK=600 # The TARGET variable determines what target system the application is # compiled for. It either refers to an XN file in the source directories # or a valid argument for the --target option when compiling. -ifeq ($(CONFIG),xcoreai) +ifeq ($(CONFIG),AI) TARGET = XCORE-AI-EXPLORER else TARGET = XCORE-200-EXPLORER diff --git a/examples/AN00129_hid_class/Makefile b/examples/AN00129_hid_class/Makefile index a5c8c121..5cb066be 100644 --- a/examples/AN00129_hid_class/Makefile +++ b/examples/AN00129_hid_class/Makefile @@ -14,7 +14,7 @@ APP_NAME = app_hid_mouse_demo # These flags define two build configurations - one for xCORE-200 and one for # the xCORE.AI series. -BUILD_FLAGS = -O3 -report -fxscope +BUILD_FLAGS = -O3 -report -fxscope -DXCORE_USE_LEGACY_CLOCK_NAMING=1 XCC_FLAGS_200 = $(BUILD_FLAGS) -DXUD_CORE_CLOCK=500 XCC_FLAGS_AI = $(BUILD_FLAGS) -DXUD_CORE_CLOCK=600 diff --git a/examples/AN00131_CDC_EDC_class/Makefile b/examples/AN00131_CDC_EDC_class/Makefile index d7c0b808..b9e27855 100644 --- a/examples/AN00131_CDC_EDC_class/Makefile +++ b/examples/AN00131_CDC_EDC_class/Makefile @@ -12,16 +12,16 @@ APP_NAME = app_cdc_edc_demo # If the variable XCC_MAP_FLAGS is set it overrides the flags passed to # xcc for the final link (mapping) stage. -BUILD_FLAGS = -Wall -O3 -report -DUSE_XSCOPE=1 -fxscope +BUILD_FLAGS = -Wall -O3 -report -DUSE_XSCOPE=1 -fxscope -DXCORE_USE_LEGACY_CLOCK_NAMING=1 -XCC_FLAGS_xcore200 = $(BUILD_FLAGS) -DXUD_SERIES_SUPPORT=XUD_X200_SERIES -XCC_FLAGS_xcoreai = $(BUILD_FLAGS) +XCC_FLAGS_200 = $(BUILD_FLAGS) -DXUD_CORE_CLOCK=500 +XCC_FLAGS_AI = $(BUILD_FLAGS) -DXUD_CORE_CLOCK=600 # The TARGET variable determines what target system the application is # compiled for. It either refers to an XN file in the source directories # or a valid argument for the --target option when compiling. -ifeq ($(CONFIG),xcoreai) +ifeq ($(CONFIG),AI) TARGET = XCORE-AI-EXPLORER else TARGET = XCORE-200-EXPLORER diff --git a/examples/AN00132_image_class/Makefile b/examples/AN00132_image_class/Makefile index dc2fd25a..30b8217b 100644 --- a/examples/AN00132_image_class/Makefile +++ b/examples/AN00132_image_class/Makefile @@ -12,16 +12,16 @@ APP_NAME = app_usb_image_demo # If the variable XCC_MAP_FLAGS is set it overrides the flags passed to # xcc for the final link (mapping) stage. -BUILD_FLAGS = -O3 -report +BUILD_FLAGS = -O3 -report -DXCORE_USE_LEGACY_CLOCK_NAMING=1 -XCC_FLAGS_xcore200 = $(BUILD_FLAGS) -DXUD_SERIES_SUPPORT=XUD_X200_SERIES -XCC_FLAGS_xcoreai = $(BUILD_FLAGS) +XCC_FLAGS_200 = $(BUILD_FLAGS) -DXUD_CORE_CLOCK=500 +XCC_FLAGS_AI = $(BUILD_FLAGS) -DXUD_CORE_CLOCK=600 # The TARGET variable determines what target system the application is # compiled for. It either refers to an XN file in the source directories # or a valid argument for the --target option when compiling. -ifeq ($(CONFIG),xcoreai) +ifeq ($(CONFIG),AI) TARGET = XCORE-AI-EXPLORER else TARGET = XCORE-200-EXPLORER diff --git a/examples/AN00135_test_and_measurement_class/Makefile b/examples/AN00135_test_and_measurement_class/Makefile index 65052e14..db3bd0be 100644 --- a/examples/AN00135_test_and_measurement_class/Makefile +++ b/examples/AN00135_test_and_measurement_class/Makefile @@ -12,16 +12,16 @@ APP_NAME = app_test_and_measurement # If the variable XCC_MAP_FLAGS is set it overrides the flags passed to # xcc for the final link (mapping) stage. -BUILD_FLAGS = -O3 -report +BUILD_FLAGS = -O3 -report -DXCORE_USE_LEGACY_CLOCK_NAMING=1 -XCC_FLAGS_xcore200 = $(BUILD_FLAGS) -DXUD_SERIES_SUPPORT=XUD_X200_SERIES -XCC_FLAGS_xcoreai = $(BUILD_FLAGS) +XCC_FLAGS_200 = $(BUILD_FLAGS) -DXUD_CORE_CLOCK=500 +XCC_FLAGS_AI = $(BUILD_FLAGS) -DXUD_CORE_CLOCK=600 # The TARGET variable determines what target system the application is # compiled for. It either refers to an XN file in the source directories # or a valid argument for the --target option when compiling. -ifeq ($(CONFIG),xcoreai) +ifeq ($(CONFIG),AI) TARGET = XCORE-AI-EXPLORER else TARGET = XCORE-200-EXPLORER diff --git a/examples/AN00136_vendor_specific/Makefile b/examples/AN00136_vendor_specific/Makefile index 896f389f..46a29573 100644 --- a/examples/AN00136_vendor_specific/Makefile +++ b/examples/AN00136_vendor_specific/Makefile @@ -12,16 +12,16 @@ APP_NAME = app_vendor_specific_demo # If the variable XCC_MAP_FLAGS is set it overrides the flags passed to # xcc for the final link (mapping) stage. -BUILD_FLAGS = -O3 -report +BUILD_FLAGS = -O3 -report -DXCORE_USE_LEGACY_CLOCK_NAMING=1 -XCC_FLAGS_xcore200 = $(BUILD_FLAGS) -DXUD_SERIES_SUPPORT=XUD_X200_SERIES -XCC_FLAGS_xcoreai = $(BUILD_FLAGS) +XCC_FLAGS_200 = $(BUILD_FLAGS) -DXUD_CORE_CLOCK=500 +XCC_FLAGS_AI = $(BUILD_FLAGS) -DXUD_CORE_CLOCK=600 # The TARGET variable determines what target system the application is # compiled for. It either refers to an XN file in the source directories # or a valid argument for the --target option when compiling. -ifeq ($(CONFIG),xcoreai) +ifeq ($(CONFIG),AI) TARGET = XCORE-AI-EXPLORER else TARGET = XCORE-200-EXPLORER From 96e7d93b0c8b426f4e01e63746dc083701522a2a Mon Sep 17 00:00:00 2001 From: xross Date: Tue, 7 Sep 2021 16:31:37 +0100 Subject: [PATCH 08/13] Added missing copyright comments --- lib_xud/api/legacy/usb_defs.h | 2 ++ lib_xud/api/legacy/usb_device.h | 2 ++ lib_xud/api/legacy/usb_std_descriptors.h | 2 ++ lib_xud/api/legacy/usb_std_requests.h | 2 ++ 4 files changed, 8 insertions(+) diff --git a/lib_xud/api/legacy/usb_defs.h b/lib_xud/api/legacy/usb_defs.h index 1eae6c82..af9f8565 100644 --- a/lib_xud/api/legacy/usb_defs.h +++ b/lib_xud/api/legacy/usb_defs.h @@ -1,2 +1,4 @@ +// Copyright 2021 XMOS LIMITED. +// This Software is subject to the terms of the XMOS Public Licence: Version 1. #include "XUD_USB_Defines.h" diff --git a/lib_xud/api/legacy/usb_device.h b/lib_xud/api/legacy/usb_device.h index bd132b99..b3aafdb0 100644 --- a/lib_xud/api/legacy/usb_device.h +++ b/lib_xud/api/legacy/usb_device.h @@ -1,2 +1,4 @@ +// Copyright 2021 XMOS LIMITED. +// This Software is subject to the terms of the XMOS Public Licence: Version 1. #include "xud_device.h" diff --git a/lib_xud/api/legacy/usb_std_descriptors.h b/lib_xud/api/legacy/usb_std_descriptors.h index 0b87fab6..a1ae7002 100644 --- a/lib_xud/api/legacy/usb_std_descriptors.h +++ b/lib_xud/api/legacy/usb_std_descriptors.h @@ -1,2 +1,4 @@ +// Copyright 2021 XMOS LIMITED. +// This Software is subject to the terms of the XMOS Public Licence: Version 1. #include "xud_std_descriptors.h" diff --git a/lib_xud/api/legacy/usb_std_requests.h b/lib_xud/api/legacy/usb_std_requests.h index c4116f77..54dbae9e 100644 --- a/lib_xud/api/legacy/usb_std_requests.h +++ b/lib_xud/api/legacy/usb_std_requests.h @@ -1,2 +1,4 @@ +// Copyright 2021 XMOS LIMITED. +// This Software is subject to the terms of the XMOS Public Licence: Version 1. #include "xud_std_requests.h" From 13eb60bcaa55b4f40ddc99f64c11f55e0627fa5f Mon Sep 17 00:00:00 2001 From: xross Date: Thu, 9 Sep 2021 12:20:37 +0100 Subject: [PATCH 09/13] Moved XUD_Manager wrapper to xc from c --- lib_xud/api/xud.h | 4 ++-- lib_xud/src/core/XUD_Main.xc | 13 +++++++++++++ lib_xud/src/core/XUD_Manager.c | 17 ----------------- 3 files changed, 15 insertions(+), 19 deletions(-) delete mode 100644 lib_xud/src/core/XUD_Manager.c diff --git a/lib_xud/api/xud.h b/lib_xud/api/xud.h index 5581b272..2158eb1c 100644 --- a/lib_xud/api/xud.h +++ b/lib_xud/api/xud.h @@ -155,12 +155,12 @@ int XUD_Main(/*tileref * unsafe usbtileXUD_res_t &xudres, */ XUD_PwrConfig pwrConfig); /* Legacy API support */ -__attribute__((deprecated)) int XUD_Manager(chanend c_epOut[], int noEpOut, +int XUD_Manager(chanend c_epOut[], int noEpOut, chanend c_epIn[], int noEpIn, NULLABLE_RESOURCE(chanend, c_sof), XUD_EpType epTypeTableOut[], XUD_EpType epTypeTableIn[], NULLABLE_RESOURCE(port, p_usb_rst), - NULLABLE_RESOURCE(clock, clk), + NULLABLE_RESOURCE(xcore_clock_t, clk), unsigned rstMask, XUD_BusSpeed_t desiredSpeed, XUD_PwrConfig pwrConfig); diff --git a/lib_xud/src/core/XUD_Main.xc b/lib_xud/src/core/XUD_Main.xc index d81eee18..00cfffb3 100755 --- a/lib_xud/src/core/XUD_Main.xc +++ b/lib_xud/src/core/XUD_Main.xc @@ -594,5 +594,18 @@ int XUD_Main(chanend c_ep_out[], int noEpOut, return 0; } +/* Legacy API support */ +int XUD_Manager(chanend c_epOut[], int noEpOut, + chanend c_epIn[], int noEpIn, + NULLABLE_RESOURCE(chanend, c_sof), + XUD_EpType epTypeTableOut[], XUD_EpType epTypeTableIn[], + NULLABLE_RESOURCE(port, p_usb_rst), + NULLABLE_RESOURCE(clock, clk), + unsigned rstMask, + XUD_BusSpeed_t desiredSpeed, + XUD_PwrConfig pwrConfig) +{ + return XUD_Main(c_epOut, noEpOut, c_epIn, noEpIn, c_sof, epTypeTableOut, epTypeTableIn, desiredSpeed, pwrConfig); +} diff --git a/lib_xud/src/core/XUD_Manager.c b/lib_xud/src/core/XUD_Manager.c deleted file mode 100644 index b02d474f..00000000 --- a/lib_xud/src/core/XUD_Manager.c +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2011-2021 XMOS LIMITED. -// This Software is subject to the terms of the XMOS Public Licence: Version 1. -#include "xud.h" - -/* Legacy API support */ -__attribute__((deprecated)) int XUD_Manager(chanend c_epOut[], int noEpOut, - chanend c_epIn[], int noEpIn, - NULLABLE_RESOURCE(chanend, c_sof), - XUD_EpType epTypeTableOut[], XUD_EpType epTypeTableIn[], - NULLABLE_RESOURCE(port, p_usb_rst), - NULLABLE_RESOURCE(clock, clk), - unsigned rstMask, - XUD_BusSpeed_t desiredSpeed, - XUD_PwrConfig pwrConfig) -{ - return XUD_Main(c_epOut, noEpOut, c_epIn, noEpIn, c_sof, epTypeTableOut, epTypeTableIn, desiredSpeed, pwrConfig); -} From 2337437eeee6a657a6649a94947c7e8a4c36a03b Mon Sep 17 00:00:00 2001 From: xross Date: Fri, 10 Sep 2021 11:10:57 +0100 Subject: [PATCH 10/13] Removed un-required defines from example makefiles --- examples/AN00124_CDC_VCOM_class/Makefile | 6 +++--- examples/AN00125_mass_storage_class/Makefile | 6 +++--- examples/AN00126_printer_class/Makefile | 6 +++--- examples/AN00127_video_class/Makefile | 6 +++--- examples/AN00129_hid_class/Makefile | 6 +++--- examples/AN00131_CDC_EDC_class/Makefile | 6 +++--- examples/AN00132_image_class/Makefile | 6 +++--- examples/AN00135_test_and_measurement_class/Makefile | 6 +++--- examples/AN00136_vendor_specific/Makefile | 6 +++--- 9 files changed, 27 insertions(+), 27 deletions(-) diff --git a/examples/AN00124_CDC_VCOM_class/Makefile b/examples/AN00124_CDC_VCOM_class/Makefile index e11b6939..51257fda 100644 --- a/examples/AN00124_CDC_VCOM_class/Makefile +++ b/examples/AN00124_CDC_VCOM_class/Makefile @@ -12,10 +12,10 @@ APP_NAME = app_usb_cdc_demo # If the variable XCC_MAP_FLAGS is set it overrides the flags passed to # xcc for the final link (mapping) stage. -BUILD_FLAGS = -O3 -g -report -DXCORE_USE_LEGACY_CLOCK_NAMING=1 +BUILD_FLAGS = -O3 -g -report -XCC_FLAGS_200 = $(BUILD_FLAGS) -DXUD_CORE_CLOCK=500 -XCC_FLAGS_AI = $(BUILD_FLAGS) -DXUD_CORE_CLOCK=600 +XCC_FLAGS_200 = $(BUILD_FLAGS) +XCC_FLAGS_AI = $(BUILD_FLAGS) # The TARGET variable determines what target system the application is # compiled for. It either refers to an XN file in the source directories diff --git a/examples/AN00125_mass_storage_class/Makefile b/examples/AN00125_mass_storage_class/Makefile index 7d6ee07a..d7ecdc4d 100644 --- a/examples/AN00125_mass_storage_class/Makefile +++ b/examples/AN00125_mass_storage_class/Makefile @@ -12,10 +12,10 @@ APP_NAME = app_mass_storage_demo # If the variable XCC_MAP_FLAGS is set it overrides the flags passed to # xcc for the final link (mapping) stage. -BUILD_FLAGS = -O3 -report -DUSE_XSCOPE=1 -fxscope -lflash -DXCORE_USE_LEGACY_CLOCK_NAMING=1 +BUILD_FLAGS = -O3 -report -DUSE_XSCOPE=1 -fxscope -lflash -XCC_FLAGS_200 = $(BUILD_FLAGS) -DXUD_CORE_CLOCK=500 -XCC_FLAGS_AI = $(BUILD_FLAGS) -DXUD_CORE_CLOCK=600 +XCC_FLAGS_200 = $(BUILD_FLAGS) +XCC_FLAGS_AI = $(BUILD_FLAGS) # The TARGET variable determines what target system the application is # compiled for. It either refers to an XN file in the source directories diff --git a/examples/AN00126_printer_class/Makefile b/examples/AN00126_printer_class/Makefile index 9acb738a..5bf8d26e 100644 --- a/examples/AN00126_printer_class/Makefile +++ b/examples/AN00126_printer_class/Makefile @@ -12,10 +12,10 @@ APP_NAME = app_printer_demo # If the variable XCC_MAP_FLAGS is set it overrides the flags passed to # xcc for the final link (mapping) stage. -BUILD_FLAGS = -O3 -report -DUSE_XSCOPE=1 -fxscope -DXCORE_USE_LEGACY_CLOCK_NAMING=1 +BUILD_FLAGS = -O3 -report -DUSE_XSCOPE=1 -fxscope -XCC_FLAGS_200 = $(BUILD_FLAGS) -DXUD_CORE_CLOCK=500 -XCC_FLAGS_AI = $(BUILD_FLAGS) -DXUD_CORE_CLOCK=600 +XCC_FLAGS_200 = $(BUILD_FLAGS) +XCC_FLAGS_AI = $(BUILD_FLAGS) # The TARGET variable determines what target system the application is # compiled for. It either refers to an XN file in the source directories diff --git a/examples/AN00127_video_class/Makefile b/examples/AN00127_video_class/Makefile index 2c8c78df..61762944 100644 --- a/examples/AN00127_video_class/Makefile +++ b/examples/AN00127_video_class/Makefile @@ -12,10 +12,10 @@ APP_NAME = app_video_demo # If the variable XCC_MAP_FLAGS is set it overrides the flags passed to # xcc for the final link (mapping) stage. -BUILD_FLAGS = -O3 -report -DXCORE_USE_LEGACY_CLOCK_NAMING=1 +BUILD_FLAGS = -O3 -report -XCC_FLAGS_200 = $(BUILD_FLAGS) -DXUD_CORE_CLOCK=500 -XCC_FLAGS_AI = $(BUILD_FLAGS) -DXUD_CORE_CLOCK=600 +XCC_FLAGS_200 = $(BUILD_FLAGS) +XCC_FLAGS_AI = $(BUILD_FLAGS) # The TARGET variable determines what target system the application is # compiled for. It either refers to an XN file in the source directories diff --git a/examples/AN00129_hid_class/Makefile b/examples/AN00129_hid_class/Makefile index 5cb066be..216c1563 100644 --- a/examples/AN00129_hid_class/Makefile +++ b/examples/AN00129_hid_class/Makefile @@ -14,10 +14,10 @@ APP_NAME = app_hid_mouse_demo # These flags define two build configurations - one for xCORE-200 and one for # the xCORE.AI series. -BUILD_FLAGS = -O3 -report -fxscope -DXCORE_USE_LEGACY_CLOCK_NAMING=1 +BUILD_FLAGS = -O3 -report -fxscope -XCC_FLAGS_200 = $(BUILD_FLAGS) -DXUD_CORE_CLOCK=500 -XCC_FLAGS_AI = $(BUILD_FLAGS) -DXUD_CORE_CLOCK=600 +XCC_FLAGS_200 = $(BUILD_FLAGS) +XCC_FLAGS_AI = $(BUILD_FLAGS) USED_MODULES = lib_xud diff --git a/examples/AN00131_CDC_EDC_class/Makefile b/examples/AN00131_CDC_EDC_class/Makefile index b9e27855..130682be 100644 --- a/examples/AN00131_CDC_EDC_class/Makefile +++ b/examples/AN00131_CDC_EDC_class/Makefile @@ -12,10 +12,10 @@ APP_NAME = app_cdc_edc_demo # If the variable XCC_MAP_FLAGS is set it overrides the flags passed to # xcc for the final link (mapping) stage. -BUILD_FLAGS = -Wall -O3 -report -DUSE_XSCOPE=1 -fxscope -DXCORE_USE_LEGACY_CLOCK_NAMING=1 +BUILD_FLAGS = -Wall -O3 -report -DUSE_XSCOPE=1 -fxscope -XCC_FLAGS_200 = $(BUILD_FLAGS) -DXUD_CORE_CLOCK=500 -XCC_FLAGS_AI = $(BUILD_FLAGS) -DXUD_CORE_CLOCK=600 +XCC_FLAGS_200 = $(BUILD_FLAGS) +XCC_FLAGS_AI = $(BUILD_FLAGS) # The TARGET variable determines what target system the application is # compiled for. It either refers to an XN file in the source directories diff --git a/examples/AN00132_image_class/Makefile b/examples/AN00132_image_class/Makefile index 30b8217b..256f3d54 100644 --- a/examples/AN00132_image_class/Makefile +++ b/examples/AN00132_image_class/Makefile @@ -12,10 +12,10 @@ APP_NAME = app_usb_image_demo # If the variable XCC_MAP_FLAGS is set it overrides the flags passed to # xcc for the final link (mapping) stage. -BUILD_FLAGS = -O3 -report -DXCORE_USE_LEGACY_CLOCK_NAMING=1 +BUILD_FLAGS = -O3 -report -XCC_FLAGS_200 = $(BUILD_FLAGS) -DXUD_CORE_CLOCK=500 -XCC_FLAGS_AI = $(BUILD_FLAGS) -DXUD_CORE_CLOCK=600 +XCC_FLAGS_200 = $(BUILD_FLAGS) +XCC_FLAGS_AI = $(BUILD_FLAGS) # The TARGET variable determines what target system the application is # compiled for. It either refers to an XN file in the source directories diff --git a/examples/AN00135_test_and_measurement_class/Makefile b/examples/AN00135_test_and_measurement_class/Makefile index db3bd0be..c75a3a15 100644 --- a/examples/AN00135_test_and_measurement_class/Makefile +++ b/examples/AN00135_test_and_measurement_class/Makefile @@ -12,10 +12,10 @@ APP_NAME = app_test_and_measurement # If the variable XCC_MAP_FLAGS is set it overrides the flags passed to # xcc for the final link (mapping) stage. -BUILD_FLAGS = -O3 -report -DXCORE_USE_LEGACY_CLOCK_NAMING=1 +BUILD_FLAGS = -O3 -report -XCC_FLAGS_200 = $(BUILD_FLAGS) -DXUD_CORE_CLOCK=500 -XCC_FLAGS_AI = $(BUILD_FLAGS) -DXUD_CORE_CLOCK=600 +XCC_FLAGS_200 = $(BUILD_FLAGS) +XCC_FLAGS_AI = $(BUILD_FLAGS) # The TARGET variable determines what target system the application is # compiled for. It either refers to an XN file in the source directories diff --git a/examples/AN00136_vendor_specific/Makefile b/examples/AN00136_vendor_specific/Makefile index 46a29573..404f0a5e 100644 --- a/examples/AN00136_vendor_specific/Makefile +++ b/examples/AN00136_vendor_specific/Makefile @@ -12,10 +12,10 @@ APP_NAME = app_vendor_specific_demo # If the variable XCC_MAP_FLAGS is set it overrides the flags passed to # xcc for the final link (mapping) stage. -BUILD_FLAGS = -O3 -report -DXCORE_USE_LEGACY_CLOCK_NAMING=1 +BUILD_FLAGS = -O3 -report -XCC_FLAGS_200 = $(BUILD_FLAGS) -DXUD_CORE_CLOCK=500 -XCC_FLAGS_AI = $(BUILD_FLAGS) -DXUD_CORE_CLOCK=600 +XCC_FLAGS_200 = $(BUILD_FLAGS) +XCC_FLAGS_AI = $(BUILD_FLAGS) # The TARGET variable determines what target system the application is # compiled for. It either refers to an XN file in the source directories From 97690f446b301f7389213434515483270796bc32 Mon Sep 17 00:00:00 2001 From: xross Date: Fri, 10 Sep 2021 11:11:43 +0100 Subject: [PATCH 11/13] - XUD_CORE_CLOCK now defined as 500 for XS2 - Removed #warning for undefined XUD_CORE_CLOCK --- lib_xud/api/xud.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib_xud/api/xud.h b/lib_xud/api/xud.h index 2158eb1c..aac91c30 100644 --- a/lib_xud/api/xud.h +++ b/lib_xud/api/xud.h @@ -34,13 +34,19 @@ #define USB_TILE tile[0] #endif +// TODO use PLATFORM_REFERENCE_MHZ from platform.h #ifndef REF_CLK_FREQ #define REF_CLK_FREQ 100 #endif #ifndef XUD_CORE_CLOCK -#warning XUD_CORE_CLOCK not defined, using default (700MHz) -#define XUD_CORE_CLOCK (700) + #ifdef __XS2A__ + //#warning XUD_CORE_CLOCK not defined, using default (500MHz) + #define XUD_CORE_CLOCK (500) + #else + //#warning XUD_CORE_CLOCK not defined, using default (600MHz) + #define XUD_CORE_CLOCK (600) + #endif #endif #if !defined(PORT_USB_CLK) From fe0024f3810b5e0be0b816e398b8e7a5690b7869 Mon Sep 17 00:00:00 2001 From: xross Date: Fri, 10 Sep 2021 11:53:08 +0100 Subject: [PATCH 12/13] Removed XCORE_USE_LEGACY_CLOCK_NAMING from module_build_info --- lib_xud/module_build_info | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib_xud/module_build_info b/lib_xud/module_build_info index ff78eac7..7b9c753e 100644 --- a/lib_xud/module_build_info +++ b/lib_xud/module_build_info @@ -5,8 +5,7 @@ MODULE_XCC_FLAGS = $(XCC_FLAGS) \ -DREF_CLK_FREQ=100 \ -fasm-linenum \ -fcomment-asm \ - -DXUD_FULL_PIDTABLE=1 \ - -DXCORE_USE_LEGACY_CLOCK_NAMING=1 + -DXUD_FULL_PIDTABLE=1 XCC_FLAGS_XUD_IoLoop.S = $(MODULE_XCC_FLAGS) -fschedule -g0 From c9b5e8eabcedaa4c982da2a55e38c94916ed69ec Mon Sep 17 00:00:00 2001 From: xross Date: Wed, 15 Sep 2021 15:33:48 +0100 Subject: [PATCH 13/13] Version bump and changelog update --- CHANGELOG.rst | 5 +++++ lib_xud/module_build_info | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index b34c7fd6..12d65f97 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,11 @@ lib_xud Change Log ================== +2.0.2 +----- + + * ADDED: Legacy API wrapper functions/header files + 2.0.1 ----- diff --git a/lib_xud/module_build_info b/lib_xud/module_build_info index 7b9c753e..e1befd75 100644 --- a/lib_xud/module_build_info +++ b/lib_xud/module_build_info @@ -1,4 +1,4 @@ -VERSION = 2.0.1 +VERSION = 2.0.2 MODULE_XCC_FLAGS = $(XCC_FLAGS) \ -O3 \