EEPROM_FILAMENTUSED is in centimeter and not meter

Fix few things
This commit is contained in:
3d-gussner 2024-11-11 15:47:38 +01:00
parent 9d91381013
commit f93de6c662
3 changed files with 5 additions and 6 deletions

View File

@ -5253,7 +5253,6 @@ void process_commands()
*/ */
case 78: case 78:
{ {
// @todo useful for maintenance notifications
const char *_m_fil; const char *_m_fil;
const char *_m_time; const char *_m_time;
uint32_t _cm = 0; uint32_t _cm = 0;
@ -5262,8 +5261,8 @@ void process_commands()
if (printJobOngoing()) { if (printJobOngoing()) {
_m_fil = _O(MSG_FILAMENT_USED); _m_fil = _O(MSG_FILAMENT_USED);
_m_time = _O(MSG_PRINT_TIME); _m_time = _O(MSG_PRINT_TIME);
_cm = ((uint32_t)total_filament_used) / (1000); _cm = (uint32_t)total_filament_used / 1000;
_min = (print_job_timer.duration() / 60); _min = print_job_timer.duration() / 60;
} else { } else {
if (code_seen('S')) { if (code_seen('S')) {
eeprom_update_dword_notify((uint32_t *)EEPROM_FILAMENTUSED, code_value()); eeprom_update_dword_notify((uint32_t *)EEPROM_FILAMENTUSED, code_value());
@ -9179,7 +9178,7 @@ void setPwmFrequency(uint8_t pin, int val)
#endif //FAST_PWM_FAN #endif //FAST_PWM_FAN
void save_statistics() { void save_statistics() {
uint32_t _previous_filament = eeprom_init_default_dword((uint32_t *)EEPROM_FILAMENTUSED, 0); //_previous_filament unit: meter uint32_t _previous_filament = eeprom_init_default_dword((uint32_t *)EEPROM_FILAMENTUSED, 0); //_previous_filament unit: centimeter
uint32_t _previous_time = eeprom_init_default_dword((uint32_t *)EEPROM_TOTALTIME, 0); //_previous_time unit: min uint32_t _previous_time = eeprom_init_default_dword((uint32_t *)EEPROM_TOTALTIME, 0); //_previous_time unit: min
uint32_t time_minutes = print_job_timer.duration() / 60; uint32_t time_minutes = print_job_timer.duration() / 60;

View File

@ -108,7 +108,7 @@ static_assert(sizeof(Sheets) == EEPROM_SHEETS_SIZEOF, "Sizeof(Sheets) is not EEP
| ^ | ^ | ^ | fah 250 | ^ | needs XYZ calibration | ^ | ^ | ^ | ^ | ^ | fah 250 | ^ | needs XYZ calibration | ^ | ^
| ^ | ^ | ^ | 00h 0 | ^ | Unknown (legacy) | ^ | ^ | ^ | ^ | ^ | 00h 0 | ^ | Unknown (legacy) | ^ | ^
| 0x0FF5 4085 | uint16 | _EEPROM_FREE_NR12_ | ??? | ff ffh 65535 | _Free EEPROM space_ | _free space_ | D3 Ax0ff5 C2 | 0x0FF5 4085 | uint16 | _EEPROM_FREE_NR12_ | ??? | ff ffh 65535 | _Free EEPROM space_ | _free space_ | D3 Ax0ff5 C2
| 0x0FF1 4081 | uint32 | EEPROM_FILAMENTUSED | ??? | 00 00 00 00h 0 __S/P__| Filament used in meters | ??? | D3 Ax0ff1 C4 | 0x0FF1 4081 | uint32 | EEPROM_FILAMENTUSED | ??? | 00 00 00 00h 0 __S/P__| Filament used in cenitmeters | ??? | D3 Ax0ff1 C4
| 0x0FED 4077 | uint32 | EEPROM_TOTALTIME | ??? | 00 00 00 00h 0 __S/P__| Total print time in minutes | ??? | D3 Ax0fed C4 | 0x0FED 4077 | uint32 | EEPROM_TOTALTIME | ??? | 00 00 00 00h 0 __S/P__| Total print time in minutes | ??? | D3 Ax0fed C4
| 0x0FE5 4069 | float | EEPROM_BED_CALIBRATION_CENTER | ??? | ff ff ff ffh | ??? | ??? | D3 Ax0fe5 C8 | 0x0FE5 4069 | float | EEPROM_BED_CALIBRATION_CENTER | ??? | ff ff ff ffh | ??? | ??? | D3 Ax0fe5 C8
| 0x0FDD 4061 | float | EEPROM_BED_CALIBRATION_VEC_X | ??? | ff ff ff ffh | ??? | ??? | D3 Ax0fdd C8 | 0x0FDD 4061 | float | EEPROM_BED_CALIBRATION_VEC_X | ??? | ff ff ff ffh | ??? | ??? | D3 Ax0fdd C8

View File

@ -2367,7 +2367,7 @@ void lcd_menu_statistics()
} }
else else
{ {
uint32_t _filament = eeprom_read_dword((uint32_t *)EEPROM_FILAMENTUSED); // in meters uint32_t _filament = eeprom_read_dword((uint32_t *)EEPROM_FILAMENTUSED); // in centimeters
uint32_t _time = eeprom_read_dword((uint32_t *)EEPROM_TOTALTIME); // in minutes uint32_t _time = eeprom_read_dword((uint32_t *)EEPROM_TOTALTIME); // in minutes
uint8_t _hours, _minutes; uint8_t _hours, _minutes;
uint32_t _days; uint32_t _days;