mirror of https://github.com/ARMmbed/mbed-os.git
[NUC472/M453] Fix stuck in lp_ticker_init()
parent
ec945db013
commit
64e27b2e3d
|
@ -95,11 +95,14 @@ void lp_ticker_init(void)
|
|||
TIMER_EnableInt((TIMER_T *) NU_MODBASE(timer2_modinit.modname));
|
||||
TIMER_EnableWakeup((TIMER_T *) NU_MODBASE(timer2_modinit.modname));
|
||||
|
||||
// Schedule wakeup to match semantics of lp_ticker_get_compare_match()
|
||||
lp_ticker_set_interrupt(wakeup_tick);
|
||||
// NOTE: TIMER_Start() first and then lp_ticker_set_interrupt(); otherwise, we may get stuck in lp_ticker_read() because
|
||||
// timer is not running.
|
||||
|
||||
// Start timer
|
||||
TIMER_Start((TIMER_T *) NU_MODBASE(timer2_modinit.modname));
|
||||
|
||||
// Schedule wakeup to match semantics of lp_ticker_get_compare_match()
|
||||
lp_ticker_set_interrupt(wakeup_tick);
|
||||
}
|
||||
|
||||
timestamp_t lp_ticker_read()
|
||||
|
|
|
@ -94,11 +94,14 @@ void lp_ticker_init(void)
|
|||
TIMER_EnableInt((TIMER_T *) NU_MODBASE(timer2_modinit.modname));
|
||||
TIMER_EnableWakeup((TIMER_T *) NU_MODBASE(timer2_modinit.modname));
|
||||
|
||||
// Schedule wakeup to match semantics of lp_ticker_get_compare_match()
|
||||
lp_ticker_set_interrupt(wakeup_tick);
|
||||
// NOTE: TIMER_Start() first and then lp_ticker_set_interrupt(); otherwise, we may get stuck in lp_ticker_read() because
|
||||
// timer is not running.
|
||||
|
||||
// Start timer
|
||||
TIMER_Start((TIMER_T *) NU_MODBASE(timer2_modinit.modname));
|
||||
|
||||
// Schedule wakeup to match semantics of lp_ticker_get_compare_match()
|
||||
lp_ticker_set_interrupt(wakeup_tick);
|
||||
}
|
||||
|
||||
timestamp_t lp_ticker_read()
|
||||
|
|
Loading…
Reference in New Issue