Skip to content

Commit 1264ff4

Browse files
committed
Replace tabs with spaces
1 parent ed68d51 commit 1264ff4

36 files changed

Lines changed: 505 additions & 532 deletions

A10M_marlin1.1.8/Marlin/Marlin_main.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11105,15 +11105,15 @@ inline void gcode_M999() {
1110511105
// gcode_LastN = Stopped_gcode_LastN;
1110611106
FlushSerialRequestResend();
1110711107
}
11108-
inline void gcode_M2000(){
1110911108

11109+
inline void gcode_M2000() {
1111011110
}
11111-
inline void gcode_M2009(){
11112-
if (parser.seen('V')) hardware_version = parser.value_celsius();
11113-
//SERIAL_ECHOPAIR("HV...:", hardware_version);//liu
11114-
(void)settings.Fixed_parameter_save();
11115-
SERIAL_ECHOLNPGM("HV_set_ok");
1111611111

11112+
inline void gcode_M2009() {
11113+
if (parser.seen('V')) hardware_version = parser.value_celsius();
11114+
//SERIAL_ECHOPAIR("HV...:", hardware_version);//liu
11115+
(void)settings.fixed_parameter_save();
11116+
SERIAL_ECHOLNPGM("HV_set_ok");
1111711117
}
1111811118

1111911119
#if ENABLED(SWITCHING_EXTRUDER)
@@ -12526,7 +12526,8 @@ void process_parsed_command() {
1252612526
case 999: // M999: Restart after being Stopped
1252712527
gcode_M999();
1252812528
break;
12529-
case 2000: //
12529+
12530+
case 2000: //
1253012531
gcode_M2000();
1253112532
break;
1253212533
case 2009: //
@@ -14473,7 +14474,7 @@ void setup() {
1447314474
// Load data from EEPROM if available (or use defaults)
1447414475
// This also updates variables in the planner, elsewhere
1447514476
(void)settings.load();
14476-
(void)settings.Fixed_parameter_load();
14477+
(void)settings.fixed_parameter_load();
1447714478

1447814479

1447914480
#if HAS_M206_COMMAND
@@ -14786,12 +14787,11 @@ void loop() {
1478614787
// SERIAL_ECHOLN(tmp_y);
1478714788
// enqueue_and_echo_command(tmp_y);
1478814789
///////
14789-
if(current_position[Z_AXIS]>=5)
14790-
{
14791-
sprintf_P(tmp_y, PSTR("G28 X"));
14792-
//SERIAL_ECHOLN(tmp_y);
14793-
enqueue_and_echo_command(tmp_y);
14794-
}
14790+
if (current_position[Z_AXIS] >= 5) {
14791+
sprintf_P(tmp_y, PSTR("G28 X"));
14792+
//SERIAL_ECHOLN(tmp_y);
14793+
enqueue_and_echo_command(tmp_y);
14794+
}
1479514795
powerloss.recovery = Rec_Idle;
1479614796
}
1479714797
endstops.report_state();

A10M_marlin1.1.8/Marlin/configuration_store.cpp

Lines changed: 39 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -793,8 +793,6 @@ float hardware_version=0.1;
793793

794794
// Filament Runout Sensors
795795
EEPROM_READ(filament_runout_enabled);
796-
if(filament_runout_enabled != false)
797-
filament_runout_enabled = true;
798796

799797
if (working_crc == stored_crc) {
800798
#if ENABLED(EEPROM_CHITCHAT)
@@ -811,53 +809,51 @@ float hardware_version=0.1;
811809
}
812810
}
813811

812+
bool MarlinSettings::fixed_parameter_save() {//liu
813+
uint16_t working_crc = 0;
814+
EEPROM_START();
815+
eeprom_index = EEPROM_OFFSET_SN_VER;
814816

815-
bool MarlinSettings::Fixed_parameter_save() {//liu
817+
EEPROM_SKIP(working_crc); // Skip the checksum slot
818+
working_crc = 0;
819+
EEPROM_WRITE(hardware_version);//liu
816820

817-
uint16_t working_crc = 0;
818-
EEPROM_START();
819-
eeprom_index = EEPROM_OFFSET_SN_VER;
821+
const uint16_t final_crc = working_crc;
822+
const int eeprom_size = eeprom_index;
823+
eeprom_index = EEPROM_OFFSET_SN_VER;
824+
EEPROM_WRITE(final_crc);
820825

821-
EEPROM_SKIP(working_crc); // Skip the checksum slot
822-
working_crc = 0;
823-
EEPROM_WRITE(hardware_version);//liu hw ver
826+
#if ENABLED(EEPROM_CHITCHAT)
827+
SERIAL_ECHO_START();
828+
SERIAL_ECHOPAIR("Fixed parameter (", eeprom_size - EEPROM_OFFSET_SN_VER);
829+
SERIAL_ECHOPAIR(" bytes; crc ", (uint32_t)final_crc);
830+
SERIAL_ECHOLNPGM(")");
831+
#endif
832+
}
824833

825-
const uint16_t final_crc = working_crc;
826-
const int eeprom_size = eeprom_index;
827-
eeprom_index = EEPROM_OFFSET_SN_VER;
828-
EEPROM_WRITE(final_crc);
834+
bool MarlinSettings::fixed_parameter_load() {
835+
uint16_t working_crc = 0, stored_crc;
836+
EEPROM_START();
837+
eeprom_index = EEPROM_OFFSET_SN_VER;
838+
EEPROM_READ(stored_crc);
839+
working_crc = 0;
829840

830-
SERIAL_ECHO_START();
831-
SERIAL_ECHOPAIR("Fixed parameter (", eeprom_size - EEPROM_OFFSET_SN_VER);
832-
SERIAL_ECHOPAIR("Fixed parameter bytes; crc ", (uint32_t)final_crc);
833-
SERIAL_ECHOLNPGM(")");
841+
EEPROM_READ(hardware_version);//liu
842+
NOLESS(hardware_version, 0.1);
843+
SERIAL_ECHOLNPAIR("Hardware version:", hardware_version);//liu
834844

835-
}
836-
bool MarlinSettings::Fixed_parameter_load(){
837-
uint16_t working_crc = 0;
838-
uint16_t stored_crc;
839-
EEPROM_START();
840-
eeprom_index = EEPROM_OFFSET_SN_VER;
841-
EEPROM_READ(stored_crc);
842-
working_crc=0;
843-
EEPROM_READ(hardware_version);//liu hhardware_version
844-
if(hardware_version< 0.1)
845-
{
846-
hardware_version = 0.1;
847-
}
848-
SERIAL_ECHOPAIR(" hardware version:", hardware_version);//liu
849-
if (working_crc == stored_crc) {
850-
#if ENABLED(EEPROM_CHITCHAT)
851-
SERIAL_ECHO_START();
852-
SERIAL_ECHOPAIR("Fixed parameter (", eeprom_index - EEPROM_OFFSET_SN_VER);
853-
SERIAL_ECHOPAIR(" bytes; crc ", (uint32_t)working_crc);
854-
SERIAL_ECHOLNPGM(")");
855-
#endif
856-
}
857-
else{
858-
SERIAL_ECHOPAIR(" \r\nFixed parameter bytes; crc error ", (uint32_t)working_crc);
859-
SERIAL_ECHOPAIR(" \r\Fixed parameter nbytes; crc error ", (uint32_t)stored_crc);
860-
}
845+
if (working_crc == stored_crc) {
846+
#if ENABLED(EEPROM_CHITCHAT)
847+
SERIAL_ECHO_START();
848+
SERIAL_ECHOPAIR("Fixed parameter (", eeprom_index - EEPROM_OFFSET_SN_VER);
849+
SERIAL_ECHOPAIR(" bytes; crc ", (uint32_t)working_crc);
850+
SERIAL_ECHOLNPGM(")");
851+
#endif
852+
}
853+
else {
854+
SERIAL_ECHOPAIR("Fixed parameter crc error: ", (uint32_t)working_crc);
855+
SERIAL_ECHOLNPAIR(" != ", (uint32_t)stored_crc);
856+
}
861857
}
862858

863859
/**

A10M_marlin1.1.8/Marlin/configuration_store.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,12 @@ class MarlinSettings {
3232

3333
static bool poweroff_save();
3434
static bool poweroff_load();
35-
static void reset();
36-
static bool save();
37-
static bool Fixed_parameter_save() ;
38-
static bool Fixed_parameter_load() ;
35+
36+
static void reset();
37+
static bool save();
38+
static bool fixed_parameter_save();
39+
static bool fixed_parameter_load();
40+
3941
#if ENABLED(EEPROM_SETTINGS)
4042
static bool load();
4143

A10M_marlin1.1.8/Marlin/ultralcd.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4187,9 +4187,9 @@ void kill_screen(const char* lcd_msg) {
41874187
STATIC_ITEM(BOARD_NAME, true, true); // MyPrinterController
41884188
STATIC_ITEM(MSG_INFO_BAUDRATE ": " STRINGIFY(BAUDRATE), true); // Baud: 250000
41894189

4190-
// SERIAL_ECHOPAIR("hardware version:", hardware_version); //liu..
4191-
//STATIC_ITEM(MSG_FW_VER, false, true);
4192-
STATIC_ITEM("" MSG_FW_VER, true);
4190+
//SERIAL_ECHOPAIR("hardware version:", hardware_version); //liu..
4191+
//STATIC_ITEM(MSG_FW_VER, false, true);
4192+
STATIC_ITEM("" MSG_FW_VER, true);
41934193
STATIC_ITEM(" " MSG_HW_VER,false, false, ftostr12ns(hardware_version));//MSG_HW_VER liu
41944194
STATIC_ITEM(MSG_INFO_PROTOCOL ": " PROTOCOL_VERSION, true); // Protocol: 1.0
41954195
#if POWER_SUPPLY == 0

A10M_marlin1.1.8_3Dtouch/Marlin/Marlin_main.cpp

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11105,19 +11105,17 @@ inline void gcode_M999() {
1110511105
// gcode_LastN = Stopped_gcode_LastN;
1110611106
FlushSerialRequestResend();
1110711107
}
11108-
inline void gcode_M2000(){
1110911108

11109+
inline void gcode_M2000() {
1111011110
}
11111-
inline void gcode_M2009(){
11112-
if (parser.seen('V')) hardware_version = parser.value_celsius();
11113-
//SERIAL_ECHOPAIR("HV...:", hardware_version);//liu
11114-
(void)settings.Fixed_parameter_save();
11115-
SERIAL_ECHOLNPGM("HV_set_ok");
1111611111

11112+
inline void gcode_M2009() {
11113+
if (parser.seen('V')) hardware_version = parser.value_celsius();
11114+
//SERIAL_ECHOPAIR("HV...:", hardware_version);//liu
11115+
(void)settings.fixed_parameter_save();
11116+
SERIAL_ECHOLNPGM("HV_set_ok");
1111711117
}
1111811118

11119-
11120-
1112111119
#if ENABLED(SWITCHING_EXTRUDER)
1112211120
#if EXTRUDERS > 3
1112311121
#define REQ_ANGLES 4
@@ -12528,7 +12526,8 @@ void process_parsed_command() {
1252812526
case 999: // M999: Restart after being Stopped
1252912527
gcode_M999();
1253012528
break;
12531-
case 2000: //
12529+
12530+
case 2000: //
1253212531
gcode_M2000();
1253312532
break;
1253412533
case 2009: //
@@ -14475,7 +14474,7 @@ void setup() {
1447514474
// Load data from EEPROM if available (or use defaults)
1447614475
// This also updates variables in the planner, elsewhere
1447714476
(void)settings.load();
14478-
(void)settings.Fixed_parameter_load();
14477+
(void)settings.fixed_parameter_load();
1447914478

1448014479

1448114480
#if HAS_M206_COMMAND
@@ -14788,12 +14787,11 @@ void loop() {
1478814787
// SERIAL_ECHOLN(tmp_y);
1478914788
// enqueue_and_echo_command(tmp_y);
1479014789
///////
14791-
if(current_position[Z_AXIS]>=5)
14792-
{
14793-
sprintf_P(tmp_y, PSTR("G28 X"));
14794-
//SERIAL_ECHOLN(tmp_y);
14795-
enqueue_and_echo_command(tmp_y);
14796-
}
14790+
if (current_position[Z_AXIS] >= 5) {
14791+
sprintf_P(tmp_y, PSTR("G28 X"));
14792+
//SERIAL_ECHOLN(tmp_y);
14793+
enqueue_and_echo_command(tmp_y);
14794+
}
1479714795
powerloss.recovery = Rec_Idle;
1479814796
}
1479914797
endstops.report_state();

A10M_marlin1.1.8_3Dtouch/Marlin/configuration_store.cpp

Lines changed: 39 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -793,8 +793,6 @@ float hardware_version=0.1;
793793

794794
// Filament Runout Sensors
795795
EEPROM_READ(filament_runout_enabled);
796-
if(filament_runout_enabled != false)
797-
filament_runout_enabled = true;
798796

799797
if (working_crc == stored_crc) {
800798
#if ENABLED(EEPROM_CHITCHAT)
@@ -811,53 +809,51 @@ float hardware_version=0.1;
811809
}
812810
}
813811

812+
bool MarlinSettings::fixed_parameter_save() {//liu
813+
uint16_t working_crc = 0;
814+
EEPROM_START();
815+
eeprom_index = EEPROM_OFFSET_SN_VER;
814816

815-
bool MarlinSettings::Fixed_parameter_save() {//liu
817+
EEPROM_SKIP(working_crc); // Skip the checksum slot
818+
working_crc = 0;
819+
EEPROM_WRITE(hardware_version);//liu
816820

817-
uint16_t working_crc = 0;
818-
EEPROM_START();
819-
eeprom_index = EEPROM_OFFSET_SN_VER;
821+
const uint16_t final_crc = working_crc;
822+
const int eeprom_size = eeprom_index;
823+
eeprom_index = EEPROM_OFFSET_SN_VER;
824+
EEPROM_WRITE(final_crc);
820825

821-
EEPROM_SKIP(working_crc); // Skip the checksum slot
822-
working_crc = 0;
823-
EEPROM_WRITE(hardware_version);//liu hw ver
826+
#if ENABLED(EEPROM_CHITCHAT)
827+
SERIAL_ECHO_START();
828+
SERIAL_ECHOPAIR("Fixed parameter (", eeprom_size - EEPROM_OFFSET_SN_VER);
829+
SERIAL_ECHOPAIR(" bytes; crc ", (uint32_t)final_crc);
830+
SERIAL_ECHOLNPGM(")");
831+
#endif
832+
}
824833

825-
const uint16_t final_crc = working_crc;
826-
const int eeprom_size = eeprom_index;
827-
eeprom_index = EEPROM_OFFSET_SN_VER;
828-
EEPROM_WRITE(final_crc);
834+
bool MarlinSettings::fixed_parameter_load() {
835+
uint16_t working_crc = 0, stored_crc;
836+
EEPROM_START();
837+
eeprom_index = EEPROM_OFFSET_SN_VER;
838+
EEPROM_READ(stored_crc);
839+
working_crc = 0;
829840

830-
SERIAL_ECHO_START();
831-
SERIAL_ECHOPAIR("Fixed parameter (", eeprom_size - EEPROM_OFFSET_SN_VER);
832-
SERIAL_ECHOPAIR("Fixed parameter bytes; crc ", (uint32_t)final_crc);
833-
SERIAL_ECHOLNPGM(")");
841+
EEPROM_READ(hardware_version);//liu
842+
NOLESS(hardware_version, 0.1);
843+
SERIAL_ECHOLNPAIR("Hardware version:", hardware_version);//liu
834844

835-
}
836-
bool MarlinSettings::Fixed_parameter_load(){
837-
uint16_t working_crc = 0;
838-
uint16_t stored_crc;
839-
EEPROM_START();
840-
eeprom_index = EEPROM_OFFSET_SN_VER;
841-
EEPROM_READ(stored_crc);
842-
working_crc=0;
843-
EEPROM_READ(hardware_version);//liu hhardware_version
844-
if(hardware_version< 0.1)
845-
{
846-
hardware_version = 0.1;
847-
}
848-
SERIAL_ECHOPAIR(" hardware version:", hardware_version);//liu
849-
if (working_crc == stored_crc) {
850-
#if ENABLED(EEPROM_CHITCHAT)
851-
SERIAL_ECHO_START();
852-
SERIAL_ECHOPAIR("Fixed parameter (", eeprom_index - EEPROM_OFFSET_SN_VER);
853-
SERIAL_ECHOPAIR(" bytes; crc ", (uint32_t)working_crc);
854-
SERIAL_ECHOLNPGM(")");
855-
#endif
856-
}
857-
else{
858-
SERIAL_ECHOPAIR(" \r\nFixed parameter bytes; crc error ", (uint32_t)working_crc);
859-
SERIAL_ECHOPAIR(" \r\Fixed parameter nbytes; crc error ", (uint32_t)stored_crc);
860-
}
845+
if (working_crc == stored_crc) {
846+
#if ENABLED(EEPROM_CHITCHAT)
847+
SERIAL_ECHO_START();
848+
SERIAL_ECHOPAIR("Fixed parameter (", eeprom_index - EEPROM_OFFSET_SN_VER);
849+
SERIAL_ECHOPAIR(" bytes; crc ", (uint32_t)working_crc);
850+
SERIAL_ECHOLNPGM(")");
851+
#endif
852+
}
853+
else {
854+
SERIAL_ECHOPAIR("Fixed parameter crc error: ", (uint32_t)working_crc);
855+
SERIAL_ECHOLNPAIR(" != ", (uint32_t)stored_crc);
856+
}
861857
}
862858

863859
/**

A10M_marlin1.1.8_3Dtouch/Marlin/configuration_store.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,12 @@ class MarlinSettings {
3232

3333
static bool poweroff_save();
3434
static bool poweroff_load();
35-
static void reset();
36-
static bool save();
37-
static bool Fixed_parameter_save() ;
38-
static bool Fixed_parameter_load() ;
35+
36+
static void reset();
37+
static bool save();
38+
static bool fixed_parameter_save();
39+
static bool fixed_parameter_load();
40+
3941
#if ENABLED(EEPROM_SETTINGS)
4042
static bool load();
4143

A10M_marlin1.1.8_3Dtouch/Marlin/ultralcd.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4187,9 +4187,9 @@ void kill_screen(const char* lcd_msg) {
41874187
STATIC_ITEM(BOARD_NAME, true, true); // MyPrinterController
41884188
STATIC_ITEM(MSG_INFO_BAUDRATE ": " STRINGIFY(BAUDRATE), true); // Baud: 250000
41894189

4190-
// SERIAL_ECHOPAIR("hardware version:", hardware_version); //liu..
4191-
//STATIC_ITEM(MSG_FW_VER, false, true);
4192-
STATIC_ITEM("" MSG_FW_VER, true);
4190+
//SERIAL_ECHOPAIR("hardware version:", hardware_version); //liu..
4191+
//STATIC_ITEM(MSG_FW_VER, false, true);
4192+
STATIC_ITEM("" MSG_FW_VER, true);
41934193
STATIC_ITEM(" " MSG_HW_VER,false, false, ftostr12ns(hardware_version));//MSG_HW_VER liu
41944194
STATIC_ITEM(MSG_INFO_PROTOCOL ": " PROTOCOL_VERSION, true); // Protocol: 1.0
41954195
#if POWER_SUPPLY == 0

0 commit comments

Comments
 (0)