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 +