Skip to content

Commit f2e7043

Browse files
Steven Cartmellcmonr
authored andcommitted
Add lp/us ticker free() function implementation for NRF5
1 parent c2bafbf commit f2e7043

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed

hal/lp_ticker_api.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ extern "C" {
4141
*
4242
* # Undefined behavior
4343
* * See the @ref hal_ticker_shared "ticker specification"
44+
* * Calling any function other than lp_ticker_init after calling lp_ticker_free
4445
*
4546
* @see hal_lp_ticker_tests
4647
*

hal/us_ticker_api.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ extern "C" {
7878
* * Calling any function other than ticker_init before the initialization of the ticker
7979
* * Whether ticker_irq_handler is called a second time if the time wraps and matches the value set by ticker_set_interrupt again
8080
* * Calling ticker_set_interrupt with a value that has more than the supported number of bits
81+
* * Calling any function other than us_ticker_init after calling us_ticker_free
8182
*
8283
* # Potential bugs
8384
* * Drift due to reschedule - Verified by ::ticker_repeat_reschedule_test

targets/TARGET_NORDIC/TARGET_NRF5/lp_ticker.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ void lp_ticker_init(void)
2424
common_rtc_init();
2525
}
2626

27+
void lp_ticker_free(void)
28+
{
29+
// A common counter is used for RTC, lp_ticker and us_ticker, so it can't be
30+
// disabled here, but this does not cause any extra cost.
31+
}
32+
2733
uint32_t lp_ticker_read()
2834
{
2935
return (uint32_t)common_rtc_64bit_us_get();

targets/TARGET_NORDIC/TARGET_NRF5/us_ticker.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,12 @@ void us_ticker_init(void)
259259
common_rtc_init();
260260
}
261261

262+
void us_ticker_free(void)
263+
{
264+
// A common counter is used for RTC, lp_ticker and us_ticker, so it can't be
265+
// disabled here, but this does not cause any extra cost.
266+
}
267+
262268
uint32_t us_ticker_read()
263269
{
264270
us_ticker_init();

0 commit comments

Comments
 (0)