--- /dev/null
+/***********************************************************************/\r
+/* */\r
+/* FILE :resetprg.c */\r
+/* DATE :Wed, Aug 11, 2010 */\r
+/* DESCRIPTION :Reset Program */\r
+/* CPU TYPE :Other */\r
+/* */\r
+/* This file is generated by Renesas Project Generator (Ver.4.50). */\r
+/* NOTE:THIS IS A TYPICAL EXAMPLE. */\r
+/* */\r
+/***********************************************************************/\r
+ \r
+\r
+\r
+/*********************************************************************\r
+*\r
+* Device : RX/RX200\r
+*\r
+* File Name : resetprg.c\r
+*\r
+* Abstract : Reset Program.\r
+*\r
+* History : 1.00 (2009-08-07)\r
+*\r
+* NOTE : THIS IS A TYPICAL EXAMPLE.\r
+*\r
+* Copyright(c) 2009 Renesas Technology Corp.\r
+* And Renesas Solutions Corp.,All Rights Reserved. \r
+*\r
+*********************************************************************/\r
+\r
+#include <machine.h>\r
+#include <_h_c_lib.h>\r
+//#include <stddef.h> // Remove the comment when you use errno\r
+//#include <stdlib.h> // Remove the comment when you use rand()\r
+#include "typedefine.h"\r
+#include "stacksct.h"\r
+\r
+#pragma inline_asm Change_PSW_PM_to_UserMode\r
+static void Change_PSW_PM_to_UserMode(void);\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+void PowerON_Reset_PC(void);\r
+void main(void);\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#ifdef __cplusplus // Use SIM I/O\r
+extern "C" {\r
+#endif\r
+extern void _INIT_IOLIB(void);\r
+extern void _CLOSEALL(void);\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#define PSW_init 0x00010000\r
+#define FPSW_init 0x00000100\r
+\r
+//extern void srand(_UINT); // Remove the comment when you use rand()\r
+//extern _SBYTE *_s1ptr; // Remove the comment when you use strtok()\r
+ \r
+//#ifdef __cplusplus // Use Hardware Setup\r
+//extern "C" {\r
+//#endif\r
+//extern void HardwareSetup(void);\r
+//#ifdef __cplusplus\r
+//}\r
+//#endif\r
+ \r
+//#ifdef __cplusplus // Remove the comment when you use global class object\r
+//extern "C" { // Sections C$INIT and C$END will be generated\r
+//#endif\r
+//extern void _CALL_INIT(void);\r
+//extern void _CALL_END(void);\r
+//#ifdef __cplusplus\r
+//}\r
+//#endif\r
+\r
+#pragma section ResetPRG\r
+\r
+#pragma entry PowerON_Reset_PC\r
+\r
+void PowerON_Reset_PC(void)\r
+{ \r
+ set_intb((void*)__sectop("C$VECT"));\r
+// set_fpsw(FPSW_init);\r
+\r
+ _INITSCT();\r
+\r
+// _INIT_IOLIB(); // Remove the comment when you use SIM I/O\r
+\r
+// errno=0; // Remove the comment when you use errno\r
+// srand((_UINT)1); // Remove the comment when you use rand()\r
+// _s1ptr=NULL; // Remove the comment when you use strtok()\r
+ \r
+// HardwareSetup(); // Use Hardware Setup\r
+ nop();\r
+\r
+// _CALL_INIT(); // Remove the comment when you use global class object\r
+\r
+ set_psw(PSW_init); // Set Ubit & Ibit for PSW\r
+// Change_PSW_PM_to_UserMode(); // DO NOT CHANGE TO USER MODE IF USING FREERTOS!\r
+ ( void ) Change_PSW_PM_to_UserMode; // Just to avoid compiler warnings.\r
+\r
+ main();\r
+\r
+// _CLOSEALL(); // Use SIM I/O\r
+ \r
+// _CALL_END(); // Remove the comment when you use global class object\r
+\r
+ brk();\r
+}\r
+\r
+static void Change_PSW_PM_to_UserMode(void)\r
+{\r
+ MVFC PSW,R1\r
+ OR #00100000h,R1\r
+ PUSH.L R1\r
+ MVFC PC,R1\r
+ ADD #10,R1\r
+ PUSH.L R1\r
+ RTE\r
+ NOP\r
+ NOP\r
+}\r