mirror of https://github.com/ARMmbed/mbed-os.git
Add lp/us ticker free() function implementation for NRF5
parent
2894152efe
commit
18943a9693
|
@ -41,6 +41,7 @@ extern "C" {
|
|||
*
|
||||
* # Undefined behavior
|
||||
* * 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
|
||||
*
|
||||
|
|
|
@ -78,6 +78,7 @@ extern "C" {
|
|||
* * 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
|
||||
* * 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
|
||||
* * Drift due to reschedule - Verified by ::ticker_repeat_reschedule_test
|
||||
|
|
|
@ -25,6 +25,12 @@ void lp_ticker_init(void)
|
|||
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()
|
||||
{
|
||||
return (uint32_t)common_rtc_64bit_us_get();
|
||||
|
|
|
@ -266,6 +266,12 @@ void us_ticker_init(void)
|
|||
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()
|
||||
{
|
||||
us_ticker_init();
|
||||
|
|
Loading…
Reference in New Issue