Fix model## format model notes not working (#1202)

use yml instead of bin to construct notes file name from model file n…
This commit is contained in:
Peter Feerick
2021-12-02 11:52:23 +10:00
committed by GitHub
+7 -1
View File
@@ -438,6 +438,12 @@ static void replaceSpaceWithUnderscore(std::string& name)
} while (index != std::string::npos);
}
#if defined(SDCARD_YAML)
#define MODEL_FILE_EXT YAML_EXT
#else
#define MODEL_FILE_EXT MODELS_EXT
#endif
bool openNotes(const char buf[], std::string modelNotesName)
{
if(isFileAvailable(modelNotesName.c_str())) {
@@ -466,7 +472,7 @@ void readModelNotes()
#if !defined(EEPROM)
if(!notesFound) {
modelNotesName.assign(g_eeGeneral.currModelFilename);
size_t index = modelNotesName.find(".bin");
size_t index = modelNotesName.find(MODEL_FILE_EXT);
if(index != std::string::npos)
{
modelNotesName.erase(index);