/***********************************************************************/ /* */ /* FILE :resetprg.c */ /* DATE :Thu, Sep 22, 2005 */ /* DESCRIPTION :Reset Program */ /* CPU TYPE :SH7051F(ver1.20) by A-one */ /* */ /* This file is generated by Renesas Project Generator (Ver.4.0). */ /* */ /***********************************************************************/ #include #include <_h_c_lib.h> //#include // Remove the comment when you use errno //#include // Remove the comment when you use rand() #include "typedefine.h" #include "stacksct.h" #define INT_OFFSET 0x10 extern _UINT INT_Vectors; #ifdef __cplusplus extern "C" { #endif void PowerON_Reset_PC(void); void Manual_Reset_PC(void); void main(void); #ifdef __cplusplus } #endif //#ifdef __cplusplus // Use SIM I/O //extern "C" { //#endif //extern void _INIT_IOLIB(void); //extern void _CLOSEALL(void); //#ifdef __cplusplus //} //#endif //extern void srand(_UINT); // Remove the comment when you use rand() //extern _SBYTE *_s1ptr; // Remove the comment when you use strtok() //#ifdef __cplusplus // Use Hardware Setup //extern "C" { //#endif //extern void HardwareSetup(void); //#ifdef __cplusplus //} //#endif //#ifdef __cplusplus // Remove the comment when you use global class object //extern "C" { // Sections C$INIT and C$END will be generated //#endif //extern void _CALL_INIT(void); //extern void _CALL_END(void); //#ifdef __cplusplus //} //#endif #define WAIT // この「#define」をコメントにすると下のソフトタイマは無くなります。 #ifdef WAIT // H-debuggerのためWaitTimer用変数 #pragma global_register(cnt=R14) unsigned long cnt; #define SR_Init 0x000000E0 #else #define SR_Init 0x000000F0 #endif #pragma section ResetPRG #pragma entry PowerON_Reset_PC void PowerON_Reset_PC(void) { #ifdef WAIT // H-debuggerのためWaitTimer cnt = 2500*1; // 1ms(sys20.000MHz{20000/8})*1ms while(cnt-- != 0) {nop();} // 8 clock #endif set_cr(SR_Init); set_vbr((void *)((_UBYTE *)&INT_Vectors - INT_OFFSET)); _INITSCT(); // _CALL_INIT(); // Remove the comment when you use global class object // _INIT_IOLIB(); // Use SIM I/O // errno=0; // Remove the comment when you use errno // srand((_UINT)1); // Remove the comment when you use rand() // _s1ptr=NULL; // Remove the comment when you use strtok() // HardwareSetup(); // Use Hardware Setup nop(); main(); // _CLOSEALL(); // Use SIM I/O // _CALL_END(); // Remove the comment when you use global class object sleep(); } //#pragma entry Manual_Reset_PC // Remove the comment when you use Manual Reset void Manual_Reset_PC(void) { }