flashreport.c

来自「Nand Flash (SAMSUNG_K9K1G08U0B) boot loa」· C语言 代码 · 共 121 行

C
121
字号
#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 + =
减小字号Ctrl + -
显示快捷键?