fix: crashes with bootloader simu

This commit is contained in:
Raphael Coeffic
2022-06-11 15:38:08 +02:00
committed by Raphael Coeffic
parent aff1977e24
commit 17b7cce05b
2 changed files with 11 additions and 5 deletions
+2
View File
@@ -635,7 +635,9 @@ int main(int argc, char ** argv)
startEepromThread(argc >= 2 ? argv[1] : "eeprom.bin");
#endif
#if !defined(SIMU_BOOTLOADER)
startAudioThread();
#endif
simuStart(true/*false*/, argc >= 3 ? argv[2] : 0, argc >= 4 ? argv[3] : 0);
return application.run();
+9 -5
View File
@@ -469,11 +469,15 @@ FRESULT f_readdir (DIR * rep, FILINFO * fil)
if (strcmp(ent->d_name, ".") && strcmp(ent->d_name, "..") ) break;
}
memset(fil->fname, 0, FF_MAX_LFN);
strcpy(fil->fname, ent->d_name);
// TRACE_SIMPGMSPACE("f_readdir(): %s", fil->fname);
std::string fullName = sd->name + std::string("/") + std::string(ent->d_name);
return f_stat(fullName.c_str(), fil);
if (fil != nullptr) {
memset(fil->fname, 0, FF_MAX_LFN);
strcpy(fil->fname, ent->d_name);
// TRACE_SIMPGMSPACE("f_readdir(): %s", fil->fname);
std::string fullName = sd->name + std::string("/") + std::string(ent->d_name);
return f_stat(fullName.c_str(), fil);
}
return FR_OK;
}
FRESULT f_mkfs (const TCHAR* path, BYTE opt, DWORD au, void* work, UINT len)