Skip to content

Commit

Permalink
Replace tabs with spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Nov 19, 2018
1 parent c2fa8a9 commit e71c3ee
Show file tree
Hide file tree
Showing 32 changed files with 495 additions and 522 deletions.
28 changes: 14 additions & 14 deletions A10M_marlin1.1.8/Marlin/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11105,15 +11105,15 @@ inline void gcode_M999() {
// gcode_LastN = Stopped_gcode_LastN;
FlushSerialRequestResend();
}
inline void gcode_M2000(){

inline void gcode_M2000() {
}
inline void gcode_M2009(){
if (parser.seen('V')) hardware_version = parser.value_celsius();
//SERIAL_ECHOPAIR("HV...:", hardware_version);//liu
(void)settings.Fixed_parameter_save();
SERIAL_ECHOLNPGM("HV_set_ok");

inline void gcode_M2009() {
if (parser.seen('V')) hardware_version = parser.value_celsius();
//SERIAL_ECHOPAIR("HV...:", hardware_version);//liu
(void)settings.fixed_parameter_save();
SERIAL_ECHOLNPGM("HV_set_ok");
}


Expand Down Expand Up @@ -12528,7 +12528,8 @@ void process_parsed_command() {
case 999: // M999: Restart after being Stopped
gcode_M999();
break;
case 2000: //

case 2000: //
gcode_M2000();
break;
case 2009: //
Expand Down Expand Up @@ -14475,7 +14476,7 @@ void setup() {
// Load data from EEPROM if available (or use defaults)
// This also updates variables in the planner, elsewhere
(void)settings.load();
(void)settings.Fixed_parameter_load();
(void)settings.fixed_parameter_load();


#if HAS_M206_COMMAND
Expand Down Expand Up @@ -14788,12 +14789,11 @@ void loop() {
// SERIAL_ECHOLN(tmp_y);
// enqueue_and_echo_command(tmp_y);
///////
if(current_position[Z_AXIS]>=5)
{
sprintf_P(tmp_y, PSTR("G28 X"));
//SERIAL_ECHOLN(tmp_y);
enqueue_and_echo_command(tmp_y);
}
if (current_position[Z_AXIS] >= 5) {
sprintf_P(tmp_y, PSTR("G28 X"));
//SERIAL_ECHOLN(tmp_y);
enqueue_and_echo_command(tmp_y);
}
powerloss.recovery = Rec_Idle;
}
endstops.report_state();
Expand Down
82 changes: 39 additions & 43 deletions A10M_marlin1.1.8/Marlin/configuration_store.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -793,8 +793,6 @@ float hardware_version=0.1;

// Filament Runout Sensors
EEPROM_READ(filament_runout_enabled);
if(filament_runout_enabled != false)
filament_runout_enabled = true;

if (working_crc == stored_crc) {
#if ENABLED(EEPROM_CHITCHAT)
Expand All @@ -811,53 +809,51 @@ float hardware_version=0.1;
}
}

bool MarlinSettings::fixed_parameter_save() {//liu
uint16_t working_crc = 0;
EEPROM_START();
eeprom_index = EEPROM_OFFSET_SN_VER;

bool MarlinSettings::Fixed_parameter_save() {//liu
EEPROM_SKIP(working_crc); // Skip the checksum slot
working_crc = 0;
EEPROM_WRITE(hardware_version);//liu

uint16_t working_crc = 0;
EEPROM_START();
eeprom_index = EEPROM_OFFSET_SN_VER;
const uint16_t final_crc = working_crc;
const int eeprom_size = eeprom_index;
eeprom_index = EEPROM_OFFSET_SN_VER;
EEPROM_WRITE(final_crc);

EEPROM_SKIP(working_crc); // Skip the checksum slot
working_crc = 0;
EEPROM_WRITE(hardware_version);//liu hw ver
#if ENABLED(EEPROM_CHITCHAT)
SERIAL_ECHO_START();
SERIAL_ECHOPAIR("Fixed parameter (", eeprom_size - EEPROM_OFFSET_SN_VER);
SERIAL_ECHOPAIR(" bytes; crc ", (uint32_t)final_crc);
SERIAL_ECHOLNPGM(")");
#endif
}

const uint16_t final_crc = working_crc;
const int eeprom_size = eeprom_index;
eeprom_index = EEPROM_OFFSET_SN_VER;
EEPROM_WRITE(final_crc);
bool MarlinSettings::fixed_parameter_load() {
uint16_t working_crc = 0, stored_crc;
EEPROM_START();
eeprom_index = EEPROM_OFFSET_SN_VER;
EEPROM_READ(stored_crc);
working_crc = 0;

SERIAL_ECHO_START();
SERIAL_ECHOPAIR("Fixed parameter (", eeprom_size - EEPROM_OFFSET_SN_VER);
SERIAL_ECHOPAIR("Fixed parameter bytes; crc ", (uint32_t)final_crc);
SERIAL_ECHOLNPGM(")");
EEPROM_READ(hardware_version);//liu
NOLESS(hardware_version, 0.1);
SERIAL_ECHOLNPAIR("Hardware version:", hardware_version);//liu

}
bool MarlinSettings::Fixed_parameter_load(){
uint16_t working_crc = 0;
uint16_t stored_crc;
EEPROM_START();
eeprom_index = EEPROM_OFFSET_SN_VER;
EEPROM_READ(stored_crc);
working_crc=0;
EEPROM_READ(hardware_version);//liu hhardware_version
if(hardware_version< 0.1)
{
hardware_version = 0.1;
}
SERIAL_ECHOPAIR(" hardware version:", hardware_version);//liu
if (working_crc == stored_crc) {
#if ENABLED(EEPROM_CHITCHAT)
SERIAL_ECHO_START();
SERIAL_ECHOPAIR("Fixed parameter (", eeprom_index - EEPROM_OFFSET_SN_VER);
SERIAL_ECHOPAIR(" bytes; crc ", (uint32_t)working_crc);
SERIAL_ECHOLNPGM(")");
#endif
}
else{
SERIAL_ECHOPAIR(" \r\nFixed parameter bytes; crc error ", (uint32_t)working_crc);
SERIAL_ECHOPAIR(" \r\Fixed parameter nbytes; crc error ", (uint32_t)stored_crc);
}
if (working_crc == stored_crc) {
#if ENABLED(EEPROM_CHITCHAT)
SERIAL_ECHO_START();
SERIAL_ECHOPAIR("Fixed parameter (", eeprom_index - EEPROM_OFFSET_SN_VER);
SERIAL_ECHOPAIR(" bytes; crc ", (uint32_t)working_crc);
SERIAL_ECHOLNPGM(")");
#endif
}
else {
SERIAL_ECHOPAIR("Fixed parameter crc error: ", (uint32_t)working_crc);
SERIAL_ECHOLNPAIR(" != ", (uint32_t)stored_crc);
}
}

/**
Expand Down
10 changes: 6 additions & 4 deletions A10M_marlin1.1.8/Marlin/configuration_store.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@ class MarlinSettings {

static bool poweroff_save();
static bool poweroff_load();
static void reset();
static bool save();
static bool Fixed_parameter_save() ;
static bool Fixed_parameter_load() ;

static void reset();
static bool save();
static bool fixed_parameter_save();
static bool fixed_parameter_load();

#if ENABLED(EEPROM_SETTINGS)
static bool load();

Expand Down
6 changes: 3 additions & 3 deletions A10M_marlin1.1.8/Marlin/ultralcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4187,9 +4187,9 @@ void kill_screen(const char* lcd_msg) {
STATIC_ITEM(BOARD_NAME, true, true); // MyPrinterController
STATIC_ITEM(MSG_INFO_BAUDRATE ": " STRINGIFY(BAUDRATE), true); // Baud: 250000

// SERIAL_ECHOPAIR("hardware version:", hardware_version); //liu..
//STATIC_ITEM(MSG_FW_VER, false, true);
STATIC_ITEM("" MSG_FW_VER, true);
//SERIAL_ECHOPAIR("hardware version:", hardware_version); //liu..
//STATIC_ITEM(MSG_FW_VER, false, true);
STATIC_ITEM("" MSG_FW_VER, true);
STATIC_ITEM(" " MSG_HW_VER,false, false, ftostr12ns(hardware_version));//MSG_HW_VER liu
STATIC_ITEM(MSG_INFO_PROTOCOL ": " PROTOCOL_VERSION, true); // Protocol: 1.0
#if POWER_SUPPLY == 0
Expand Down
30 changes: 14 additions & 16 deletions A10M_marlin1.1.8_3Dtouch/Marlin/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11105,19 +11105,17 @@ inline void gcode_M999() {
// gcode_LastN = Stopped_gcode_LastN;
FlushSerialRequestResend();
}
inline void gcode_M2000(){

inline void gcode_M2000() {
}
inline void gcode_M2009(){
if (parser.seen('V')) hardware_version = parser.value_celsius();
//SERIAL_ECHOPAIR("HV...:", hardware_version);//liu
(void)settings.Fixed_parameter_save();
SERIAL_ECHOLNPGM("HV_set_ok");

inline void gcode_M2009() {
if (parser.seen('V')) hardware_version = parser.value_celsius();
//SERIAL_ECHOPAIR("HV...:", hardware_version);//liu
(void)settings.fixed_parameter_save();
SERIAL_ECHOLNPGM("HV_set_ok");
}



#if ENABLED(SWITCHING_EXTRUDER)
#if EXTRUDERS > 3
#define REQ_ANGLES 4
Expand Down Expand Up @@ -12528,7 +12526,8 @@ void process_parsed_command() {
case 999: // M999: Restart after being Stopped
gcode_M999();
break;
case 2000: //

case 2000: //
gcode_M2000();
break;
case 2009: //
Expand Down Expand Up @@ -14475,7 +14474,7 @@ void setup() {
// Load data from EEPROM if available (or use defaults)
// This also updates variables in the planner, elsewhere
(void)settings.load();
(void)settings.Fixed_parameter_load();
(void)settings.fixed_parameter_load();


#if HAS_M206_COMMAND
Expand Down Expand Up @@ -14788,12 +14787,11 @@ void loop() {
// SERIAL_ECHOLN(tmp_y);
// enqueue_and_echo_command(tmp_y);
///////
if(current_position[Z_AXIS]>=5)
{
sprintf_P(tmp_y, PSTR("G28 X"));
//SERIAL_ECHOLN(tmp_y);
enqueue_and_echo_command(tmp_y);
}
if (current_position[Z_AXIS] >= 5) {
sprintf_P(tmp_y, PSTR("G28 X"));
//SERIAL_ECHOLN(tmp_y);
enqueue_and_echo_command(tmp_y);
}
powerloss.recovery = Rec_Idle;
}
endstops.report_state();
Expand Down
82 changes: 39 additions & 43 deletions A10M_marlin1.1.8_3Dtouch/Marlin/configuration_store.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -793,8 +793,6 @@ float hardware_version=0.1;

// Filament Runout Sensors
EEPROM_READ(filament_runout_enabled);
if(filament_runout_enabled != false)
filament_runout_enabled = true;

if (working_crc == stored_crc) {
#if ENABLED(EEPROM_CHITCHAT)
Expand All @@ -811,53 +809,51 @@ float hardware_version=0.1;
}
}

bool MarlinSettings::fixed_parameter_save() {//liu
uint16_t working_crc = 0;
EEPROM_START();
eeprom_index = EEPROM_OFFSET_SN_VER;

bool MarlinSettings::Fixed_parameter_save() {//liu
EEPROM_SKIP(working_crc); // Skip the checksum slot
working_crc = 0;
EEPROM_WRITE(hardware_version);//liu

uint16_t working_crc = 0;
EEPROM_START();
eeprom_index = EEPROM_OFFSET_SN_VER;
const uint16_t final_crc = working_crc;
const int eeprom_size = eeprom_index;
eeprom_index = EEPROM_OFFSET_SN_VER;
EEPROM_WRITE(final_crc);

EEPROM_SKIP(working_crc); // Skip the checksum slot
working_crc = 0;
EEPROM_WRITE(hardware_version);//liu hw ver
#if ENABLED(EEPROM_CHITCHAT)
SERIAL_ECHO_START();
SERIAL_ECHOPAIR("Fixed parameter (", eeprom_size - EEPROM_OFFSET_SN_VER);
SERIAL_ECHOPAIR(" bytes; crc ", (uint32_t)final_crc);
SERIAL_ECHOLNPGM(")");
#endif
}

const uint16_t final_crc = working_crc;
const int eeprom_size = eeprom_index;
eeprom_index = EEPROM_OFFSET_SN_VER;
EEPROM_WRITE(final_crc);
bool MarlinSettings::fixed_parameter_load() {
uint16_t working_crc = 0, stored_crc;
EEPROM_START();
eeprom_index = EEPROM_OFFSET_SN_VER;
EEPROM_READ(stored_crc);
working_crc = 0;

SERIAL_ECHO_START();
SERIAL_ECHOPAIR("Fixed parameter (", eeprom_size - EEPROM_OFFSET_SN_VER);
SERIAL_ECHOPAIR("Fixed parameter bytes; crc ", (uint32_t)final_crc);
SERIAL_ECHOLNPGM(")");
EEPROM_READ(hardware_version);//liu
NOLESS(hardware_version, 0.1);
SERIAL_ECHOLNPAIR("Hardware version:", hardware_version);//liu

}
bool MarlinSettings::Fixed_parameter_load(){
uint16_t working_crc = 0;
uint16_t stored_crc;
EEPROM_START();
eeprom_index = EEPROM_OFFSET_SN_VER;
EEPROM_READ(stored_crc);
working_crc=0;
EEPROM_READ(hardware_version);//liu hhardware_version
if(hardware_version< 0.1)
{
hardware_version = 0.1;
}
SERIAL_ECHOPAIR(" hardware version:", hardware_version);//liu
if (working_crc == stored_crc) {
#if ENABLED(EEPROM_CHITCHAT)
SERIAL_ECHO_START();
SERIAL_ECHOPAIR("Fixed parameter (", eeprom_index - EEPROM_OFFSET_SN_VER);
SERIAL_ECHOPAIR(" bytes; crc ", (uint32_t)working_crc);
SERIAL_ECHOLNPGM(")");
#endif
}
else{
SERIAL_ECHOPAIR(" \r\nFixed parameter bytes; crc error ", (uint32_t)working_crc);
SERIAL_ECHOPAIR(" \r\Fixed parameter nbytes; crc error ", (uint32_t)stored_crc);
}
if (working_crc == stored_crc) {
#if ENABLED(EEPROM_CHITCHAT)
SERIAL_ECHO_START();
SERIAL_ECHOPAIR("Fixed parameter (", eeprom_index - EEPROM_OFFSET_SN_VER);
SERIAL_ECHOPAIR(" bytes; crc ", (uint32_t)working_crc);
SERIAL_ECHOLNPGM(")");
#endif
}
else {
SERIAL_ECHOPAIR("Fixed parameter crc error: ", (uint32_t)working_crc);
SERIAL_ECHOLNPAIR(" != ", (uint32_t)stored_crc);
}
}

/**
Expand Down
10 changes: 6 additions & 4 deletions A10M_marlin1.1.8_3Dtouch/Marlin/configuration_store.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@ class MarlinSettings {

static bool poweroff_save();
static bool poweroff_load();
static void reset();
static bool save();
static bool Fixed_parameter_save() ;
static bool Fixed_parameter_load() ;

static void reset();
static bool save();
static bool fixed_parameter_save();
static bool fixed_parameter_load();

#if ENABLED(EEPROM_SETTINGS)
static bool load();

Expand Down
6 changes: 3 additions & 3 deletions A10M_marlin1.1.8_3Dtouch/Marlin/ultralcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4187,9 +4187,9 @@ void kill_screen(const char* lcd_msg) {
STATIC_ITEM(BOARD_NAME, true, true); // MyPrinterController
STATIC_ITEM(MSG_INFO_BAUDRATE ": " STRINGIFY(BAUDRATE), true); // Baud: 250000

// SERIAL_ECHOPAIR("hardware version:", hardware_version); //liu..
//STATIC_ITEM(MSG_FW_VER, false, true);
STATIC_ITEM("" MSG_FW_VER, true);
//SERIAL_ECHOPAIR("hardware version:", hardware_version); //liu..
//STATIC_ITEM(MSG_FW_VER, false, true);
STATIC_ITEM("" MSG_FW_VER, true);
STATIC_ITEM(" " MSG_HW_VER,false, false, ftostr12ns(hardware_version));//MSG_HW_VER liu
STATIC_ITEM(MSG_INFO_PROTOCOL ": " PROTOCOL_VERSION, true); // Protocol: 1.0
#if POWER_SUPPLY == 0
Expand Down
Loading

0 comments on commit e71c3ee

Please sign in to comment.