Split the increment function into increment and add
No size difference since the compiler did a good job optimizing the inc argument (always 1 before).
This commit is contained in:
parent
455c29e78b
commit
ca943cceec
|
|
@ -161,8 +161,8 @@ void Filament_sensor::filRunout() {
|
||||||
autoLoadEnabled = false;
|
autoLoadEnabled = false;
|
||||||
stop_and_save_print_to_ram(0, 0);
|
stop_and_save_print_to_ram(0, 0);
|
||||||
restore_print_from_ram_and_continue(0);
|
restore_print_from_ram_and_continue(0);
|
||||||
eeprom_increment_byte((uint8_t *)EEPROM_FERROR_COUNT, 1);
|
eeprom_increment_byte((uint8_t *)EEPROM_FERROR_COUNT);
|
||||||
eeprom_increment_word((uint16_t *)EEPROM_FERROR_COUNT_TOT, 1);
|
eeprom_increment_word((uint16_t *)EEPROM_FERROR_COUNT_TOT);
|
||||||
enquecommand_front_P((PSTR("M600")));
|
enquecommand_front_P((PSTR("M600")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -609,13 +609,13 @@ void crashdet_detected(uint8_t mask)
|
||||||
|
|
||||||
if (mask & X_AXIS_MASK)
|
if (mask & X_AXIS_MASK)
|
||||||
{
|
{
|
||||||
eeprom_increment_byte((uint8_t*)EEPROM_CRASH_COUNT_X, 1);
|
eeprom_increment_byte((uint8_t*)EEPROM_CRASH_COUNT_X);
|
||||||
eeprom_increment_word((uint16_t*)EEPROM_CRASH_COUNT_X_TOT, 1);
|
eeprom_increment_word((uint16_t*)EEPROM_CRASH_COUNT_X_TOT);
|
||||||
}
|
}
|
||||||
if (mask & Y_AXIS_MASK)
|
if (mask & Y_AXIS_MASK)
|
||||||
{
|
{
|
||||||
eeprom_increment_byte((uint8_t*)EEPROM_CRASH_COUNT_Y, 1);
|
eeprom_increment_byte((uint8_t*)EEPROM_CRASH_COUNT_Y);
|
||||||
eeprom_increment_word((uint16_t*)EEPROM_CRASH_COUNT_Y_TOT, 1);
|
eeprom_increment_word((uint16_t*)EEPROM_CRASH_COUNT_Y_TOT);
|
||||||
}
|
}
|
||||||
|
|
||||||
lcd_update_enable(true);
|
lcd_update_enable(true);
|
||||||
|
|
@ -10681,8 +10681,8 @@ void uvlo_()
|
||||||
if(sd_print) eeprom_update_byte((uint8_t*)EEPROM_UVLO, 1);
|
if(sd_print) eeprom_update_byte((uint8_t*)EEPROM_UVLO, 1);
|
||||||
|
|
||||||
// Increment power failure counter
|
// Increment power failure counter
|
||||||
eeprom_increment_byte((uint8_t*)EEPROM_POWER_COUNT, 1);
|
eeprom_increment_byte((uint8_t*)EEPROM_POWER_COUNT);
|
||||||
eeprom_increment_word((uint16_t*)EEPROM_POWER_COUNT_TOT, 1);
|
eeprom_increment_word((uint16_t*)EEPROM_POWER_COUNT_TOT);
|
||||||
|
|
||||||
printf_P(_N("UVLO - end %d\n"), _millis() - time_start);
|
printf_P(_N("UVLO - end %d\n"), _millis() - time_start);
|
||||||
WRITE(BEEPER,HIGH);
|
WRITE(BEEPER,HIGH);
|
||||||
|
|
|
||||||
|
|
@ -182,20 +182,28 @@ void eeprom_switch_to_next_sheet()
|
||||||
if (sheet >= 0) eeprom_update_byte(&(EEPROM_Sheets_base->active_sheet), sheet);
|
if (sheet >= 0) eeprom_update_byte(&(EEPROM_Sheets_base->active_sheet), sheet);
|
||||||
}
|
}
|
||||||
|
|
||||||
void __attribute__((noinline)) eeprom_increment_byte(uint8_t *__p, uint8_t inc){
|
void __attribute__((noinline)) eeprom_increment_byte(uint8_t *__p) {
|
||||||
eeprom_update_byte(__p, eeprom_read_byte(__p) + inc);
|
eeprom_write_byte(__p, eeprom_read_byte(__p) + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void __attribute__((noinline)) eeprom_increment_word(uint16_t *__p, uint8_t inc){
|
void __attribute__((noinline)) eeprom_increment_word(uint16_t *__p) {
|
||||||
eeprom_update_word(__p, eeprom_read_word(__p) + inc);
|
eeprom_write_word(__p, eeprom_read_word(__p) + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void __attribute__((noinline)) eeprom_init_default_byte(uint8_t *__p, uint8_t def){
|
void __attribute__((noinline)) eeprom_add_byte(uint8_t *__p, uint8_t add) {
|
||||||
|
eeprom_write_byte(__p, eeprom_read_byte(__p) + add);
|
||||||
|
}
|
||||||
|
|
||||||
|
void __attribute__((noinline)) eeprom_add_word(uint16_t *__p, uint16_t add) {
|
||||||
|
eeprom_write_word(__p, eeprom_read_word(__p) + add);
|
||||||
|
}
|
||||||
|
|
||||||
|
void __attribute__((noinline)) eeprom_init_default_byte(uint8_t *__p, uint8_t def) {
|
||||||
if (eeprom_read_byte(__p) == 0xff)
|
if (eeprom_read_byte(__p) == 0xff)
|
||||||
eeprom_write_byte(__p, def);
|
eeprom_write_byte(__p, def);
|
||||||
}
|
}
|
||||||
|
|
||||||
void __attribute__((noinline)) eeprom_init_default_word(uint16_t *__p, uint16_t def){
|
void __attribute__((noinline)) eeprom_init_default_word(uint16_t *__p, uint16_t def) {
|
||||||
if (eeprom_read_word(__p) == 0xffff)
|
if (eeprom_read_word(__p) == 0xffff)
|
||||||
eeprom_write_word(__p, def);
|
eeprom_write_word(__p, def);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -613,8 +613,11 @@ void eeprom_default_sheet_name(uint8_t index, SheetName &sheetName);
|
||||||
int8_t eeprom_next_initialized_sheet(int8_t sheet);
|
int8_t eeprom_next_initialized_sheet(int8_t sheet);
|
||||||
void eeprom_switch_to_next_sheet();
|
void eeprom_switch_to_next_sheet();
|
||||||
|
|
||||||
void eeprom_increment_byte(uint8_t *__p, uint8_t inc);
|
void eeprom_increment_byte(uint8_t *__p);
|
||||||
void eeprom_increment_word(uint16_t *__p, uint8_t inc);
|
void eeprom_increment_word(uint16_t *__p);
|
||||||
|
|
||||||
|
void eeprom_add_byte(uint8_t *__p, uint8_t add);
|
||||||
|
void eeprom_add_word(uint16_t *__p, uint16_t add);
|
||||||
|
|
||||||
void eeprom_init_default_byte(uint8_t *__p, uint8_t def);
|
void eeprom_init_default_byte(uint8_t *__p, uint8_t def);
|
||||||
void eeprom_init_default_word(uint16_t *__p, uint16_t def);
|
void eeprom_init_default_word(uint16_t *__p, uint16_t def);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue