PFW-1397 Increment toolchange statistic

This commit is contained in:
Guðni Már Gilbert 2022-10-22 17:46:23 +00:00 committed by DRracer
parent 0af7d28074
commit 5a60a85467
1 changed files with 11 additions and 0 deletions

View File

@ -331,6 +331,10 @@ bool MMU2::tool_change(uint8_t index) {
// @@TODO really report onto the serial? May be for the Octoprint? Not important now
// SERIAL_ECHO_START();
// SERIAL_ECHOLNPAIR(MSG_ACTIVE_EXTRUDER, int(extruder));
// Update toolchange counter
uint32_t toolchanges = eeprom_read_dword((uint32_t*)EEPROM_TOTAL_TOOLCHANGE_COUNT);
eeprom_write_dword((uint32_t *)EEPROM_TOTAL_TOOLCHANGE_COUNT, ++toolchanges);
}
return true;
}
@ -361,6 +365,9 @@ bool MMU2::tool_change(char code, uint8_t slot) {
extruder = slot;
SpoolJoin::spooljoin.setSlot(slot);
set_extrude_min_temp(EXTRUDE_MINTEMP);
// Update toolchange counter
uint32_t toolchanges = eeprom_read_dword((uint32_t*)EEPROM_TOTAL_TOOLCHANGE_COUNT);
eeprom_write_dword((uint32_t *)EEPROM_TOTAL_TOOLCHANGE_COUNT, ++toolchanges);
} break;
case 'c': {
@ -511,6 +518,10 @@ bool MMU2::load_filament_to_nozzle(uint8_t index) {
SpoolJoin::spooljoin.setSlot(index);
Sound_MakeSound(e_SOUND_TYPE_StandardConfirm);
// Update toolchange count
uint32_t toolchanges = eeprom_read_dword((uint32_t*)EEPROM_TOTAL_TOOLCHANGE_COUNT);
eeprom_write_dword((uint32_t *)EEPROM_TOTAL_TOOLCHANGE_COUNT, ++toolchanges);
}
lcd_update_enable(true);
return true;