Technical information

SH7285 Group
Example of Initialization
REJ06B0860-0100/Rev.1.00 June 2009 Page 12 of 21
3.3 Sample Program Listing "resetprg.c" (3/3)
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
/* ==== Vector Base Register setting ==== */
set_vbr((void *)((char *)&INT_Vectors - INT_OFFSET));
/* ==== Status Register initialization ==== */
set_cr(SR_Init);
nop();
/* ==== Bank Number Register setting ==== */
INTC.IBNR.BIT.BE = 0x01; /* Use of register banks enabled for all */
/* interrupts except NMI and user break */
/* ==== Interrupt enabling ==== */
set_imask(0); /* Interrupt mask bits clear */
/* ==== Main function call ==== */
main();
/* ==== Sleep instruction execution ==== */
sleep();
}
//#pragma entry Manual_Reset_PC /* Remove the comment when you use Manual Reset */
/*""FUNC COMMENT""**************************************************************
* ID :
* Outline : Manual reset processing
*------------------------------------------------------------------------------
* Include :
*------------------------------------------------------------------------------
* Declaration : void Manual_Reset_PC(void);
*------------------------------------------------------------------------------
* Description : Registers the manual reset vector to the exception vector table.
*------------------------------------------------------------------------------
* Argument : void
*------------------------------------------------------------------------------
* Return Value : void
*------------------------------------------------------------------------------
* Note : This sample does not describe the processing content at all.
* : Add the program in this function as needed.
*""FUNC COMMENT END""**********************************************************/
void Manual_Reset_PC(void)
{
/* NOP */
}
/* END of File */