Merge remote-tracking branch 'upstream/MK3' into MK3-new_lang

This commit is contained in:
Robert Pelnar 2018-06-13 18:56:54 +02:00
commit 9608d5c832
4 changed files with 17 additions and 7 deletions

View file

@ -357,7 +357,7 @@ extern uint8_t print_percent_done_silent;
extern uint16_t print_time_remaining_silent; extern uint16_t print_time_remaining_silent;
#define PRINT_TIME_REMAINING_INIT 65535 #define PRINT_TIME_REMAINING_INIT 65535
#define PRINT_PERCENT_DONE_INIT 255 #define PRINT_PERCENT_DONE_INIT 255
#define PRINTER_ACTIVE (IS_SD_PRINTING || is_usb_printing || isPrintPaused || (custom_message_type == 4) || saved_printing || (lcd_commands_type == LCD_COMMAND_V2_CAL)) #define PRINTER_ACTIVE (IS_SD_PRINTING || is_usb_printing || isPrintPaused || (custom_message_type == 4) || saved_printing || (lcd_commands_type == LCD_COMMAND_V2_CAL) || card.paused)
extern void calculate_extruder_multipliers(); extern void calculate_extruder_multipliers();

View file

@ -8631,24 +8631,21 @@ void restore_print_from_eeprom() {
for (int i = 0; i < depth; i++) { for (int i = 0; i < depth; i++) {
for (int j = 0; j < 8; j++) { for (int j = 0; j < 8; j++) {
dir_name[j] = eeprom_read_byte((uint8_t*)EEPROM_DIRS + j + 8 * i); dir_name[j] = eeprom_read_byte((uint8_t*)EEPROM_DIRS + j + 8 * i);
} }
dir_name[8] = '\0'; dir_name[8] = '\0';
MYSERIAL.println(dir_name); MYSERIAL.println(dir_name);
strcpy(dir_names[i], dir_name);
card.chdir(dir_name); card.chdir(dir_name);
} }
for (int i = 0; i < 8; i++) { for (int i = 0; i < 8; i++) {
filename[i] = eeprom_read_byte((uint8_t*)EEPROM_FILENAME + i); filename[i] = eeprom_read_byte((uint8_t*)EEPROM_FILENAME + i);
} }
filename[8] = '\0'; filename[8] = '\0';
MYSERIAL.print(filename); MYSERIAL.print(filename);
strcat_P(filename, PSTR(".gco")); strcat_P(filename, PSTR(".gco"));
sprintf_P(cmd, PSTR("M23 %s"), filename); sprintf_P(cmd, PSTR("M23 %s"), filename);
for (c = &cmd[4]; *c; c++)
*c = tolower(*c);
enquecommand(cmd); enquecommand(cmd);
uint32_t position = eeprom_read_dword((uint32_t*)(EEPROM_FILE_POSITION)); uint32_t position = eeprom_read_dword((uint32_t*)(EEPROM_FILE_POSITION));
SERIAL_ECHOPGM("Position read from eeprom:"); SERIAL_ECHOPGM("Position read from eeprom:");

View file

@ -523,6 +523,9 @@ void CardReader::getStatus()
SERIAL_PROTOCOL(itostr2(time%60)); SERIAL_PROTOCOL(itostr2(time%60));
SERIAL_PROTOCOLPGM("\n"); SERIAL_PROTOCOLPGM("\n");
} }
else if (paused) {
SERIAL_PROTOCOLLNPGM("SD print paused");
}
else if (saved_printing) { else if (saved_printing) {
SERIAL_PROTOCOLLNPGM("Print saved"); SERIAL_PROTOCOLLNPGM("Print saved");
} }

View file

@ -7137,8 +7137,18 @@ 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);
const char end[5] = ".gco";
//we are storing just first 8 characters of 8.3 filename assuming that extension is always ".gco"
for (int i = 0; i < 8; i++) { for (int i = 0; i < 8; i++) {
eeprom_write_byte((uint8_t*)EEPROM_FILENAME + i, filename[i]); if (strcmp((cmd + i + 4), end) == 0) {
//filename is shorter then 8.3, store '\0' character on position where ".gco" string was found to terminate stored string properly
eeprom_write_byte((uint8_t*)EEPROM_FILENAME + i, '\0');
break;
}
else {
eeprom_write_byte((uint8_t*)EEPROM_FILENAME + i, cmd[i + 4]);
}
} }
uint8_t depth = (uint8_t)card.getWorkDirDepth(); uint8_t depth = (uint8_t)card.getWorkDirDepth();