スキャッタロードを有効時にmainから戻って例外が起こらないように修正。

git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-09-30%20-%20paladin.7z/paladin/ctr_firmware@110 b871894f-2f95-9b40-918c-086798483c85
This commit is contained in:
nakasima 2008-12-17 01:13:35 +00:00
parent 2b2517c718
commit ee2e31dfb8
5 changed files with 35 additions and 43 deletions

View File

@ -45,6 +45,9 @@ ASM void $Sub$$stupInitSections(void)
int main( void ) int main( void )
{ {
BromMain(); BromMain();
return 0; while (1)
{
}
// never return
} }

View File

@ -45,6 +45,9 @@ ASM void $Sub$$stupInitSections(void)
int main( void ) int main( void )
{ {
BromSpMain(); BromSpMain();
return 0; while (1)
{
}
// never return
} }

View File

@ -16,12 +16,7 @@
*---------------------------------------------------------------------------*/ *---------------------------------------------------------------------------*/
#include <brom/os.h> #include <brom/os.h>
void timer_handler(void);
#if 0 // miya
static void i_osTimerInterruptHandler(void);
static void i_osWatchdogInterruptHandler( void );
#endif
static void i_osStartTimer( u32 count, u8 preScale, OSTimerRepeat repeat, OSTimerIntrReq ireq ); static void i_osStartTimer( u32 count, u8 preScale, OSTimerRepeat repeat, OSTimerIntrReq ireq );
static void i_osStartWatchdog( u32 count, u8 preScale, OSTimerRepeat repeat, OSTimerIntrReq ireq, static void i_osStartWatchdog( u32 count, u8 preScale, OSTimerRepeat repeat, OSTimerIntrReq ireq,
OSWatchdogMode watchdogMode ); OSWatchdogMode watchdogMode );
@ -45,49 +40,22 @@ void osInitTimer( void )
if ( isInit == FALSE ) if ( isInit == FALSE )
{ {
OSIntrMode intr = osDisableInterrupts();
isInit = TRUE; isInit = TRUE;
osTimerClock = OS_TIMER_CLOCK_DEFAULT; osTimerClock = OS_TIMER_CLOCK_DEFAULT;
osStopTimer(); osStopTimer();
osStopWatchdog(); osStopWatchdog();
osResetWatchdog();
osDisableWatchdog();
osRestoreInterrupts( intr );
} }
} }
/*---------------------------------------------------------------------------*
Name: i_osTimerInterruptHandler
Description: Timer interrupt handler
Arguments: None.
Returns: None.
*---------------------------------------------------------------------------*/
#if 0 // miya
static void i_osTimerInterruptHandler( void )
{
reg_OS_CPUTM_EVT = HW_CPUTM_EVT_FLAG;
}
/*---------------------------------------------------------------------------*
Name: i_osWatchdogInterruptHandler
Description: Watchdog interrupt handler
Arguments: None.
Returns: None.
*---------------------------------------------------------------------------*/
static void i_osWatchdogInterruptHandler( void )
{
reg_OS_CPUWD_EVT = HW_CPUWD_EVT_FLAG;
}
#endif
/*---------------------------------------------------------------------------* /*---------------------------------------------------------------------------*
Name: osStartTimerWithUSec Name: osStartTimerWithUSec
@ -292,7 +260,12 @@ void osResetWatchdog( void )
void osDisableWatchdog( void ) void osDisableWatchdog( void )
{ {
reg_OS_WD_DIS = TRUE; OSIntrMode intr = osDisableInterrupts();
reg_OS_WD_DIS = OSi_WATCHDOG_DISABLE_CODE_0;
reg_OS_WD_DIS = OSi_WATCHDOG_DISABLE_CODE_1;
osRestoreInterrupts( intr );
} }
#include <brom/code32.h> #include <brom/code32.h>

View File

@ -20,6 +20,10 @@
//#define FIRM_ENABLE_JTAG_AT_INIT //#define FIRM_ENABLE_JTAG_AT_INIT
static void handler(void)
{
}
/*---------------------------------------------------------------------------* /*---------------------------------------------------------------------------*
Name: osInitBROM Name: osInitBROM
@ -51,8 +55,14 @@ void osInitBROM(void)
//---- Init Tick //---- Init Tick
osInitTick(); osInitTick();
#if 1
//---- Init Alarm //---- Init Alarm
// osInitAlarm(); osInitAlarm();
{
static OSAlarm alarm;
osSetPeriodicAlarm(&alarm, 0x1000, 0x1000, (OSAlarmHandler)handler, NULL);
}
#endif
} }
} }

View File

@ -24,7 +24,10 @@
extern "C" { extern "C" {
#endif #endif
#define OS_TIMER_CLOCK_DEFAULT HW_CPU_CLOCK #define OS_TIMER_CLOCK_DEFAULT HW_CPU_CLOCK
#define OSi_WATCHDOG_DISABLE_CODE_0 0x12345678
#define OSi_WATCHDOG_DISABLE_CODE_1 0x87654321
//---------------------------------------------------------------------- //----------------------------------------------------------------------