Merge remote-tracking branch 'refs/remotes/prusa3d/MK2' into MK2

# Conflicts:
#	Firmware/Marlin.h
#	Firmware/Marlin_main.cpp
#	Firmware/language_all.cpp
#	Firmware/language_de.h
#	Firmware/language_en.h
#	Firmware/language_it.h
#	Firmware/mesh_bed_calibration.cpp
#	Firmware/mesh_bed_calibration.h
#	Firmware/ultralcd.cpp
This commit is contained in:
3d-gussner 2017-07-06 10:31:28 +02:00
commit 1924266143
24 changed files with 38261 additions and 8088 deletions

View File

@ -48,6 +48,9 @@
#define EEPROM_BOWDEN_LENGTH (EEPROM_TEMP_CAL_ACTIVE - 2*4) //4 x int for bowden lengths for multimaterial
#define EEPROM_CALIBRATION_STATUS_PINDA (EEPROM_BOWDEN_LENGTH - 1) //0 - not calibrated; 1 - calibrated
#define EEPROM_FILENAME (EEPROM_CALIBRATION_STATUS_PINDA - 8) //8chars to store filename without extension
#define EEPROM_FILE_POSITION (EEPROM_FILENAME - 4) //32 bit for uint32_t file position
// Currently running firmware, each digit stored as uint16_t.
// The flavor differentiates a dev, alpha, beta, release candidate or a release version.
#define EEPROM_FIRMWARE_VERSION_END (FW_PRUSA3D_MAGIC_LEN+8)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -349,3 +349,7 @@ void temp_compensation_apply();
void temp_compensation_start();
void wait_for_heater(long codenum);
void serialecho_temperatures();
extern void save_print_to_eeprom();
extern void restore_print_from_eeprom();
extern void position_menu();

View File

