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

📄 flashreport.c

📁 Nand Flash (SAMSUNG_K9K1G08U0B) boot loader for i.Mx31 (freescale).
💻 C
字号:
#include <nand/flashreport_define.h>
#include "MX31_HABTools.h"

extern U32 _gchannel;

void FlashReport_Error(u32 Error, u32 ExtraInfo)
{
  switch(Error){
  //REPORT_ERROR_ERASE
    case REPORT_ERROR_ERASE:
#ifdef DEBUG
         Message("Error: Erase Error !\n");
         Message("Error: Address = 0x%.8X\n", ExtraInfo);
#endif
         break;
   //REPORT_ERROR_PROGEAM      
    case REPORT_ERROR_PROGEAM:
#ifdef DEBUG
         Message("Error: Program Error !\n");
         Message("Error: Address = 0x%.8X\n", ExtraInfo);
#endif

#ifdef HABTOOLKIT_FLASH_LIB
	while(1)
		HAB_flash_status(FLASH_WRITE_ERROR, 0, _gchannel);
#endif

         break;
    //REPORT_ERROR_VERIFY
    case REPORT_ERROR_VERIFY:
#ifdef DEBUG
         Message("Error: Verification Error !\n");
         Message("Error: Address = 0x%.8X\n", ExtraInfo);
#endif

#ifdef HABTOOLKIT_FLASH_LIB
	while (1)
		HAB_flash_status(FLASH_VERIFY_ERROR, 0, _gchannel);
#endif

         break;
    //REPORT_ERROR_TIMEOUT
    case REPORT_ERROR_TIMEOUT:
#ifdef DEBUG
         Message("Error: Time Out Error !\n");
#endif
         break;
    //REPORT_ERROR_STOP
    case REPORT_ERROR_STOP:
#ifdef DEBUG
         Message("Error: Process terminated!\n");
#endif
         break;
  }
}

void FlashReport_ProgramByteDone(u32 ByteDone)
{
#ifdef DEBUG
  Message("Write: ByteDone = %d\n", ByteDone);
#endif

#ifdef HABTOOLKIT_FLASH_LIB
	HAB_flash_status(FLASH_WRITE, ByteDone, _gchannel);
#endif

}

void FlashReport_VerifyByteDone(u32 ByteDone)
{
#ifdef DEBUG
  Message("Verify: ByteDone = %d\n", ByteDone);
#endif

#ifdef HABTOOLKIT_FLASH_LIB
	HAB_flash_status(FLASH_VERIFY, ByteDone, _gchannel);
#endif
}

void FlashReport_ProgramComplete(void)
{
#ifdef DEBUG
  Message("Flash Program Complete !\n");
#endif

#ifdef HABTOOLKIT_FLASH_LIB
	while (1)
	HAB_flash_status(FLASH_OK, 0, _gchannel);
#endif
}

void FlashReport_VerifyComplete(void)
{
#ifdef DEBUG
  Message("Flash Verificaiton Complete !\n");
#endif

#ifdef HABTOOLKIT_FLASH_LIB
	while (1)
	HAB_flash_status(FLASH_OK, 0, _gchannel);
#endif

}

void FlashReport_EraseByteDone(u32 ByteDone)
{
#ifdef DEBUG
  Message("Erase: Byte Done = %d\n", ByteDone);
#endif

#ifdef HABTOOLKIT_FLASH_LIB
	HAB_flash_status(FLASH_ERASE, ByteDone, _gchannel);
#endif
}

void FlashReport_EraseComplete(void)
{
#ifdef DEBUG
  Message("Flash Erase Complele !\n");
#endif
}

⌨️ 快捷键说明

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