Some formatting in configuration_store.cpp

This commit is contained in:
Scott Lahteine 2016-06-29 18:18:46 -07:00
parent 5e370006fc
commit adcd0f5de3

View file

@ -38,6 +38,9 @@
#define EEPROM_VERSION "V24" #define EEPROM_VERSION "V24"
// Change EEPROM version if these are changed:
#define EEPROM_OFFSET 100
/** /**
* V24 EEPROM Layout: * V24 EEPROM Layout:
* *
@ -158,23 +161,22 @@ void _EEPROM_readData(int &pos, uint8_t* value, uint8_t size) {
value++; value++;
} while (--size); } while (--size);
} }
/**
* Store Configuration Settings - M500
*/
#if ENABLED(EEPROM_SETTINGS)
#define DUMMY_PID_VALUE 3000.0f
#define EEPROM_WRITE_VAR(pos, value) _EEPROM_writeData(pos, (uint8_t*)&value, sizeof(value)) #define EEPROM_WRITE_VAR(pos, value) _EEPROM_writeData(pos, (uint8_t*)&value, sizeof(value))
#define EEPROM_READ_VAR(pos, value) _EEPROM_readData(pos, (uint8_t*)&value, sizeof(value)) #define EEPROM_READ_VAR(pos, value) _EEPROM_readData(pos, (uint8_t*)&value, sizeof(value))
/** /**
* Store Configuration Settings - M500 * M500 - Store Configuration
*/ */
#define DUMMY_PID_VALUE 3000.0f
#define EEPROM_OFFSET 100
#if ENABLED(EEPROM_SETTINGS)
/**
* Store Configuration Settings - M500
*/
void Config_StoreSettings() { void Config_StoreSettings() {
float dummy = 0.0f; float dummy = 0.0f;
char ver[4] = "000"; char ver[4] = "000";
@ -349,11 +351,9 @@ void Config_StoreSettings() {
} }
/** /**
* Retrieve Configuration Settings - M501 * M501 - Retrieve Configuration
*/ */
void Config_RetrieveSettings() { void Config_RetrieveSettings() {
int i = EEPROM_OFFSET; int i = EEPROM_OFFSET;
char stored_ver[4]; char stored_ver[4];
uint16_t stored_checksum; uint16_t stored_checksum;
@ -545,9 +545,8 @@ void Config_RetrieveSettings() {
#endif // EEPROM_SETTINGS #endif // EEPROM_SETTINGS
/** /**
* Reset Configuration Settings - M502 * M502 - Reset Configuration
*/ */
void Config_ResetDefault() { void Config_ResetDefault() {
float tmp1[] = DEFAULT_AXIS_STEPS_PER_UNIT; float tmp1[] = DEFAULT_AXIS_STEPS_PER_UNIT;
float tmp2[] = DEFAULT_MAX_FEEDRATE; float tmp2[] = DEFAULT_MAX_FEEDRATE;
@ -663,12 +662,11 @@ void Config_ResetDefault() {
#if DISABLED(DISABLE_M503) #if DISABLED(DISABLE_M503)
/**
* Print Configuration Settings - M503
*/
#define CONFIG_ECHO_START do{ if (!forReplay) SERIAL_ECHO_START; }while(0) #define CONFIG_ECHO_START do{ if (!forReplay) SERIAL_ECHO_START; }while(0)
/**
* M503 - Print Configuration
*/
void Config_PrintSettings(bool forReplay) { void Config_PrintSettings(bool forReplay) {
// Always have this function, even with EEPROM_SETTINGS disabled, the current values will be shown // Always have this function, even with EEPROM_SETTINGS disabled, the current values will be shown