diff --git a/hal/mbed_us_ticker_api.c b/hal/mbed_us_ticker_api.c index 28626e0bd6..0cb863f115 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 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 ee0090336c..6a802653a4 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 + diff --git a/targets/targets.json b/targets/targets.json index c1746c3136..de88401e72 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", @@ -872,7 +873,8 @@ "SPI", "SPISLAVE", "STDIO_MESSAGES", - "MPU" + "MPU", + "USTICKER" ], "device_name": "LPC4088FBD144", "overrides": { @@ -5449,7 +5451,8 @@ "SERIAL_FC", "SLEEP", "SPI", - "STDIO_MESSAGES" + "STDIO_MESSAGES", + "USTICKER" ], "release_versions": ["2", "5"] }, @@ -6521,7 +6524,8 @@ "SERIAL", "SPI", "SPISLAVE", - "STDIO_MESSAGES" + "STDIO_MESSAGES", + "USTICKER" ], "release_versions": ["2", "5"] }, @@ -6546,7 +6550,8 @@ "SERIAL", "SPI", "SPISLAVE", - "STDIO_MESSAGES" + "STDIO_MESSAGES", + "USTICKER" ], "release_versions": ["2", "5"] }, @@ -6570,7 +6575,8 @@ "SERIAL", "SPI", "SPISLAVE", - "STDIO_MESSAGES" + "STDIO_MESSAGES", + "USTICKER" ], "release_versions": ["2", "5"] }, @@ -7279,7 +7285,8 @@ "TRNG", "SPISLAVE", "802_15_4_PHY", - "MPU" + "MPU", + "USTICKER" ], "release_versions": ["2", "5"] },