Merge pull request #9017 from thinkyhead/bf1_better_eeprom_init
[1.1.x] New EEPROM powers
This commit is contained in:
commit
0970dbcdf3
@ -306,8 +306,8 @@ extern float soft_endstop_min[XYZ], soft_endstop_max[XYZ];
|
|||||||
void update_software_endstops(const AxisEnum axis);
|
void update_software_endstops(const AxisEnum axis);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLED(CNC_COORDINATE_SYSTEMS)
|
|
||||||
#define MAX_COORDINATE_SYSTEMS 9
|
#define MAX_COORDINATE_SYSTEMS 9
|
||||||
|
#if ENABLED(CNC_COORDINATE_SYSTEMS)
|
||||||
extern float coordinate_system[MAX_COORDINATE_SYSTEMS][XYZ];
|
extern float coordinate_system[MAX_COORDINATE_SYSTEMS][XYZ];
|
||||||
bool select_coordinate_system(const int8_t _new);
|
bool select_coordinate_system(const int8_t _new);
|
||||||
#endif
|
#endif
|
||||||
|
@ -9837,6 +9837,18 @@ inline void gcode_M502() {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if ENABLED(EEPROM_SETTINGS)
|
||||||
|
/**
|
||||||
|
* M504: Validate EEPROM Contents
|
||||||
|
*/
|
||||||
|
inline void gcode_M504() {
|
||||||
|
if (settings.validate()) {
|
||||||
|
SERIAL_ECHO_START();
|
||||||
|
SERIAL_ECHOLNPGM("EEPROM OK");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
|
#if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -12050,6 +12062,9 @@ void process_parsed_command() {
|
|||||||
#if DISABLED(DISABLE_M503)
|
#if DISABLED(DISABLE_M503)
|
||||||
case 503: gcode_M503(); break; // M503: Report Settings (in SRAM)
|
case 503: gcode_M503(); break; // M503: Report Settings (in SRAM)
|
||||||
#endif
|
#endif
|
||||||
|
#if ENABLED(EEPROM_SETTINGS)
|
||||||
|
case 504: gcode_M504(); break; // M504: Validate EEPROM
|
||||||
|
#endif
|
||||||
|
|
||||||
#if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
|
#if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
|
||||||
case 540: gcode_M540(); break; // M540: Set Abort on Endstop Hit for SD Printing
|
case 540: gcode_M540(); break; // M540: Set Abort on Endstop Hit for SD Printing
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -29,31 +29,31 @@ class MarlinSettings {
|
|||||||
public:
|
public:
|
||||||
MarlinSettings() { }
|
MarlinSettings() { }
|
||||||
|
|
||||||
|
static uint16_t datasize();
|
||||||
|
|
||||||
static void reset();
|
static void reset();
|
||||||
static bool save();
|
static bool save(); // Return 'true' if data was saved
|
||||||
|
|
||||||
FORCE_INLINE static bool init_eeprom() {
|
FORCE_INLINE static bool init_eeprom() {
|
||||||
bool success = true;
|
bool success = true;
|
||||||
reset();
|
reset();
|
||||||
#if ENABLED(EEPROM_SETTINGS)
|
#if ENABLED(EEPROM_SETTINGS)
|
||||||
if ((success = save())) {
|
success = save();
|
||||||
#if ENABLED(AUTO_BED_LEVELING_UBL)
|
#if ENABLED(EEPROM_CHITCHAT)
|
||||||
success = load(); // UBL uses load() to know the end of EEPROM
|
if (success) report();
|
||||||
#elif ENABLED(EEPROM_CHITCHAT)
|
|
||||||
report();
|
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ENABLED(EEPROM_SETTINGS)
|
#if ENABLED(EEPROM_SETTINGS)
|
||||||
static bool load();
|
static bool load(); // Return 'true' if data was loaded ok
|
||||||
|
static bool validate(); // Return 'true' if EEPROM data is ok
|
||||||
|
|
||||||
#if ENABLED(AUTO_BED_LEVELING_UBL) // Eventually make these available if any leveling system
|
#if ENABLED(AUTO_BED_LEVELING_UBL) // Eventually make these available if any leveling system
|
||||||
// That can store is enabled
|
// That can store is enabled
|
||||||
FORCE_INLINE static int16_t get_start_of_meshes() { return meshes_begin; }
|
static int16_t meshes_start_index();
|
||||||
FORCE_INLINE static int16_t get_end_of_meshes() { return meshes_end; }
|
FORCE_INLINE static int16_t meshes_end_index() { return meshes_end; }
|
||||||
static uint16_t calc_num_meshes();
|
static uint16_t calc_num_meshes();
|
||||||
static void store_mesh(const int8_t slot);
|
static void store_mesh(const int8_t slot);
|
||||||
static void load_mesh(const int8_t slot, void * const into=NULL);
|
static void load_mesh(const int8_t slot, void * const into=NULL);
|
||||||
@ -77,7 +77,8 @@ class MarlinSettings {
|
|||||||
static void postprocess();
|
static void postprocess();
|
||||||
|
|
||||||
#if ENABLED(EEPROM_SETTINGS)
|
#if ENABLED(EEPROM_SETTINGS)
|
||||||
static bool eeprom_error;
|
|
||||||
|
static bool eeprom_error, validating;
|
||||||
|
|
||||||
#if ENABLED(AUTO_BED_LEVELING_UBL) // Eventually make these available if any leveling system
|
#if ENABLED(AUTO_BED_LEVELING_UBL) // Eventually make these available if any leveling system
|
||||||
// That can store is enabled
|
// That can store is enabled
|
||||||
@ -87,8 +88,10 @@ class MarlinSettings {
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static bool _load();
|
||||||
static void write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc);
|
static void write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc);
|
||||||
static void read_data(int &pos, uint8_t *value, uint16_t size, uint16_t *crc);
|
static void read_data(int &pos, uint8_t *value, uint16_t size, uint16_t *crc, const bool force=false);
|
||||||
|
static bool size_error(const uint16_t size);
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -308,12 +308,6 @@
|
|||||||
|
|
||||||
void unified_bed_leveling::G29() {
|
void unified_bed_leveling::G29() {
|
||||||
|
|
||||||
if (!settings.calc_num_meshes()) {
|
|
||||||
SERIAL_PROTOCOLLNPGM("?Enable EEPROM and init with");
|
|
||||||
SERIAL_PROTOCOLLNPGM("M502, M500, M501 in that order.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (g29_parameter_parsing()) return; // abort if parsing the simple parameters causes a problem,
|
if (g29_parameter_parsing()) return; // abort if parsing the simple parameters causes a problem,
|
||||||
|
|
||||||
// Check for commands that require the printer to be homed
|
// Check for commands that require the printer to be homed
|
||||||
@ -1273,8 +1267,8 @@
|
|||||||
SERIAL_EOL();
|
SERIAL_EOL();
|
||||||
safe_delay(50);
|
safe_delay(50);
|
||||||
|
|
||||||
SERIAL_PROTOCOLPAIR("Meshes go from ", hex_address((void*)settings.get_start_of_meshes()));
|
SERIAL_PROTOCOLPAIR("Meshes go from ", hex_address((void*)settings.meshes_start_index()));
|
||||||
SERIAL_PROTOCOLLNPAIR(" to ", hex_address((void*)settings.get_end_of_meshes()));
|
SERIAL_PROTOCOLLNPAIR(" to ", hex_address((void*)settings.meshes_end_index()));
|
||||||
safe_delay(50);
|
safe_delay(50);
|
||||||
|
|
||||||
SERIAL_PROTOCOLLNPAIR("sizeof(ubl) : ", (int)sizeof(ubl));
|
SERIAL_PROTOCOLLNPAIR("sizeof(ubl) : ", (int)sizeof(ubl));
|
||||||
@ -1283,7 +1277,7 @@
|
|||||||
SERIAL_EOL();
|
SERIAL_EOL();
|
||||||
safe_delay(25);
|
safe_delay(25);
|
||||||
|
|
||||||
SERIAL_PROTOCOLLNPAIR("EEPROM free for UBL: ", hex_address((void*)(settings.get_end_of_meshes() - settings.get_start_of_meshes())));
|
SERIAL_PROTOCOLLNPAIR("EEPROM free for UBL: ", hex_address((void*)(settings.meshes_end_index() - settings.meshes_start_index())));
|
||||||
safe_delay(50);
|
safe_delay(50);
|
||||||
|
|
||||||
SERIAL_PROTOCOLPAIR("EEPROM can hold ", settings.calc_num_meshes());
|
SERIAL_PROTOCOLPAIR("EEPROM can hold ", settings.calc_num_meshes());
|
||||||
|
@ -2303,7 +2303,6 @@ void kill_screen(const char* lcd_msg) {
|
|||||||
MENU_BACK(MSG_UBL_LEVEL_BED);
|
MENU_BACK(MSG_UBL_LEVEL_BED);
|
||||||
if (!WITHIN(ubl_storage_slot, 0, a - 1)) {
|
if (!WITHIN(ubl_storage_slot, 0, a - 1)) {
|
||||||
STATIC_ITEM(MSG_NO_STORAGE);
|
STATIC_ITEM(MSG_NO_STORAGE);
|
||||||
STATIC_ITEM(MSG_INIT_EEPROM);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
MENU_ITEM_EDIT(int3, MSG_UBL_STORAGE_SLOT, &ubl_storage_slot, 0, a - 1);
|
MENU_ITEM_EDIT(int3, MSG_UBL_STORAGE_SLOT, &ubl_storage_slot, 0, a - 1);
|
||||||
@ -4538,6 +4537,24 @@ void kill_screen(const char* lcd_msg) {
|
|||||||
END_SCREEN();
|
END_SCREEN();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FORCE_INLINE screenFunc_t ap_message_screen(const AdvancedPauseMessage message) {
|
||||||
|
switch (message) {
|
||||||
|
case ADVANCED_PAUSE_MESSAGE_INIT: return lcd_advanced_pause_init_message;
|
||||||
|
case ADVANCED_PAUSE_MESSAGE_UNLOAD: return lcd_advanced_pause_unload_message;
|
||||||
|
case ADVANCED_PAUSE_MESSAGE_INSERT: return lcd_advanced_pause_insert_message;
|
||||||
|
case ADVANCED_PAUSE_MESSAGE_LOAD: return lcd_advanced_pause_load_message;
|
||||||
|
case ADVANCED_PAUSE_MESSAGE_PURGE: return lcd_advanced_pause_purge_message;
|
||||||
|
case ADVANCED_PAUSE_MESSAGE_RESUME: return lcd_advanced_pause_resume_message;
|
||||||
|
case ADVANCED_PAUSE_MESSAGE_CLICK_TO_HEAT_NOZZLE: return lcd_advanced_pause_heat_nozzle;
|
||||||
|
case ADVANCED_PAUSE_MESSAGE_WAIT_FOR_NOZZLES_TO_HEAT: return lcd_advanced_pause_wait_for_nozzles_to_heat;
|
||||||
|
case ADVANCED_PAUSE_MESSAGE_OPTION: advanced_pause_menu_response = ADVANCED_PAUSE_RESPONSE_WAIT_FOR;
|
||||||
|
return lcd_advanced_pause_option_menu;
|
||||||
|
case ADVANCED_PAUSE_MESSAGE_STATUS:
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
void lcd_advanced_pause_show_message(
|
void lcd_advanced_pause_show_message(
|
||||||
const AdvancedPauseMessage message,
|
const AdvancedPauseMessage message,
|
||||||
const AdvancedPauseMode mode/*=ADVANCED_PAUSE_MODE_PAUSE_PRINT*/,
|
const AdvancedPauseMode mode/*=ADVANCED_PAUSE_MODE_PAUSE_PRINT*/,
|
||||||
@ -4545,48 +4562,13 @@ void kill_screen(const char* lcd_msg) {
|
|||||||
) {
|
) {
|
||||||
advanced_pause_mode = mode;
|
advanced_pause_mode = mode;
|
||||||
hotend_status_extruder = extruder;
|
hotend_status_extruder = extruder;
|
||||||
switch (message) {
|
const screenFunc_t next_screen = ap_message_screen(message);
|
||||||
case ADVANCED_PAUSE_MESSAGE_INIT:
|
if (next_screen) {
|
||||||
defer_return_to_status = true;
|
defer_return_to_status = true;
|
||||||
lcd_goto_screen(lcd_advanced_pause_init_message);
|
lcd_goto_screen(next_screen);
|
||||||
break;
|
|
||||||
case ADVANCED_PAUSE_MESSAGE_UNLOAD:
|
|
||||||
defer_return_to_status = true;
|
|
||||||
lcd_goto_screen(lcd_advanced_pause_unload_message);
|
|
||||||
break;
|
|
||||||
case ADVANCED_PAUSE_MESSAGE_INSERT:
|
|
||||||
defer_return_to_status = true;
|
|
||||||
lcd_goto_screen(lcd_advanced_pause_insert_message);
|
|
||||||
break;
|
|
||||||
case ADVANCED_PAUSE_MESSAGE_LOAD:
|
|
||||||
defer_return_to_status = true;
|
|
||||||
lcd_goto_screen(lcd_advanced_pause_load_message);
|
|
||||||
break;
|
|
||||||
case ADVANCED_PAUSE_MESSAGE_PURGE:
|
|
||||||
defer_return_to_status = true;
|
|
||||||
lcd_goto_screen(lcd_advanced_pause_purge_message);
|
|
||||||
break;
|
|
||||||
case ADVANCED_PAUSE_MESSAGE_CLICK_TO_HEAT_NOZZLE:
|
|
||||||
defer_return_to_status = true;
|
|
||||||
lcd_goto_screen(lcd_advanced_pause_heat_nozzle);
|
|
||||||
break;
|
|
||||||
case ADVANCED_PAUSE_MESSAGE_WAIT_FOR_NOZZLES_TO_HEAT:
|
|
||||||
defer_return_to_status = true;
|
|
||||||
lcd_goto_screen(lcd_advanced_pause_wait_for_nozzles_to_heat);
|
|
||||||
break;
|
|
||||||
case ADVANCED_PAUSE_MESSAGE_OPTION:
|
|
||||||
defer_return_to_status = true;
|
|
||||||
advanced_pause_menu_response = ADVANCED_PAUSE_RESPONSE_WAIT_FOR;
|
|
||||||
lcd_goto_screen(lcd_advanced_pause_option_menu);
|
|
||||||
break;
|
|
||||||
case ADVANCED_PAUSE_MESSAGE_RESUME:
|
|
||||||
defer_return_to_status = true;
|
|
||||||
lcd_goto_screen(lcd_advanced_pause_resume_message);
|
|
||||||
break;
|
|
||||||
case ADVANCED_PAUSE_MESSAGE_STATUS:
|
|
||||||
lcd_return_to_status();
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
lcd_return_to_status();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // ADVANCED_PAUSE_FEATURE
|
#endif // ADVANCED_PAUSE_FEATURE
|
||||||
|
@ -157,4 +157,3 @@ void matrix_3x3::debug(const char * const title) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif // HAS_ABL
|
#endif // HAS_ABL
|
||||||
|
|
||||||
|
@ -41,8 +41,6 @@
|
|||||||
#ifndef VECTOR_3_H
|
#ifndef VECTOR_3_H
|
||||||
#define VECTOR_3_H
|
#define VECTOR_3_H
|
||||||
|
|
||||||
#if HAS_ABL
|
|
||||||
|
|
||||||
class matrix_3x3;
|
class matrix_3x3;
|
||||||
|
|
||||||
struct vector_3 {
|
struct vector_3 {
|
||||||
@ -79,5 +77,4 @@ struct matrix_3x3 {
|
|||||||
|
|
||||||
void apply_rotation_xyz(matrix_3x3 rotationMatrix, float &x, float &y, float &z);
|
void apply_rotation_xyz(matrix_3x3 rotationMatrix, float &x, float &y, float &z);
|
||||||
|
|
||||||
#endif // HAS_ABL
|
|
||||||
#endif // VECTOR_3_H
|
#endif // VECTOR_3_H
|
||||||
|
Loading…
Reference in New Issue
Block a user