123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- #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ÊdzÌÐòµÄÈë¿Ú
- #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.
- //===========================================================================
|