Set current model in ModelsList while loading

This commit is contained in:
Raphael Coeffic
2021-11-10 11:07:03 +01:00
parent c6b847c9ac
commit 3717e37e3f
5 changed files with 41 additions and 65 deletions
+6 -2
View File
@@ -355,8 +355,12 @@ bool ModelsList::loadYaml()
// YAML reader
TRACE("YAML modelslist reader");
YamlParser yp; //TODO: move to re-usable buffer
yp.init(get_modelslist_parser_calls(), get_modelslist_iter());
YamlParser yp;
void* ctx = get_modelslist_iter(
g_eeGeneral.currModelFilename,
strnlen(g_eeGeneral.currModelFilename, LEN_MODEL_FILENAME));
yp.init(get_modelslist_parser_calls(), ctx);
UINT bytes_read=0;
while (f_read(&file, line, sizeof(line), &bytes_read) == FR_OK) {