|
@@ -6188,27 +6188,25 @@ static void menu_action_sdfile(const char* filename, char* longFilename)
|
|
|
sprintf_P(cmd, PSTR("M23 %s"), filename);
|
|
|
for (c = &cmd[4]; *c; c++)
|
|
|
*c = tolower(*c);
|
|
|
+
|
|
|
+ for (int i = 0; i < 8; i++) {
|
|
|
+ eeprom_write_byte((uint8_t*)EEPROM_FILENAME + i, filename[i]);
|
|
|
+ }
|
|
|
+
|
|
|
+ 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 (int j = 0; j < 8; j++) {
|
|
|
+ eeprom_write_byte((uint8_t*)EEPROM_DIRS + j + 8 * i, dir_names[i][j]);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
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++) {
|
|
|
- eeprom_write_byte((uint8_t*)EEPROM_FILENAME + i, filename[i]);
|
|
|
- }
|
|
|
-
|
|
|
- uint8_t depth = (uint8_t)card.getWorkDirDepth();
|
|
|
-
|
|
|
- for (uint8_t i = 0; i < depth; i++) {
|
|
|
- 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_DIR_DEPTH, depth);
|
|
|
-
|
|
|
enquecommand(cmd);
|
|
|
enquecommand_P(PSTR("M24"));
|
|
|
}
|