submain.c

来自「ADS1.2 samples」· C语言 代码 · 共 33 行

C
33
字号
/*
** Copyright (C) ARM Limited, 2002. All rights reserved.
*/

/*
** $Sub$$main() is executed immediately before the user defined main() function.  
** Compile this with -DUSE_SERIAL_PORT to initialize serial port on Integrator.
** For information on $Sub and $Super, see ADS 1.2 Linker and Utilities Guide
*/


__weak extern void cache_init(void);
extern void $Super$$main(void);
extern void init_serial_A(void);


void $Sub$$main(void)
{
  int temp;
  cache_init();                    // enables caches
#ifdef USE_SERIAL_PORT
  init_serial_A();                 // initialize the AP serial port A
#endif
	__asm                      // enable IRQs
	{
		MRS temp, CPSR
		BIC temp, temp, #0x80
		MSR CPSR_c, temp
	}
  $Super$$main();                  // calls the original function main()
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?