@ -1380,7 +1380,6 @@ void get_command()
continue;
if(serial_char == '\n' ||
serial_char == '\r' ||
(serial_char == ':' && comment_mode == false) ||
serial_count >= (MAX_CMD_SIZE - 1) )
{
if(!serial_count) { //if empty line
@ -3491,6 +3490,7 @@ void process_commands()
starttime=millis();
break;
case 25: //M25 - Pause SD print
save_print_to_eeprom();
card.pauseSDPrint();
break;
case 26: //M26 - Set SD index
@ -4379,6 +4379,12 @@ Sigma_Exit:
}
}
break;
case 110: // M110 - reset line pos
if (code_seen('N'))
gcode_LastN = code_value_long();
else
gcode_LastN = 0;
break;
case 115: // M115
if (code_seen('V')) {
// Report the Prusa version number.
@ -6652,3 +6658,41 @@ void serialecho_temperatures() {
SERIAL_PROTOCOL_F(degBed(), 1);
SERIAL_PROTOCOLLN("");
}
void save_print_to_eeprom() {
eeprom_update_dword((uint32_t*)(EEPROM_FILE_POSITION), card.get_sdpos());
}
void restore_print_from_eeprom() {
char cmd[30];
char* c;
char filename[13];
char str[5] = ".gco";
for (int i = 0; i < 8; i++) {
filename[i] = eeprom_read_byte((uint8_t*)EEPROM_FILENAME + i);
}
filename[8] = '\0';
MYSERIAL.print(filename);
strcat(filename, str);
sprintf_P(cmd, PSTR("M23 %s"), filename);
for (c = &cmd[4]; *c; c++)
*c = tolower(*c);
enquecommand(cmd);
uint32_t position = eeprom_read_dword((uint32_t*)(EEPROM_FILE_POSITION));
SERIAL_ECHOPGM("Position read from eeprom:");
MYSERIAL.println(position);
card.setIndex(position);
enquecommand_P(PSTR("M24"));
sprintf_P(cmd, PSTR("M26 S%d"), position);
enquecommand(cmd);
}
void position_menu() {
SERIAL_ECHOPGM("Percent done:");
MYSERIAL.println(card.percentDone());
SERIAL_ECHOPGM("sdpos:");
MYSERIAL.println(card.get_sdpos());
}

View File

@ -47,6 +47,7 @@ public:
FORCE_INLINE void setIndex(long index) {sdpos = index;file.seekSet(index);};
FORCE_INLINE uint8_t percentDone(){if(!isFileOpen()) return 0; if(filesize) return sdpos/((filesize+99)/100); else return 0;};
FORCE_INLINE char* getWorkDirName(){workDir.getFilename(filename);return filename;};
FORCE_INLINE uint32_t get_sdpos() { if (!isFileOpen()) return 0; else return(sdpos); };
bool ToshibaFlashAir_isEnabled() const { return card.getFlashAirCompatible(); }
void ToshibaFlashAir_enable(bool enable) { card.setFlashAirCompatible(enable); }

View File

@ -273,9 +273,15 @@
#define MSG_MESH_BED_LEVELING "Mesh Bed Leveling"
#define MSG_MENU_CALIBRATION "Calibration"
<<<<<<< HEAD
#define(length=20) MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY_OFF "SD card [normal]"
#define(length=20) MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY_ON "SD card [FlshAir]"
#define(length=20) MSG_PRINTER_DISCONNECTED "Printer disconnected"
=======
#define(length=19, lines=1) MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY_OFF "SD card [normal]"
#define(length=19, lines=1) MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY_ON "SD card [FlshAir]"
#define(length=20, lines=1) MSG_PRINTER_DISCONNECTED "Printer disconnected"
>>>>>>> refs/remotes/prusa3d/MK2
#define(length=20, lines=1) MSG_FINISHING_MOVEMENTS "Finishing movements"
#define(length=20, lines=1) MSG_PRINT_PAUSED "Print paused"
#define(length=20, lines=1) MSG_RESUMING_PRINT "Resuming print"

View File

@ -2448,7 +2448,12 @@ void count_xyz_details() {
eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_VEC_Y + 4))
};
a2 = -1 * asin(vec_y[0] / MACHINE_AXIS_SCALE_Y);
/* SERIAL_ECHOLNPGM("par:");
MYSERIAL.println(vec_y[0]);
MYSERIAL.println(a2);*/
a1 = asin(vec_x[1] / MACHINE_AXIS_SCALE_X);
/* MYSERIAL.println(vec_x[1]);
MYSERIAL.println(a1);*/
angleDiff = fabs(a2 - a1);
for (uint8_t mesh_point = 0; mesh_point < 3; ++mesh_point) {
float y = vec_x[1] * pgm_read_float(bed_ref_points + mesh_point * 2) + vec_y[1] * pgm_read_float(bed_ref_points + mesh_point * 2 + 1) + cntr[1];

View File

@ -1121,11 +1121,14 @@ void temp_runaway_check(int _heater_id, float _target_temperature, float _curren
if (_current_temperature < ((_isbed) ? (0.8 * _target_temperature) : 150)) //check only in area where temperature is changing fastly for heater, check to 0.8 x target temperature for bed
{
__preheat_counter[_heater_id]++;
//SERIAL_ECHOPGM("counter[0]:"); MYSERIAL.println(__preheat_counter[0]);
//SERIAL_ECHOPGM("counter[1]:"); MYSERIAL.println(__preheat_counter[1]);
//SERIAL_ECHOPGM("_isbed"); MYSERIAL.println(_isbed);
if (__preheat_counter[_heater_id] > ((_isbed) ? 16 : 8)) // periodicaly check if current temperature changes
{
/*SERIAL_ECHOPGM("Heater:");
/*SERIAL_ECHOLNPGM("Heater:");
MYSERIAL.print(_heater_id);
SERIAL_ECHOPGM(" T:");
SERIAL_ECHOPGM(" Current temperature:");
MYSERIAL.print(_current_temperature);
SERIAL_ECHOPGM(" Tstart:");
MYSERIAL.print(__preheat_start[_heater_id]);*/

View File

@ -563,7 +563,7 @@ void lcd_commands()
enquecommand(cmd1);
if (axis_relative_modes[3] == true) enquecommand_P(PSTR("M83")); // set extruder to relative mode.
else enquecommand_P(PSTR("M82")); // set extruder to absolute mode
enquecommand_P(PSTR("G1 E" STRINGIFY((is_multi_material) ? DEFAULT_RETRACTION_MM : DEFAULT_RETRACTION_SM))); //unretract
enquecommand_P(PSTR("G1 E" STRINGIFY(DEFAULT_RETRACTION))); //unretract
enquecommand_P(PSTR("G90")); //absolute positioning
lcd_commands_step = 1;
}
@ -3740,6 +3740,8 @@ static void lcd_main_menu()
MENU_ITEM(back, MSG_WATCH, lcd_status_screen);
MENU_ITEM(function, PSTR("restore"), restore_print_from_eeprom);
MENU_ITEM(function, PSTR("position"), position_menu);
/* if (farm_mode && !IS_SD_PRINTING )
{
@ -4047,6 +4049,7 @@ void lcd_sdcard_stop()
lcd_return_to_status();
lcd_ignore_click(true);
lcd_commands_type = LCD_COMMAND_STOP_PRINT;
// Turn off the print fan
@ -4897,6 +4900,9 @@ static void menu_action_sdfile(const char* filename, char* longFilename)
for (c = &cmd[4]; *c; c++)
*c = tolower(*c);
enquecommand(cmd);
for (int i = 0; i < 8; i++) {
eeprom_write_byte((uint8_t*)EEPROM_FILENAME+i, filename[i]);
}
enquecommand_P(PSTR("M24"));
lcd_return_to_status();
}

View File

@ -742,6 +742,7 @@ static void lcd_implementation_status_screen()
if (IS_SD_PRINTING)
{
lcd.print(itostr3(card.percentDone()));
card.get_sdpos();
lcd.print('%');
}
else