添加功能

scan_files:扫描目录
This commit is contained in:
Qiea
2024-11-13 00:38:53 +08:00
parent 9566fb0db7
commit 5ee5304676
5 changed files with 42 additions and 3 deletions

4
.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
/OBJ
*.dbgconf
*.Qi

View File

@@ -1,5 +1,6 @@
#include "debug.h"
#include "led.h"
#include "exfuns.h"
u8 _DEBUG = 1;
@@ -33,6 +34,26 @@ void SDRAM_USED(){
}
void scan_files(u8 * path)
{
FRESULT res;
res = f_opendir(&dir,(const TCHAR*)path); //<2F><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>Ŀ¼
if (res == FR_OK)
{
printf("\r\n");
while(1)
{
res = f_readdir(&dir, &fileinfo); //<2F><>ȡĿ¼<C4BF>µ<EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ļ<EFBFBD>
if (res != FR_OK || fileinfo.fname[0] == 0) break; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/<2F><>ĩβ<C4A9><CEB2>,<2C>˳<EFBFBD>
//if (fileinfo.fname[0] == '.') continue; //<2F><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>Ŀ¼
printf("%s/", path);//<2F><>ӡ·<D3A1><C2B7>
printf("%s\r\n",fileinfo.fname);//<2F><>ӡ<EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>
}
}
}
TIM_HandleTypeDef TIM3_Handler; //<2F><>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//ͨ<>ö<EFBFBD>ʱ<EFBFBD><CAB1>3<EFBFBD>жϳ<D0B6>ʼ<EFBFBD><CABC>

View File

@@ -10,6 +10,7 @@
void DEBUG(void);
void DEBUG_PRINTF(const char *fmt, ...);
void SDRAM_USED(void);
void scan_files(u8 * path);
void TIM3_Init(u16 arr,u16 psc);
#endif

View File

@@ -13,6 +13,7 @@ struct _m_usmart_nametab usmart_nametab[]=
{
(void*)DEBUG,"void DEBUG(void)",
(void*)SDRAM_USED,"void SDRAM_USED(void)",
(void*)scan_files,"void scan_files(u8 * path)",
(void*)modelmym_init,"float* modelmym_init(char* model_name)",
(void*)modelmym_free,"u8 modelmym_free(char* model_name)",

View File

@@ -723,7 +723,7 @@
<Group>
<GroupName>USMART</GroupName>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
@@ -767,7 +767,7 @@
<Group>
<GroupName>FATFS</GroupName>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
@@ -823,7 +823,7 @@
<Group>
<GroupName>CNN</GroupName>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
@@ -863,6 +863,18 @@
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>9</GroupNumber>
<FileNumber>52</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\PORTING\CNN\tools.c</PathWithFileName>
<FilenameWithoutPath>tools.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
</Group>
</ProjectOpt>