Merge pull request #65 from PavelSindler/MK2

M304 doues not survive reboot fixed, farm mode activation fixed, xyz cal. messages fixed
This commit is contained in:
PavelSindler 2017-03-23 12:06:15 +01:00 committed by GitHub
commit 8c35b18ed4
4 changed files with 32 additions and 10 deletions

View file

@ -5,7 +5,7 @@
#include "Configuration_prusa.h" #include "Configuration_prusa.h"
// Firmware version // Firmware version
#define FW_version "3.0.10-6" #define FW_version "3.0.10-7"
#define FW_PRUSA3D_MAGIC "PRUSA3DFW" #define FW_PRUSA3D_MAGIC "PRUSA3DFW"
#define FW_PRUSA3D_MAGIC_LEN 10 #define FW_PRUSA3D_MAGIC_LEN 10

View file

@ -43,7 +43,7 @@ void _EEPROM_readData(int &pos, uint8_t* value, uint8_t size)
// wrong data being written to the variables. // wrong data being written to the variables.
// ALSO: always make sure the variables in the Store and retrieve sections are in the same order. // ALSO: always make sure the variables in the Store and retrieve sections are in the same order.
#define EEPROM_VERSION "V0" #define EEPROM_VERSION "V1"
#ifdef EEPROM_SETTINGS #ifdef EEPROM_SETTINGS
void Config_StoreSettings() void Config_StoreSettings()
@ -91,6 +91,11 @@ void Config_StoreSettings()
EEPROM_WRITE_VAR(i,dummy); EEPROM_WRITE_VAR(i,dummy);
EEPROM_WRITE_VAR(i,dummy); EEPROM_WRITE_VAR(i,dummy);
#endif #endif
#ifdef PIDTEMPBED
EEPROM_WRITE_VAR(i, bedKp);
EEPROM_WRITE_VAR(i, bedKi);
EEPROM_WRITE_VAR(i, bedKd);
#endif
#ifndef DOGLCD #ifndef DOGLCD
int lcd_contrast = 32; int lcd_contrast = 32;
#endif #endif
@ -119,7 +124,6 @@ void Config_StoreSettings()
EEPROM_WRITE_VAR(i, filament_size[2]); EEPROM_WRITE_VAR(i, filament_size[2]);
#endif #endif
#endif #endif
/*MYSERIAL.print("Top address used:\n"); /*MYSERIAL.print("Top address used:\n");
MYSERIAL.print(i); MYSERIAL.print(i);
MYSERIAL.print("\n"); MYSERIAL.print("\n");
@ -197,6 +201,15 @@ void Config_PrintSettings()
SERIAL_ECHOPAIR(" D" ,unscalePID_d(Kd)); SERIAL_ECHOPAIR(" D" ,unscalePID_d(Kd));
SERIAL_ECHOLN(""); SERIAL_ECHOLN("");
#endif #endif
#ifdef PIDTEMPBED
SERIAL_ECHO_START;
SERIAL_ECHOLNPGM("PID heatbed settings:");
SERIAL_ECHO_START;
SERIAL_ECHOPAIR(" M304 P", bedKp);
SERIAL_ECHOPAIR(" I", unscalePID_i(bedKi));
SERIAL_ECHOPAIR(" D", unscalePID_d(bedKd));
SERIAL_ECHOLN("");
#endif
#ifdef FWRETRACT #ifdef FWRETRACT
SERIAL_ECHO_START; SERIAL_ECHO_START;
SERIAL_ECHOLNPGM("Retract: S=Length (mm) F:Speed (mm/m) Z: ZLift (mm)"); SERIAL_ECHOLNPGM("Retract: S=Length (mm) F:Speed (mm/m) Z: ZLift (mm)");
@ -301,7 +314,12 @@ void Config_RetrieveSettings()
EEPROM_READ_VAR(i,Kp); EEPROM_READ_VAR(i,Kp);
EEPROM_READ_VAR(i,Ki); EEPROM_READ_VAR(i,Ki);
EEPROM_READ_VAR(i,Kd); EEPROM_READ_VAR(i,Kd);
#ifndef DOGLCD #ifdef PIDTEMPBED
EEPROM_READ_VAR(i, bedKp);
EEPROM_READ_VAR(i, bedKi);
EEPROM_READ_VAR(i, bedKd);
#endif
#ifndef DOGLCD
int lcd_contrast; int lcd_contrast;
#endif #endif
EEPROM_READ_VAR(i,lcd_contrast); EEPROM_READ_VAR(i,lcd_contrast);

View file

@ -1127,6 +1127,7 @@ void setup()
#endif #endif
farm_mode = eeprom_read_byte((uint8_t*)EEPROM_FARM_MODE); farm_mode = eeprom_read_byte((uint8_t*)EEPROM_FARM_MODE);
EEPROM_read_B(EEPROM_FARM_NUMBER, &farm_no); EEPROM_read_B(EEPROM_FARM_NUMBER, &farm_no);
if (farm_mode == 0xFF && farm_no == 0) farm_mode = false; //if farm_mode has not been stored to eeprom yet and farm number is set to zero, deactivate farm mode
if (farm_mode) if (farm_mode)
{ {
prusa_statistics(8); prusa_statistics(8);
@ -3403,10 +3404,13 @@ void process_commands()
// Let the user move the Z axes up to the end stoppers. // Let the user move the Z axes up to the end stoppers.
if (lcd_calibrate_z_end_stop_manual( onlyZ )) { if (lcd_calibrate_z_end_stop_manual( onlyZ )) {
refresh_cmd_timeout(); refresh_cmd_timeout();
if (((degHotend(0)>MAX_HOTEND_TEMP_CALIBRATION) || (degBed() > MAX_BED_TEMP_CALIBRATION))&& (!onlyZ)) lcd_wait_for_cool_down(); if (((degHotend(0) > MAX_HOTEND_TEMP_CALIBRATION) || (degBed() > MAX_BED_TEMP_CALIBRATION)) && (!onlyZ)) {
lcd_display_message_fullscreen_P(MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1); lcd_wait_for_cool_down();
lcd_implementation_print_at(0, 3, 1); lcd_show_fullscreen_message_and_wait_P(MSG_PAPER);
lcd_printPGM(MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE2); lcd_display_message_fullscreen_P(MSG_FIND_BED_OFFSET_AND_SKEW_LINE1);
lcd_implementation_print_at(0, 2, 1);
lcd_printPGM(MSG_FIND_BED_OFFSET_AND_SKEW_LINE2);
}
// Move the print head close to the bed. // Move the print head close to the bed.
current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;

View file

@ -1609,10 +1609,10 @@ calibrated:
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
if(only_z){/* if(only_z){
lcd_display_message_fullscreen_P(MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1); lcd_display_message_fullscreen_P(MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1);
lcd_implementation_print_at(0, 3, 1); lcd_implementation_print_at(0, 3, 1);
lcd_printPGM(MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE2);*/ lcd_printPGM(MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE2);
}else{ }else{
lcd_show_fullscreen_message_and_wait_P(MSG_PAPER); lcd_show_fullscreen_message_and_wait_P(MSG_PAPER);
lcd_display_message_fullscreen_P(MSG_FIND_BED_OFFSET_AND_SKEW_LINE1); lcd_display_message_fullscreen_P(MSG_FIND_BED_OFFSET_AND_SKEW_LINE1);