mirror of
https://github.com/rvtr/ctr_firmware.git
synced 2025-10-31 07:51:08 -04:00
チックのプリスケーラを変更できるように対応。
git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-09-30%20-%20paladin.7z/paladin/ctr_firmware@215 b871894f-2f95-9b40-918c-086798483c85
This commit is contained in:
parent
88a1531191
commit
70a45b43b5
@ -104,7 +104,7 @@ static void i_osSetTimer(OSAlarm *alarm)
|
||||
//osPrintf( "**i_osSetTimer alarm=%x, fire=%llx time=%llx delta=%lld timeCount=%x \n", alarm, alarm->fire, time, delta, (int)timerCount );
|
||||
|
||||
#ifdef SDK_ARM11
|
||||
osStartTimer(OSi_ALARM_TIMER, timerCount, 0);
|
||||
osStartTimer(OSi_ALARM_TIMER, timerCount, OS_TICK_PRESCALE);
|
||||
#else // SDK_ARM9
|
||||
osSetTimerCount((OSTimer)OSi_ALARM_TIMER, timerCount);
|
||||
osSetTimerControl(OSi_ALARM_TIMER, (u16)OSi_ALARM_TIMERCONTROL);
|
||||
|
||||
@ -73,7 +73,7 @@ void osInitTick(void)
|
||||
#ifdef SDK_ARM11
|
||||
osStopTimer(OSi_TICK_TIMER);
|
||||
osEnableTimerReload(OSi_TICK_TIMER);
|
||||
osStartTimer(OSi_TICK_TIMER, OS_TICK_LO_LIMIT, 0);
|
||||
osStartTimer(OSi_TICK_TIMER, OS_TICK_LO_LIMIT, OS_TICK_PRESCALE);
|
||||
#else // SDK_ARM9
|
||||
//---- setting timer
|
||||
osSetTimerControl(OSi_TICK_TIMER, 0);
|
||||
@ -130,7 +130,7 @@ static void i_osCountUpTick(void)
|
||||
{
|
||||
#ifdef SDK_ARM11
|
||||
osStopTimer(OSi_TICK_TIMER);
|
||||
osStartTimer(OSi_TICK_TIMER, OS_TICK_LO_LIMIT, 0);
|
||||
osStartTimer(OSi_TICK_TIMER, OS_TICK_LO_LIMIT, OS_TICK_PRESCALE);
|
||||
#else // SDK_ARM9
|
||||
osSetTimerControl(OSi_TICK_TIMER, 0);
|
||||
#ifdef OS_TICK_USE_2TIMERS
|
||||
@ -258,7 +258,7 @@ void i_osSetTick(u64 count)
|
||||
osStopTimer(OSi_TICK_TIMER);
|
||||
osClearInterruptPendingID(OSi_TICK_IE_TIMER_ID);
|
||||
|
||||
osStartTimer(OSi_TICK_TIMER, (u32)(count & OS_TICK_LO_MASK), 0);
|
||||
osStartTimer(OSi_TICK_TIMER, (u32)(count & OS_TICK_LO_MASK), OS_TICK_PRESCALE);
|
||||
|
||||
#else // SDK_ARM9
|
||||
osSetTimerControl(OSi_TICK_TIMER, 0);
|
||||
|
||||
@ -138,9 +138,16 @@ void i_osUnsetTimerReserved( int timer_id )
|
||||
void osStartTimer( OSTimer id, OSTimerCount count, OSTimerPrescaler preScale )
|
||||
{
|
||||
SDK_ASSERT(OS_TIMER_0 <= id && id < OS_TIMER_NUM);
|
||||
SDK_ASSERT(2 <= preScale && preScale <= (256*2));
|
||||
//---- check if system reserved
|
||||
SDK_ASSERT(!i_osIsTimerReserved(id));
|
||||
|
||||
preScale /= 2;
|
||||
if ( preScale )
|
||||
{
|
||||
preScale--;
|
||||
}
|
||||
|
||||
osSetTimerCount(id, count);
|
||||
osSetTimerControl(id, REG_OS_TM_CNT_E_MASK | REG_OS_TM_CNT_IT_MASK |
|
||||
i_osTimerControl[id] |
|
||||
|
||||
Loading…
Reference in New Issue
Block a user