From 5ee5304676d4548c86d5c3aa4b6321539b820ee2 Mon Sep 17 00:00:00 2001 From: Qiea <1310371422@qq.com> Date: Wed, 13 Nov 2024 00:38:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit scan_files:扫描目录 --- .gitignore | 4 ++++ PORTING/CNN/debug.c | 21 +++++++++++++++++++++ PORTING/CNN/debug.h | 1 + PORTING/USMART/usmart_config.c | 1 + USER/FATFS.uvoptx | 18 +++++++++++++++--- 5 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..16f4d8d --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ + +/OBJ +*.dbgconf +*.Qi diff --git a/PORTING/CNN/debug.c b/PORTING/CNN/debug.c index d3c1b99..4b73186 100644 --- a/PORTING/CNN/debug.c +++ b/PORTING/CNN/debug.c @@ -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); //һĿ¼ + if (res == FR_OK) + { + printf("\r\n"); + while(1) + { + res = f_readdir(&dir, &fileinfo); //ȡĿ¼µһļ + if (res != FR_OK || fileinfo.fname[0] == 0) break; ///ĩβ,˳ + //if (fileinfo.fname[0] == '.') continue; //ϼĿ¼ + printf("%s/", path);//ӡ· + printf("%s\r\n",fileinfo.fname);//ӡļ + } + } +} + + + TIM_HandleTypeDef TIM3_Handler; //ʱ //ͨöʱ3жϳʼ diff --git a/PORTING/CNN/debug.h b/PORTING/CNN/debug.h index 3157f3e..44f0ba8 100644 --- a/PORTING/CNN/debug.h +++ b/PORTING/CNN/debug.h @@ -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 diff --git a/PORTING/USMART/usmart_config.c b/PORTING/USMART/usmart_config.c index 6ade908..aa10e08 100644 --- a/PORTING/USMART/usmart_config.c +++ b/PORTING/USMART/usmart_config.c @@ -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)", diff --git a/USER/FATFS.uvoptx b/USER/FATFS.uvoptx index faba5a9..7553ed9 100644 --- a/USER/FATFS.uvoptx +++ b/USER/FATFS.uvoptx @@ -723,7 +723,7 @@ USMART - 0 + 1 0 0 0 @@ -767,7 +767,7 @@ FATFS - 0 + 1 0 0 0 @@ -823,7 +823,7 @@ CNN - 0 + 1 0 0 0 @@ -863,6 +863,18 @@ 0 0 + + 9 + 52 + 1 + 0 + 0 + 0 + ..\PORTING\CNN\tools.c + tools.c + 0 + 0 +