BLTouch High Speed mode runtime configuration (#22916, #23337)

Co-Authored-By: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
InsanityAutomation
2021-12-21 23:09:55 -05:00
committed by Scott Lahteine
parent e0bed1e344
commit 9ecfa1d252
15 changed files with 140 additions and 63 deletions

View File

@ -301,7 +301,10 @@ typedef struct SettingsDataStruct {
//
// BLTOUCH
//
bool bltouch_last_written_mode;
bool bltouch_od_5v_mode;
#ifdef BLTOUCH_HS_MODE
bool bltouch_high_speed_mode; // M401 S
#endif
//
// Kinematic Settings
@ -918,9 +921,15 @@ void MarlinSettings::postprocess() {
// BLTOUCH
//
{
_FIELD_TEST(bltouch_last_written_mode);
const bool bltouch_last_written_mode = TERN(BLTOUCH, bltouch.last_written_mode, false);
EEPROM_WRITE(bltouch_last_written_mode);
_FIELD_TEST(bltouch_od_5v_mode);
const bool bltouch_od_5v_mode = TERN0(BLTOUCH, bltouch.od_5v_mode);
EEPROM_WRITE(bltouch_od_5v_mode);
#ifdef BLTOUCH_HS_MODE
_FIELD_TEST(bltouch_high_speed_mode);
const bool bltouch_high_speed_mode = TERN0(BLTOUCH, bltouch.high_speed_mode);
EEPROM_WRITE(bltouch_high_speed_mode);
#endif
}
//
@ -1810,13 +1819,23 @@ void MarlinSettings::postprocess() {
// BLTOUCH
//
{
_FIELD_TEST(bltouch_last_written_mode);
_FIELD_TEST(bltouch_od_5v_mode);
#if ENABLED(BLTOUCH)
const bool &bltouch_last_written_mode = bltouch.last_written_mode;
const bool &bltouch_od_5v_mode = bltouch.od_5v_mode;
#else
bool bltouch_last_written_mode;
bool bltouch_od_5v_mode;
#endif
EEPROM_READ(bltouch_od_5v_mode);
#ifdef BLTOUCH_HS_MODE
_FIELD_TEST(bltouch_high_speed_mode);
#if ENABLED(BLTOUCH)
const bool &bltouch_high_speed_mode = bltouch.high_speed_mode;
#else
bool bltouch_high_speed_mode;
#endif
EEPROM_READ(bltouch_high_speed_mode);
#endif
EEPROM_READ(bltouch_last_written_mode);
}
//
@ -2827,11 +2846,11 @@ void MarlinSettings::reset() {
TERN_(HAS_PTC, ptc.reset());
//
// BLTOUCH
// BLTouch
//
//#if ENABLED(BLTOUCH)
// bltouch.last_written_mode;
//#endif
#ifdef BLTOUCH_HS_MODE
bltouch.high_speed_mode = ENABLED(BLTOUCH_HS_MODE);
#endif
//
// Kinematic settings