#include "DSP2803x_Device.h" // DSP2803x Headerfile Include File #include "DSP2803x_Examples.h" // DSP2803x Examples Include File #include "Flash2803x_API_Library.h" //0x3F 7FF6 and 0x3F 7FF7是程序的入口 #define BOOT_ENTRY_POINT 0x3F3FF6 struct BOOTSTATUS BootStatus; void (*program)() = (void (*)())(BOOT_ENTRY_POINT); void InitVar(void); void SystemTimer(void); Uint32 SystemTime = 0; //#pragma CODE_SECTION(main,"ramfuncs"); main() { InitSysCtrl(); InitGpio(); InitECan(); InitVar(); DisableDog(); MemCopy(&RamfuncsLoadStart, &RamfuncsLoadEnd, &RamfuncsRunStart); MemCopy(&Flash28_API_LoadStart, &Flash28_API_LoadEnd, &Flash28_API_RunStart); InitFlash(); DINT; IER = 0x0000; IFR = 0x0000; while(BootStatus.Reboot) { RunLedControl(); CanMaster(); SystemTimer(); } program(); } //--------------------------------------------------------------- void InitVar() { BootStatus.Reboot = 1; BootStatus.WorkStatus = 1; BootStatus.HexRow = 0; BootStatus.FrameId = 0; BootStatus.LineDataLen = 0; BootStatus.LineId = 0; BootStatus.SendNum = SHAKE_FIR_ACK; } //--------------------------------------------------------------- void SystemTimer() { SystemTime++; if(SystemTime > 1000000) { if(BootStatus.Reboot == BOOT_SHAKE_SUCCESS) { SystemTime = 0; }else { BootStatus.Reboot = FALSE; } } } //=========================================================================== // End of file. //===========================================================================