start12.c

来自「freesacle的实时操作系统UCOS的开发程序」· C语言 代码 · 共 32 行

C
32
字号
/********************************************************************
*
*文件名 :   Start12.c
*
*功能描述 :完成硬件系统的初始化 ,程序的入口
*
**********************************************************************
*/

#include "hidef.h"
#include "start12.h"
#include "mc9s12dg128.h"

extern void HardwareInit(void); 
extern void main(void);
extern void uart_init(void);

#pragma DATA_SEG __NEAR_SEG STARTUP_DATA /* _startupData can be accessed using 16 bit accesses. This is needed because it contains the stack top, and without stack, far data cannot be accessed */
struct _tagStartup _startupData;         /*   read-only: */


void _Startup(void){

        INITRM=0x21;     //Memory remap.内存映射..
        INITRG=0;
        INITEE=0x11;
        asm{LDS #$4000   //设置堆栈.. 
        }	               
        HardwareInit();	 //硬件系统初始化
        uart_init();    //only use for debug ...
        main();	        //主函数运行..
}

⌨️ 快捷键说明

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