⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bootloader user api.c

📁 利用MC13213做的基于SMAC的接受并发送到串口的程序.可作为点对点实验中的协调器.
💻 C
字号:
/********************************************************
application calls for Bootloader.


Author: LTR
File: bootloader user api.c
********************************************************/
#include <hidef.h> /* for EnableInterrupts macro */
#include "Embedded_Bootloader.h"
#include "freescale_radio_hardware.h"
#include "pub_def.h"
#include "smac_per_tx.h"
#include "bootloader user api.h"

  /**********************************************************************/

// NOTE!!! This code is only added to get the symbols in the build. The linker will remove these symbols if not referenced.
// Hope to find a better way 21.10.03 MVC 

void boot_init() {
  

    if((Freescale_Copyright[0] == 0x00) || (Firmware_Database_Label[0] == 0x00) ||
       (SMAC_Version[0] == 0x00) || (SPHY_Version[0] == 0x00) ||	(NV_RAM_ptr->Freescale_Copyright[0] == 0x00) ||
       (NV_RAM0.MAC_Address[0] == 0x00) || (NV_RAM1.MAC_Address[0] == 0x00)) 
    {
      DisableInterrupts;
      NV_Data_Init();
    }
    if(boot_loader_control == ((uint8_t)0x00))
      DisableInterrupts;
    if(boot_loader_flag == ((uint8_t)0x00))
      DisableInterrupts;



  /**********************************************************************/
   

    BootLoader_Interface_Init();


}

void boot_call() {
  

		// Push all 4 buttons from reset to active BootLoader
	// Next time the board is reset it will start up in BootLoader mode
	if(PB0 == PB_PRESSED && PB1 == PB_PRESSED && 
		PB2 == PB_PRESSED && PB3 == PB_PRESSED)
		{
		
		  LED1 = 0;
		  LED2 = 0;
		  LED3 = 0;
		  LED4 = 0;
      (void)Enable_Download_Firmware(ALL_BIT_ENABLED, DO_UPDATE_FIRMWARE);
            
      // Do a soft reset (execute illegal instruction
      Hard_Reset();
            
      // Wait for manual reset
      // for(;;);
		}


  
}

⌨️ 快捷键说明

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