Merge pull request #296 from PavelSindler/MK3_for_merging
Save filename to eeprom first, then check if file is complete
This commit is contained in:
commit
8a950d5972
2 changed files with 14 additions and 16 deletions
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
// Firmware version
|
// Firmware version
|
||||||
#define FW_version "3.1.1-RC1"
|
#define FW_version "3.1.1-RC1"
|
||||||
#define FW_build 125
|
#define FW_build 126
|
||||||
//#define FW_build --BUILD-NUMBER--
|
//#define FW_build --BUILD-NUMBER--
|
||||||
#define FW_version_build FW_version " b" STR(FW_build)
|
#define FW_version_build FW_version " b" STR(FW_build)
|
||||||
|
|
||||||
|
|
|
@ -6189,26 +6189,24 @@ static void menu_action_sdfile(const char* filename, char* longFilename)
|
||||||
for (c = &cmd[4]; *c; c++)
|
for (c = &cmd[4]; *c; c++)
|
||||||
*c = tolower(*c);
|
*c = tolower(*c);
|
||||||
|
|
||||||
if (!check_file(filename)) {
|
|
||||||
result = lcd_show_fullscreen_message_yes_no_and_wait_P(MSG_FILE_INCOMPLETE, false, false);
|
|
||||||
lcd_update_enable(true);
|
|
||||||
}
|
|
||||||
if (result) {
|
|
||||||
|
|
||||||
for (int i = 0; i < 8; i++) {
|
for (int i = 0; i < 8; i++) {
|
||||||
eeprom_write_byte((uint8_t*)EEPROM_FILENAME + i, filename[i]);
|
eeprom_write_byte((uint8_t*)EEPROM_FILENAME + i, filename[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t depth = (uint8_t)card.getWorkDirDepth();
|
uint8_t depth = (uint8_t)card.getWorkDirDepth();
|
||||||
|
eeprom_write_byte((uint8_t*)EEPROM_DIR_DEPTH, depth);
|
||||||
|
|
||||||
for (uint8_t i = 0; i < depth; i++) {
|
for (uint8_t i = 0; i < depth; i++) {
|
||||||
for (int j = 0; j < 8; j++) {
|
for (int j = 0; j < 8; j++) {
|
||||||
eeprom_write_byte((uint8_t*)EEPROM_DIRS + j + 8 * i, dir_names[i][j]);
|
eeprom_write_byte((uint8_t*)EEPROM_DIRS + j + 8 * i, dir_names[i][j]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
eeprom_write_byte((uint8_t*)EEPROM_DIR_DEPTH, depth);
|
|
||||||
|
|
||||||
|
if (!check_file(filename)) {
|
||||||
|
result = lcd_show_fullscreen_message_yes_no_and_wait_P(MSG_FILE_INCOMPLETE, false, false);
|
||||||
|
lcd_update_enable(true);
|
||||||
|
}
|
||||||
|
if (result) {
|
||||||
enquecommand(cmd);
|
enquecommand(cmd);
|
||||||
enquecommand_P(PSTR("M24"));
|
enquecommand_P(PSTR("M24"));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue