From 568feaf7da49580be4aeea1dd8e970b75a36887f Mon Sep 17 00:00:00 2001 From: Michael Schwarcz Date: Tue, 19 Mar 2019 12:51:36 +0200 Subject: [PATCH 1/4] Remove dependency on us_ticker HAL apis for non USTICKER targets - Surround mbed_us_ticker_api.c with if DEVICE_USTICKER - get_us_ticker_data() returns NULL for non-usticker targets. --- hal/mbed_us_ticker_api.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/hal/mbed_us_ticker_api.c b/hal/mbed_us_ticker_api.c index 28626e0bd63..0cb863f1158 100644 --- a/hal/mbed_us_ticker_api.c +++ b/hal/mbed_us_ticker_api.c @@ -14,8 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +#include #include "hal/us_ticker_api.h" +#if DEVICE_USTICKER + static ticker_event_queue_t events = { 0 }; static ticker_irq_handler_type irq_handler = ticker_irq_handler; @@ -56,3 +60,12 @@ void us_ticker_irq_handler(void) irq_handler(&us_data); } } + +#else + +const ticker_data_t *get_us_ticker_data(void) +{ + return NULL; +} + +#endif // DEVICE_USTICKER From 3ea2161755e4a3ae5aaf0dba0e41ddc8571ff973 Mon Sep 17 00:00:00 2001 From: Michael Schwarcz Date: Wed, 20 Mar 2019 21:32:52 +0200 Subject: [PATCH 2/4] Add USTICKER to ARCH_PRO target --- targets/targets.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/targets/targets.json b/targets/targets.json index 7126959e250..fca6d9aaeb3 100644 --- a/targets/targets.json +++ b/targets/targets.json @@ -663,7 +663,8 @@ "STDIO_MESSAGES", "FLASH", "MPU", - "USBDEVICE" + "USBDEVICE", + "USTICKER" ], "release_versions": ["2", "5"], "device_name": "LPC1768", From 0e73a83bb2fd9c97aa9b5b69e19e8d319b47cf8b Mon Sep 17 00:00:00 2001 From: Michael Schwarcz Date: Thu, 21 Mar 2019 20:55:18 +0200 Subject: [PATCH 3/4] Add USTICKER to more targets - LPC4088 - LPC4088_DM - MAX32600MBED - NCS36510 - WIZWIKI_W7500 - WIZWIKI_W7500ECO - WIZWIKI_W7500P --- targets/targets.json | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/targets/targets.json b/targets/targets.json index fca6d9aaeb3..469ec025623 100644 --- a/targets/targets.json +++ b/targets/targets.json @@ -873,7 +873,8 @@ "SPI", "SPISLAVE", "STDIO_MESSAGES", - "MPU" + "MPU", + "USTICKER" ], "device_name": "LPC4088FBD144", "overrides": { @@ -5414,7 +5415,8 @@ "SERIAL_FC", "SLEEP", "SPI", - "STDIO_MESSAGES" + "STDIO_MESSAGES", + "USTICKER" ], "release_versions": ["2", "5"] }, @@ -6486,7 +6488,8 @@ "SERIAL", "SPI", "SPISLAVE", - "STDIO_MESSAGES" + "STDIO_MESSAGES", + "USTICKER" ], "release_versions": ["2", "5"] }, @@ -6511,7 +6514,8 @@ "SERIAL", "SPI", "SPISLAVE", - "STDIO_MESSAGES" + "STDIO_MESSAGES", + "USTICKER" ], "release_versions": ["2", "5"] }, @@ -6535,7 +6539,8 @@ "SERIAL", "SPI", "SPISLAVE", - "STDIO_MESSAGES" + "STDIO_MESSAGES", + "USTICKER" ], "release_versions": ["2", "5"] }, @@ -7244,7 +7249,8 @@ "TRNG", "SPISLAVE", "802_15_4_PHY", - "MPU" + "MPU", + "USTICKER" ], "release_versions": ["2", "5"] }, From a91f17e8249e6c1948fca88a0c001832f346e89c Mon Sep 17 00:00:00 2001 From: Michael Schwarcz Date: Sun, 24 Mar 2019 18:11:58 +0200 Subject: [PATCH 4/4] LPC targets: Compile us_ticker.c only if USTICKER defined --- .../TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC/us_ticker.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC/us_ticker.c b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC/us_ticker.c index ee0090336c2..6a802653a4d 100644 --- a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC/us_ticker.c +++ b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC/us_ticker.c @@ -18,6 +18,8 @@ #include "fsl_ctimer.h" #include "PeripheralNames.h" +#if DEVICE_USTICKER + #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) #define CTIMER CTIMER0 #define CTIMER_IRQn CTIMER0_IRQn @@ -117,3 +119,6 @@ void us_ticker_free(void) NVIC_DisableIRQ(CTIMER_IRQn); us_ticker_inited = false; } + +#endif // DEVICE_USTICKER +