mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-09 13:12:37 -05:00
imx233: simplify timrot API
The old timrot setup API was very low-level and unfriendly. The new one makes in easier to select the frequency source. Use to simplify timer and kernel timer code. Change-Id: Iffcdf11c00e925be9ec8d9a4efc74b197b6bd2aa
This commit is contained in:
parent
423c64770c
commit
643c0a1e0e
5 changed files with 74 additions and 11 deletions
|
|
@ -49,14 +49,11 @@ bool timer_set(long cycles, bool start)
|
|||
|
||||
bool timer_start(IF_COP_VOID(int core))
|
||||
{
|
||||
imx233_timrot_setup(TIMER_USER, true, timer_cycles,
|
||||
BV_TIMROT_TIMCTRLn_SELECT__32KHZ_XTAL, BV_TIMROT_TIMCTRLn_PRESCALE__DIV_BY_1,
|
||||
false, &timer_fn);
|
||||
imx233_timrot_setup_simple(TIMER_USER, true, timer_cycles, TIMER_SRC_32KHZ, &timer_fn);
|
||||
return true;
|
||||
}
|
||||
|
||||
void timer_stop(void)
|
||||
{
|
||||
imx233_timrot_setup(TIMER_USER, false, 0, BV_TIMROT_TIMCTRLn_SELECT__NEVER_TICK,
|
||||
BV_TIMROT_TIMCTRLn_PRESCALE__DIV_BY_1, false, NULL);
|
||||
imx233_timrot_setup_simple(TIMER_USER, false, 0, TIMER_SRC_STOP, NULL);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue