Add lp/us ticker free() function implementation for NRF5

pull/7009/head
Steven Cartmell 2018-01-15 16:33:16 +00:00 committed by Bartek Szatkowski
parent 2894152efe
commit 18943a9693
4 changed files with 14 additions and 0 deletions

View File

@ -41,6 +41,7 @@ extern "C" {
* *
* # Undefined behavior * # Undefined behavior
* * See the @ref hal_ticker_shared "ticker specification" * * See the @ref hal_ticker_shared "ticker specification"
* * Calling any function other than lp_ticker_init after calling lp_ticker_free
* *
* @see hal_lp_ticker_tests * @see hal_lp_ticker_tests
* *

View File

@ -78,6 +78,7 @@ extern "C" {
* * Calling any function other than ticker_init before the initialization of the ticker * * Calling any function other than ticker_init before the initialization of the ticker
* * Whether ticker_irq_handler is called a second time if the time wraps and matches the value set by ticker_set_interrupt again * * Whether ticker_irq_handler is called a second time if the time wraps and matches the value set by ticker_set_interrupt again
* * Calling ticker_set_interrupt with a value that has more than the supported number of bits * * Calling ticker_set_interrupt with a value that has more than the supported number of bits
* * Calling any function other than us_ticker_init after calling us_ticker_free
* *
* # Potential bugs * # Potential bugs
* * Drift due to reschedule - Verified by ::ticker_repeat_reschedule_test * * Drift due to reschedule - Verified by ::ticker_repeat_reschedule_test

View File

@ -25,6 +25,12 @@ void lp_ticker_init(void)
common_rtc_init(); common_rtc_init();
} }
void lp_ticker_free(void)
{
// A common counter is used for RTC, lp_ticker and us_ticker, so it can't be
// disabled here, but this does not cause any extra cost.
}
uint32_t lp_ticker_read() uint32_t lp_ticker_read()
{ {
return (uint32_t)common_rtc_64bit_us_get(); return (uint32_t)common_rtc_64bit_us_get();

View File

@ -266,6 +266,12 @@ void us_ticker_init(void)
common_rtc_init(); common_rtc_init();
} }
void us_ticker_free(void)
{
// A common counter is used for RTC, lp_ticker and us_ticker, so it can't be
// disabled here, but this does not cause any extra cost.
}
uint32_t us_ticker_read() uint32_t us_ticker_read()
{ {
us_ticker_init(); us_ticker_init();