Skip to content

Commit fcf4999

Browse files
author
Cruz Monrreal
authored
Merge pull request #10155 from kfnta/us_ticker
Remove dependency on us_ticker HAL apis for non USTICKER targets
2 parents eff1580 + a91f17e commit fcf4999

File tree

3 files changed

+32
-7
lines changed

3 files changed

+32
-7
lines changed

hal/mbed_us_ticker_api.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17+
18+
#include <stddef.h>
1719
#include "hal/us_ticker_api.h"
1820

21+
#if DEVICE_USTICKER
22+
1923
static ticker_event_queue_t events = { 0 };
2024

2125
static ticker_irq_handler_type irq_handler = ticker_irq_handler;
@@ -56,3 +60,12 @@ void us_ticker_irq_handler(void)
5660
irq_handler(&us_data);
5761
}
5862
}
63+
64+
#else
65+
66+
const ticker_data_t *get_us_ticker_data(void)
67+
{
68+
return NULL;
69+
}
70+
71+
#endif // DEVICE_USTICKER

targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC/us_ticker.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
#include "fsl_ctimer.h"
1919
#include "PeripheralNames.h"
2020

21+
#if DEVICE_USTICKER
22+
2123
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
2224
#define CTIMER CTIMER0
2325
#define CTIMER_IRQn CTIMER0_IRQn
@@ -117,3 +119,6 @@ void us_ticker_free(void)
117119
NVIC_DisableIRQ(CTIMER_IRQn);
118120
us_ticker_inited = false;
119121
}
122+
123+
#endif // DEVICE_USTICKER
124+

targets/targets.json

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,8 @@
663663
"STDIO_MESSAGES",
664664
"FLASH",
665665
"MPU",
666-
"USBDEVICE"
666+
"USBDEVICE",
667+
"USTICKER"
667668
],
668669
"release_versions": ["2", "5"],
669670
"device_name": "LPC1768",
@@ -872,7 +873,8 @@
872873
"SPI",
873874
"SPISLAVE",
874875
"STDIO_MESSAGES",
875-
"MPU"
876+
"MPU",
877+
"USTICKER"
876878
],
877879
"device_name": "LPC4088FBD144",
878880
"overrides": {
@@ -5449,7 +5451,8 @@
54495451
"SERIAL_FC",
54505452
"SLEEP",
54515453
"SPI",
5452-
"STDIO_MESSAGES"
5454+
"STDIO_MESSAGES",
5455+
"USTICKER"
54535456
],
54545457
"release_versions": ["2", "5"]
54555458
},
@@ -6521,7 +6524,8 @@
65216524
"SERIAL",
65226525
"SPI",
65236526
"SPISLAVE",
6524-
"STDIO_MESSAGES"
6527+
"STDIO_MESSAGES",
6528+
"USTICKER"
65256529
],
65266530
"release_versions": ["2", "5"]
65276531
},
@@ -6546,7 +6550,8 @@
65466550
"SERIAL",
65476551
"SPI",
65486552
"SPISLAVE",
6549-
"STDIO_MESSAGES"
6553+
"STDIO_MESSAGES",
6554+
"USTICKER"
65506555
],
65516556
"release_versions": ["2", "5"]
65526557
},
@@ -6570,7 +6575,8 @@
65706575
"SERIAL",
65716576
"SPI",
65726577
"SPISLAVE",
6573-
"STDIO_MESSAGES"
6578+
"STDIO_MESSAGES",
6579+
"USTICKER"
65746580
],
65756581
"release_versions": ["2", "5"]
65766582
},
@@ -7279,7 +7285,8 @@
72797285
"TRNG",
72807286
"SPISLAVE",
72817287
"802_15_4_PHY",
7282-
"MPU"
7288+
"MPU",
7289+
"USTICKER"
72837290
],
72847291
"release_versions": ["2", "5"]
72857292
},

0 commit comments

Comments
 (0)