Technical information
SH7285 Group
Example of Initialization
REJ06B0860-0100/Rev.1.00 June 2009 Page 11 of 21
3.2 Sample Program Listing "resetprg.c" (2/3)
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/* ==== Macro definition ==== */
#define SR_Init 0x000000F0
#define INT_OFFSET 0x10
/* ==== Prototype declaration ==== */
void PowerON_Reset_PC(void);
void Manual_Reset_PC(void);
/* ==== External reference declaration ==== */
/* ---- Function prototype ---- */
extern void HardwareSetup(void);
extern void main(void);
/* ---- Global variable ---- */
extern unsigned int INT_Vectors;
/* ==== Section name changed to ResetPRG ==== */
#pragma section ResetPRG
/* ==== Entry function specified ==== */
#pragma entry PowerON_Reset_PC
/*""FUNC COMMENT""**************************************************************
* ID :
* Outline : CPU initialization
*------------------------------------------------------------------------------
* Include : <machine.h>, <_h_c_lib.h>, and "iodefine.h"
*------------------------------------------------------------------------------
* Declaration : void PowerON_Reset_PC(void);
*------------------------------------------------------------------------------
* Description : Executes the CPU initialization processing to register
* : the power-on reset vector to the exception vector table.
*------------------------------------------------------------------------------
* Argument : void
*------------------------------------------------------------------------------
* Return Value : void
*------------------------------------------------------------------------------
* Note : This function is executed first after power-on reset.
*""FUNC COMMENT END""**********************************************************/
void PowerON_Reset_PC(void)
{
/* ==== Hardware initialization ==== */
HardwareSetup(); /* HardwareSetup function */
/* ==== B and R sections initialization ==== */
_INITSCT();