bootloader user api.c

来自「基于Freescale-smac的点对点通讯。 简介:在Router(特征」· C语言 代码 · 共 66 行

C
66
字号
/********************************************************
application calls for Bootloader.


File: bootloader user api.c
  $Author: a20639 $
  $Date: 2006/07/31 17:21:59 $
  $Name:  $
********************************************************/
#include <hidef.h> /* for EnableInterrupts macro */
#include "pub_def.h"
#include "wireless_uart.h"
#include "bootloader user api.h"
#include "device_header.h"

// Include your current application header for PB assignments.
#include "freescale_radio_hardware.h"
#include "embedded_bootloader.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(PUSH_BUTTON1 == PB_PRESSED && 
		PUSH_BUTTON3 == PB_PRESSED)
		{
		
		  LED1 = 0;
		  LED2 = 0;
		  LED3 = 0;
		  LED4 = 0;
      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 + =
减小字号Ctrl + -
显示快捷键?