资源简介
该1代码可以使用,只需配置参数和添加底层接口,我找了好久才找到的。
代码片段和文件信息
#ifndef _FIL_BAD_C_
#define _FIL_BAD_C_
/****************************************************************************
*
* Copyright (c) 2005 by HCC embedded
*
* This software is copyrighted by and is the sole property of
* HCC. All rights title ownership or other interests
* in the software remain the property of HCC. This
* software may only be used in accordance with the corresponding
* license agreement. Any unauthorized use duplication transmission
* distribution or disclosure of this software is expressly forbidden.
*
* This Copyright notice may not be removed or modified without prior
* written consent of HCC.
*
* HCC reserves the right to modify this software without notice.
*
* HCC embedded
* Budapest 1132
* Victor Hugo Utca 11-15
* Hungary
*
* Tel: +36 (1) 450 1302
* Fax: +36 (1) 450 1303
* http: www.hcc-embedded.com
* email: info@hcc-embedded.com
*
***************************************************************************/
/****************************************************************************
*
* Bad Block handling
*
***************************************************************************/
#include “llayer.h“
#include “mlayer.h“
#include “fil_wear.h“
#include “fil_bad.h“
/****************************************************************************
*
* variables
*
***************************************************************************/
/****************************************************************************
*
* bb_getmaxreserved
*
* retreives the number of reserved block valid only after bb_init
*
* RETURNS
*
* number of used reserved entry
*
***************************************************************************/
unsigned short bb_getmaxreserved() {
return gl_mlayer->bad_maxentry;
}
/****************************************************************************
*
* bb_init
*
* initializing bad block handler this must be called at power on after
* flash type are determined after map page loaded
*
* INPUTS
*
* maxentry - maximum number of entries
*
***************************************************************************/
unsigned char bb_init(unsigned short maxentry) {
ST_SPARE *sptr=GET_SPARE_AREA(gl_mlayer->badpagebuffer);
unsigned short a;
unsigned char ret;
if (maxentry > (MAX_DATA_SIZE/2)) maxentry=(MAX_DATA_SIZE/2); //maximum allowed in one page!
gl_mlayer->bad_table=(t_ba*)gl_mlayer->badpagebuffer; //set up pointer
gl_mlayer->bad_maxentry=maxentry;
gl_mlayer->bad_init_index=0;
if (gl_mlayer->badblock->pba==BLK_NA) ret=0xf0; //not exist
else if (gl_mlayer->badblock->ppo>=MAX_PAGE_PER_BLOCK) ret=0xf1; //invalid page
else ret=ll_read((t_ba)(gl_mlayer->start_pba+gl_mlayer->badblock->pba)gl_mlayer->badblock->ppogl_mlayer->badpagebuffer);
if (!ret) {
if (sptr->block_type!=BLK_TYPE_BAD) ret=0xf2; //it is corre
- 上一篇:51单片机爱心.zip
- 下一篇:ssh航空订票系统
相关资源
- stm32F103C8外部flash图片显示
-
ansoftli
nks4.1安装包 - TFT-LCD-touch模拟器VC
- ALIENTEK 3.5寸TFTLCD模块资料
- STM32F407+ov5640摄像头在TFTLCD实时显示图
- ALIENTEK MINISTM32 实验10 TFTLCD显示实验
- STM322.8寸TFTLCD屏虚拟键盘触摸程序
- TFTLCD实时绘制曲线曲线动态更新
- STM32F103ZET6-TFTLCD显示二维码
- 基于stm32的温湿度采集显示系统设计
- ili9342 并口驱动
- OV7670摄像头TFTLCD.zip
- STM32 STM32F103C8T6 三星S6D05A1_TFTLCD_32048
- 最新3.5寸TFTLCD模块(NT35310)资料
-
ansoftli
nks 4.2.7z - 基于STM32实现的温度控制系统TFTLCD 蜂
- 3D Nand FTL映射管理方案
- freemarkerFTL常见语法大全
- TFTLCD 数据手册
- STM32的TFTLCD显示程序,亲测能用
- 3.5TFTLCD封装库.IntLib
- mcrion_NFTL.zip
- A Re-configurable FTL (Flash Translation la<
- A Reconfigurable FTL Architecture for NAND Fla
- FSMC驱动TFT液晶的最详细的解释
评论
共有 条评论