Exemple #1
0
__attribute__((noreturn, __interrupt__)) void Reset_Handler(void)
{
	unsigned long *pSrc, *pDest;

	// copy the data segment initializers from flash to SRAM
	pSrc = &_etext;
	for (pDest = &_sdata; pDest < &_edata;)
	{
		*pDest++ = *pSrc++;
	}

	// zero fill the bss segment
	for (pDest = &_sbss; pDest < &_ebss;)
	{
		*pDest++ = 0;
	}
	
	FpuInit();

	// call global object ctors
	typedef void (*voidFunc)();
	for (pDest = &__ctors_start__; pDest < &__ctors_end__; pDest++)
	{
		((voidFunc) (*pDest))();
	}

	// call the application entry point

	main();

	for (;;)
		;
}
Exemple #2
0
void
SystemInit ()
{
#ifdef __USE_FPU__
  /* Initialize FPU */
  FpuInit ();
#endif
#ifdef __USE_CACHE__
  /* Enable Instruction Cache */
  SCB_EnableICache ();
  /* Enable Data Cache */
  SCB_EnableDCache ();
#endif
}