![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
code avec la sortie d'évitement en plus géré par un ticker, ce code et le code "avec_modifs" buggent en match avec seulement la stratégie agressive.
Dependencies: mbed SerialHalfDuplex SDFileSystem liaison_Bluetooth ident_crac DISCO-F469NI_portrait
Diff: Instruction/lecture_repertoire.cpp
- Revision:
- 29:ff575aff301f
- Parent:
- 24:1a13c998c7ac
diff -r 7f2990747e09 -r ff575aff301f Instruction/lecture_repertoire.cpp --- a/Instruction/lecture_repertoire.cpp Fri Jul 17 14:35:11 2020 +0000 +++ b/Instruction/lecture_repertoire.cpp Wed Mar 17 08:13:52 2021 +0000 @@ -3,6 +3,7 @@ struct dirent* files_name[10]; char *rest; +char sd_present=0; void lecture_fichier(void){ @@ -11,28 +12,34 @@ DIR* rep = NULL; mkdir("/sd", 0777); - strcpy(cheminFileStart,"/sd"); - rep=opendir("/sd"); - - for(i=0;i<20;i++){ - files_name[i]= readdir(rep); + strcpy(cheminFileStart,"/sd"); + rep=opendir("/sd"); + + for(i=0;i<20;i++) + { + files_name[i]= readdir(rep); + + if(files_name[i]->d_name=="") + { + i=20; + } + else + { + sd_present=1; + strcpy(strat_sd[i-j],files_name[i]->d_name); + rest=strstr(strat_sd[i-j],".txt"); - if(files_name[i]->d_name==""){ - i=20; + if(rest==NULL) + { + strcpy(strat_sd[i-j],""); + j++; + } + else + { + strcpy(strat_sd[i-j],strtok(strat_sd[i-j],".")); + } + + } } - else{ - strcpy(strat_sd[i-j],files_name[i]->d_name); - rest=strstr(strat_sd[i-j],".txt"); - - if(rest==NULL){ - strcpy(strat_sd[i-j],""); - j++; - } - else{ - strcpy(strat_sd[i-j],strtok(strat_sd[i-j],".")); - } - - } - } }