STM32H750XB_RT-THREAD/26-27-LTDC—液晶显示/刷外部FLASH程序(如何恢复字库)/User/res_mgr/res_reader.c
2025-07-21 14:34:29 +08:00

55 lines
1.3 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
******************************************************************************
* @file bsp_led.c
* @author fire
* @version V1.0
* @date 2015-xx-xx
* @brief led应用函数接口
******************************************************************************
* @attention
*
* 实验平台:野火 STM32 F429 开发板
* 论坛 :http://www.firebbs.cn
* 淘宝 :https://fire-stm32.taobao.com
*
******************************************************************************
*/
#include <string.h>
#include <stdlib.h>
#include "./flash/bsp_qspi_flash.h"
#include "RES_MGR.h"
/*=========================================================================================*/
/**
* @brief 从FLASH中的目录查找相应的资源位置
* @param res_base 目录在FLASH中的基地址
* @param res_name[in] 要查找的资源名字
* @retval -1表示找不到其余值表示资源在FLASH中的基地址
*/
int GetResOffset(const char *res_name)
{
int i,len;
CatalogTypeDef dir;
len =strlen(res_name);
for(i=0;i<CATALOG_SIZE;i+=sizeof(CatalogTypeDef))
{
BSP_QSPI_FastRead((uint8_t*)&dir,RESOURCE_BASE_ADDR+i,sizeof(CatalogTypeDef));
if(strncasecmp(dir.name,res_name,len)==0)
{
return dir.offset;
}
}
return -1;
}
/*********************************************END OF FILE**********************/