// Forward declaration of the default fault handlers.\r
//\r
//*****************************************************************************\r
-void ResetISR(void);\r
static void NmiSR(void);\r
static void FaultISR(void);\r
static void IntDefaultHandler(void);\r
// The entry point for the application.\r
//\r
//*****************************************************************************\r
-extern int main(void);\r
+extern void __iar_program_start(void);\r
\r
//*****************************************************************************\r
//\r
#ifndef STACK_SIZE\r
#define STACK_SIZE 64\r
#endif\r
-static unsigned long pulStack[STACK_SIZE];\r
+static unsigned long pulStack[STACK_SIZE] @ ".noinit";\r
\r
//*****************************************************************************\r
//\r
// 0x0000.0000.\r
//\r
//*****************************************************************************\r
-__root const uVectorEntry g_pfnVectors[] @ "INTVEC" =\r
+__root const uVectorEntry __vector_table[] @ ".intvec" =\r
{\r
{ .ulPtr = (unsigned long)pulStack + sizeof(pulStack) },\r
// The initial stack pointer\r
- ResetISR, // The reset handler\r
+ __iar_program_start, // The reset handler\r
NmiSR, // The NMI handler\r
FaultISR, // The hard fault handler\r
IntDefaultHandler, // The MPU fault handler\r
IntDefaultHandler // FLASH Control\r
};\r
\r
-//*****************************************************************************\r
-//\r
-// The following are constructs created by the linker, indicating where the\r
-// the "data" and "bss" segments reside in memory. The initializers for the\r
-// for the "data" segment resides immediately following the "text" segment.\r
-//\r
-//*****************************************************************************\r
-#pragma segment="DATA_ID"\r
-#pragma segment="DATA_I"\r
-#pragma segment="DATA_Z"\r
-\r
-//*****************************************************************************\r
-//\r
-// This is the code that gets called when the processor first starts execution\r
-// following a reset event. Only the absolutely necessary set is performed,\r
-// after which the application supplied entry() routine is called. Any fancy\r
-// actions (such as making decisions based on the reset cause register, and\r
-// resetting the bits in that register) are left solely in the hands of the\r
-// application.\r
-//\r
-//*****************************************************************************\r
-void\r
-ResetISR(void)\r
-{\r
- unsigned long *pulSrc, *pulDest, *pulEnd;\r
-\r
- //\r
- // Copy the data segment initializers from flash to SRAM.\r
- //\r
- pulSrc = __segment_begin("DATA_ID");\r
- pulDest = __segment_begin("DATA_I");\r
- pulEnd = __segment_end("DATA_I");\r
- while(pulDest < pulEnd)\r
- {\r
- *pulDest++ = *pulSrc++;\r
- }\r
-\r
- //\r
- // Zero fill the bss segment.\r
- //\r
- pulDest = __segment_begin("DATA_Z");\r
- pulEnd = __segment_end("DATA_Z");\r
- while(pulDest < pulEnd)\r
- {\r
- *pulDest++ = 0;\r
- }\r
-\r
- //\r
- // Call the application's entry point.\r
- //\r
- main();\r
-}\r
\r
//*****************************************************************************\r
//\r