From 70a45b43b556592ac1012ecfd9ac5aa284d9c2b5 Mon Sep 17 00:00:00 2001 From: nakasima Date: Tue, 27 Jan 2009 05:20:26 +0000 Subject: [PATCH] =?UTF-8?q?=E3=83=81=E3=83=83=E3=82=AF=E3=81=AE=E3=83=97?= =?UTF-8?q?=E3=83=AA=E3=82=B9=E3=82=B1=E3=83=BC=E3=83=A9=E3=82=92=E5=A4=89?= =?UTF-8?q?=E6=9B=B4=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-09-30%20-%20paladin.7z/paladin/ctr_firmware@215 b871894f-2f95-9b40-918c-086798483c85 --- trunk/bootrom/build/libraries/os/common/os_alarm.c | 2 +- trunk/bootrom/build/libraries/os/common/os_tick.c | 6 +++--- trunk/bootrom/build/libraries/os/common/os_timer.c | 7 +++++++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/trunk/bootrom/build/libraries/os/common/os_alarm.c b/trunk/bootrom/build/libraries/os/common/os_alarm.c index 2f37fcb..99cc1a0 100644 --- a/trunk/bootrom/build/libraries/os/common/os_alarm.c +++ b/trunk/bootrom/build/libraries/os/common/os_alarm.c @@ -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); diff --git a/trunk/bootrom/build/libraries/os/common/os_tick.c b/trunk/bootrom/build/libraries/os/common/os_tick.c index ae881ac..896efcc 100644 --- a/trunk/bootrom/build/libraries/os/common/os_tick.c +++ b/trunk/bootrom/build/libraries/os/common/os_tick.c @@ -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); diff --git a/trunk/bootrom/build/libraries/os/common/os_timer.c b/trunk/bootrom/build/libraries/os/common/os_timer.c index fb50eb2..16648ff 100644 --- a/trunk/bootrom/build/libraries/os/common/os_timer.c +++ b/trunk/bootrom/build/libraries/os/common/os_timer.c @@ -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] |