15 #include "Configuration_var.h"
18 #ifndef CUSTOM_MENDEL_NAME
19 #define CUSTOM_MENDEL_NAME "Prusa i3"
22 #define MAX_CUSTOM_MENDEL_NAME_LENGTH 17
27 #define MAX_SHEET_NAME_LENGTH 7
31 unsigned char name[MAX_SHEET_NAME_LENGTH];
44 #define EEPROM_SHEETS_SIZEOF 89
47 static_assert(
sizeof(
Sheets) == EEPROM_SHEETS_SIZEOF,
"Sizeof(Sheets) is not EEPROM_SHEETS_SIZEOF.");
398 #define EEPROM_EMPTY_VALUE 0xFF
399 #define EEPROM_EMPTY_VALUE16 0xFFFF
400 #define EEPROM_EMPTY_VALUE32 0xFFFFFFFFl
403 #define EEPROM_TOP 4096
404 #define EEPROM_SILENT 4095
405 #define EEPROM_LANG 4094
406 #define _EEPROM_FREE_NR10_ 4092
407 #define _EEPROM_FREE_NR11_ 4090
408 #define EEPROM_BABYSTEP_Z 4088
409 #define EEPROM_CALIBRATION_STATUS_V1 4087
410 #define EEPROM_BABYSTEP_Z0 4085
411 #define EEPROM_FILAMENTUSED 4081
413 #define EEPROM_TOTALTIME 4077
415 #define EEPROM_BED_CALIBRATION_CENTER (EEPROM_TOTALTIME-2*4)
416 #define EEPROM_BED_CALIBRATION_VEC_X (EEPROM_BED_CALIBRATION_CENTER-2*4)
417 #define EEPROM_BED_CALIBRATION_VEC_Y (EEPROM_BED_CALIBRATION_VEC_X-2*4)
421 #define EEPROM_BED_CALIBRATION_Z_JITTER (EEPROM_BED_CALIBRATION_VEC_Y-2*8)
422 #define EEPROM_FARM_MODE (EEPROM_BED_CALIBRATION_Z_JITTER-1)
423 #define EEPROM_FREE_NR1 (EEPROM_FARM_MODE-1)
424 #define _EEPROM_FREE_NR2_ (EEPROM_FREE_NR1 - 2)
429 #define EEPROM_BED_CORRECTION_VALID (_EEPROM_FREE_NR2_ - 1)
430 #define EEPROM_BED_CORRECTION_LEFT (EEPROM_BED_CORRECTION_VALID-1)
431 #define EEPROM_BED_CORRECTION_RIGHT (EEPROM_BED_CORRECTION_LEFT-1)
432 #define EEPROM_BED_CORRECTION_FRONT (EEPROM_BED_CORRECTION_RIGHT-1)
433 #define EEPROM_BED_CORRECTION_REAR (EEPROM_BED_CORRECTION_FRONT-1)
434 #define EEPROM_TOSHIBA_FLASH_AIR_COMPATIBLITY (EEPROM_BED_CORRECTION_REAR-1)
436 #define _EEPROM_FREE_NR3_ (EEPROM_TOSHIBA_FLASH_AIR_COMPATIBLITY - 1)
438 #define EEPROM_PROBE_TEMP_SHIFT (_EEPROM_FREE_NR3_ - 2*5)
439 #define EEPROM_TEMP_CAL_ACTIVE (EEPROM_PROBE_TEMP_SHIFT - 1)
440 #define _EEPROM_FREE_NR6_ (EEPROM_TEMP_CAL_ACTIVE - 2*4)
441 #define EEPROM_CALIBRATION_STATUS_PINDA (_EEPROM_FREE_NR6_ - 1)
443 #define EEPROM_UVLO (EEPROM_CALIBRATION_STATUS_PINDA - 1)
444 #define EEPROM_UVLO_CURRENT_POSITION (EEPROM_UVLO-2*4)
445 #define EEPROM_FILENAME (EEPROM_UVLO_CURRENT_POSITION - 8)
446 #define EEPROM_FILE_POSITION (EEPROM_FILENAME - 4)
447 #define EEPROM_UVLO_CURRENT_POSITION_Z (EEPROM_FILE_POSITION - 4)
448 #define EEPROM_UVLO_PRINT_TYPE (EEPROM_UVLO_CURRENT_POSITION_Z - 1)
449 #define EEPROM_UVLO_TARGET_BED (EEPROM_UVLO_PRINT_TYPE - 1)
450 #define EEPROM_UVLO_FEEDRATE (EEPROM_UVLO_TARGET_BED - 2)
451 #define EEPROM_UVLO_FAN_SPEED (EEPROM_UVLO_FEEDRATE - 1)
452 #define EEPROM_FAN_CHECK_ENABLED (EEPROM_UVLO_FAN_SPEED - 1)
454 #define _EEPROM_FREE_NR7_ (EEPROM_FAN_CHECK_ENABLED - 9*2)
455 #define _EEPROM_FREE_NR8_ (_EEPROM_FREE_NR7_ - 2)
457 #define EEPROM_UVLO_E_ABS (_EEPROM_FREE_NR8_ - 1)
458 #define EEPROM_UVLO_CURRENT_POSITION_E (EEPROM_UVLO_E_ABS - 4)
459 #define EEPROM_UVLO_SAVED_SEGMENT_IDX (EEPROM_UVLO_CURRENT_POSITION_E - 2)
461 #define EEPROM_FREE_NR4 (EEPROM_UVLO_SAVED_SEGMENT_IDX - 1)
462 #define EEPROM_FREE_NR5 (EEPROM_FREE_NR4 - 1)
464 #define EEPROM_CRASH_DET (EEPROM_FREE_NR5 - 1)
465 #define EEPROM_CRASH_COUNT_Y (EEPROM_CRASH_DET - 1)
466 #define EEPROM_FSENSOR (EEPROM_CRASH_COUNT_Y - 1)
467 #define EEPROM_CRASH_COUNT_X (EEPROM_FSENSOR - 1)
468 #define EEPROM_FERROR_COUNT (EEPROM_CRASH_COUNT_X - 1)
469 #define EEPROM_POWER_COUNT (EEPROM_FERROR_COUNT - 1)
471 #define EEPROM_XYZ_CAL_SKEW (EEPROM_POWER_COUNT - 4)
472 #define EEPROM_WIZARD_ACTIVE (EEPROM_XYZ_CAL_SKEW - 1)
473 #define EEPROM_BELTSTATUS_X (EEPROM_WIZARD_ACTIVE - 2)
474 #define EEPROM_BELTSTATUS_Y (EEPROM_BELTSTATUS_X - 2)
476 #define EEPROM_DIR_DEPTH (EEPROM_BELTSTATUS_Y-1)
477 #define EEPROM_DIRS (EEPROM_DIR_DEPTH-80)
478 #define EEPROM_SD_SORT (EEPROM_DIRS - 1)
479 #define EEPROM_SECOND_SERIAL_ACTIVE (EEPROM_SD_SORT - 1)
481 #define EEPROM_FSENS_AUTOLOAD_ENABLED (EEPROM_SECOND_SERIAL_ACTIVE - 1)
484 #define EEPROM_CRASH_COUNT_X_TOT (EEPROM_FSENS_AUTOLOAD_ENABLED - 2)
486 #define EEPROM_CRASH_COUNT_Y_TOT (EEPROM_CRASH_COUNT_X_TOT - 2)
488 #define EEPROM_FERROR_COUNT_TOT (EEPROM_CRASH_COUNT_Y_TOT - 2)
490 #define EEPROM_POWER_COUNT_TOT (EEPROM_FERROR_COUNT_TOT - 2)
496 #define EEPROM_TMC2130_HOME_X_ORIGIN (EEPROM_POWER_COUNT_TOT - 1)
498 #define EEPROM_TMC2130_HOME_X_BSTEPS (EEPROM_TMC2130_HOME_X_ORIGIN - 1)
500 #define EEPROM_TMC2130_HOME_X_FSTEPS (EEPROM_TMC2130_HOME_X_BSTEPS - 1)
502 #define EEPROM_TMC2130_HOME_Y_ORIGIN (EEPROM_TMC2130_HOME_X_FSTEPS - 1)
504 #define EEPROM_TMC2130_HOME_Y_BSTEPS (EEPROM_TMC2130_HOME_Y_ORIGIN - 1)
506 #define EEPROM_TMC2130_HOME_Y_FSTEPS (EEPROM_TMC2130_HOME_Y_BSTEPS - 1)
508 #define EEPROM_TMC2130_HOME_ENABLED (EEPROM_TMC2130_HOME_Y_FSTEPS - 1)
515 #define EEPROM_TMC2130_WAVE_X_FAC (EEPROM_TMC2130_HOME_ENABLED - 1)
516 #define EEPROM_TMC2130_WAVE_Y_FAC (EEPROM_TMC2130_WAVE_X_FAC - 1)
517 #define EEPROM_TMC2130_WAVE_Z_FAC (EEPROM_TMC2130_WAVE_Y_FAC - 1)
518 #define EEPROM_TMC2130_WAVE_E_FAC (EEPROM_TMC2130_WAVE_Z_FAC - 1)
525 #define EEPROM_TMC2130_X_MRES (EEPROM_TMC2130_WAVE_E_FAC - 1)
526 #define EEPROM_TMC2130_Y_MRES (EEPROM_TMC2130_X_MRES - 1)
527 #define EEPROM_TMC2130_Z_MRES (EEPROM_TMC2130_Y_MRES - 1)
528 #define EEPROM_TMC2130_E_MRES (EEPROM_TMC2130_Z_MRES - 1)
531 #define EEPROM_PRINTER_TYPE (EEPROM_TMC2130_E_MRES - 2)
532 #define EEPROM_BOARD_TYPE (EEPROM_PRINTER_TYPE - 2)
535 #define EEPROM_EXTRUDER_MULTIPLIER_0 (EEPROM_BOARD_TYPE - 4)
536 #define EEPROM_EXTRUDER_MULTIPLIER_1 (EEPROM_EXTRUDER_MULTIPLIER_0 - 4)
537 #define EEPROM_EXTRUDER_MULTIPLIER_2 (EEPROM_EXTRUDER_MULTIPLIER_1 - 4)
538 #define EEPROM_EXTRUDEMULTIPLY (EEPROM_EXTRUDER_MULTIPLIER_2 - 2)
540 #define EEPROM_UVLO_TINY_CURRENT_POSITION_Z (EEPROM_EXTRUDEMULTIPLY-4)
541 #define EEPROM_UVLO_TARGET_HOTEND (EEPROM_UVLO_TINY_CURRENT_POSITION_Z-2)
544 #define EEPROM_SOUND_MODE (EEPROM_UVLO_TARGET_HOTEND-1)
545 #define EEPROM_SPOOL_JOIN (EEPROM_SOUND_MODE-1)
547 #define EEPROM_FSENS_RUNOUT_ENABLED (EEPROM_SPOOL_JOIN - 1)
549 #define EEPROM_MMU_FAIL_TOT (EEPROM_FSENS_RUNOUT_ENABLED - 2)
550 #define EEPROM_MMU_FAIL (EEPROM_MMU_FAIL_TOT - 1)
552 #define EEPROM_MMU_LOAD_FAIL_TOT (EEPROM_MMU_FAIL - 2)
553 #define EEPROM_MMU_LOAD_FAIL (EEPROM_MMU_LOAD_FAIL_TOT - 1)
554 #define EEPROM_MMU_CUTTER_ENABLED (EEPROM_MMU_LOAD_FAIL - 1)
555 #define EEPROM_UVLO_MESH_BED_LEVELING_FULL (EEPROM_MMU_CUTTER_ENABLED - 12*12*2)
557 #define _EEPROM_FREE_NR9_ (EEPROM_UVLO_MESH_BED_LEVELING_FULL-1)
559 #define EEPROM_MBL_MAGNET_ELIMINATION (_EEPROM_FREE_NR9_ - 1)
560 #define EEPROM_MBL_POINTS_NR (EEPROM_MBL_MAGNET_ELIMINATION -1)
561 #define EEPROM_MBL_PROBE_NR (EEPROM_MBL_POINTS_NR-1)
563 #define EEPROM_MMU_STEALTH (EEPROM_MBL_PROBE_NR-1)
565 #define EEPROM_CHECK_MODE (EEPROM_MMU_STEALTH-1)
566 #define EEPROM_NOZZLE_DIAMETER (EEPROM_CHECK_MODE-1)
567 #define EEPROM_NOZZLE_DIAMETER_uM (EEPROM_NOZZLE_DIAMETER-2)
568 #define EEPROM_CHECK_MODEL (EEPROM_NOZZLE_DIAMETER_uM-1)
569 #define EEPROM_CHECK_VERSION (EEPROM_CHECK_MODEL-1)
570 #define EEPROM_CHECK_GCODE (EEPROM_CHECK_VERSION-1)
572 #define EEPROM_SHEETS_BASE (EEPROM_CHECK_GCODE - EEPROM_SHEETS_SIZEOF)
573 static Sheets *
const EEPROM_Sheets_base = (
Sheets*)(EEPROM_SHEETS_BASE);
575 #define EEPROM_FSENSOR_PCB (EEPROM_SHEETS_BASE-1)
576 #define EEPROM_FSENSOR_ACTION_NA (EEPROM_FSENSOR_PCB-1)
578 #define EEPROM_UVLO_SAVED_START_POSITION (EEPROM_FSENSOR_ACTION_NA - 4*4)
579 #define EEPROM_UVLO_FEEDMULTIPLY (EEPROM_UVLO_SAVED_START_POSITION - 2)
581 #define EEPROM_BACKLIGHT_LEVEL_HIGH (EEPROM_UVLO_FEEDMULTIPLY-1)
582 #define EEPROM_BACKLIGHT_LEVEL_LOW (EEPROM_BACKLIGHT_LEVEL_HIGH-1)
583 #define EEPROM_BACKLIGHT_MODE (EEPROM_BACKLIGHT_LEVEL_LOW-1)
584 #define EEPROM_BACKLIGHT_TIMEOUT (EEPROM_BACKLIGHT_MODE-2)
586 #define EEPROM_UVLO_LA_K (EEPROM_BACKLIGHT_TIMEOUT-4)
588 #define EEPROM_ALTFAN_OVERRIDE (EEPROM_UVLO_LA_K-1)
589 #define EEPROM_EXPERIMENTAL_VISIBILITY (EEPROM_ALTFAN_OVERRIDE-1)
590 #define EEPROM_PINDA_TEMP_COMPENSATION (EEPROM_EXPERIMENTAL_VISIBILITY-1)
591 #define EEPROM_PRUSA_SN (EEPROM_PINDA_TEMP_COMPENSATION-20)
593 #define EEPROM_UVLO_ACCELL (EEPROM_PRUSA_SN-4)
594 #define EEPROM_UVLO_RETRACT_ACCELL (EEPROM_UVLO_ACCELL-4)
595 #define EEPROM_UVLO_TRAVEL_ACCELL (EEPROM_UVLO_RETRACT_ACCELL-4)
597 #define EEPROM_JOB_ID (EEPROM_UVLO_TRAVEL_ACCELL-4)
599 #define EEPROM_ECOOL_ENABLE (EEPROM_JOB_ID-1)
600 #define EEPROM_FW_CRASH_FLAG (EEPROM_ECOOL_ENABLE-1)
602 #define EEPROM_THERMAL_MODEL_ENABLE (EEPROM_FW_CRASH_FLAG-1)
603 #define EEPROM_THERMAL_MODEL_P (EEPROM_THERMAL_MODEL_ENABLE-4)
604 #define EEPROM_THERMAL_MODEL_C (EEPROM_THERMAL_MODEL_P-4)
605 #define EEPROM_THERMAL_MODEL_R (EEPROM_THERMAL_MODEL_C-4*16)
606 #define EEPROM_THERMAL_MODEL_Ta_corr (EEPROM_THERMAL_MODEL_R-4)
607 #define EEPROM_THERMAL_MODEL_W (EEPROM_THERMAL_MODEL_Ta_corr-4)
608 #define EEPROM_THERMAL_MODEL_E (EEPROM_THERMAL_MODEL_W-4)
610 #define EEPROM_FSENSOR_JAM_DETECTION (EEPROM_THERMAL_MODEL_E-1)
611 #define EEPROM_MMU_ENABLED (EEPROM_FSENSOR_JAM_DETECTION-1)
612 #define EEPROM_MMU_MATERIAL_CHANGES (EEPROM_MMU_ENABLED-4)
613 #define EEPROM_HEAT_BED_ON_LOAD_FILAMENT (EEPROM_MMU_MATERIAL_CHANGES-1)
614 #define EEPROM_CALIBRATION_STATUS_V2 (EEPROM_HEAT_BED_ON_LOAD_FILAMENT-1)
616 #define EEPROM_THERMAL_MODEL_U (EEPROM_CALIBRATION_STATUS_V2-4)
617 #define EEPROM_THERMAL_MODEL_V (EEPROM_THERMAL_MODEL_U-4)
618 #define EEPROM_THERMAL_MODEL_D (EEPROM_THERMAL_MODEL_V-4)
619 #define EEPROM_THERMAL_MODEL_L (EEPROM_THERMAL_MODEL_D-2)
620 #define EEPROM_THERMAL_MODEL_VER (EEPROM_THERMAL_MODEL_L-1)
622 #define EEPROM_KILL_MESSAGE (EEPROM_THERMAL_MODEL_VER-2)
623 #define EEPROM_KILL_PENDING_FLAG (EEPROM_KILL_MESSAGE-1)
624 #define EEPROM_FILENAME_EXTENSION (EEPROM_KILL_PENDING_FLAG - 3)
625 #define EEPROM_CUSTOM_MENDEL_NAME (EEPROM_FILENAME_EXTENSION-17)
626 #define EEPROM_UVLO_Z_LIFTED (EEPROM_CUSTOM_MENDEL_NAME-1)
629 #define EEPROM_LAST_ITEM EEPROM_UVLO_Z_LIFTED
638 #define EEPROM_FIRMWARE_VERSION_END (FW_PRUSA3D_MAGIC_LEN+8)
639 #define EEPROM_FIRMWARE_VERSION_FLAVOR (FW_PRUSA3D_MAGIC_LEN+6)
640 #define EEPROM_FIRMWARE_VERSION_REVISION (FW_PRUSA3D_MAGIC_LEN+4)
641 #define EEPROM_FIRMWARE_VERSION_MINOR (FW_PRUSA3D_MAGIC_LEN+2)
642 #define EEPROM_FIRMWARE_VERSION_MAJOR FW_PRUSA3D_MAGIC_LEN
644 #define EEPROM_FIRMWARE_PRUSA_MAGIC 0
645 #define EEPROM_ECOOL_MAGIC_NUMBER 42
648 #include "ConfigurationStore.h"
649 static_assert(EEPROM_FIRMWARE_VERSION_END < 20,
"Firmware version EEPROM address conflicts with EEPROM_M500_base");
651 static_assert(((
sizeof(
M500_conf) + 20) < EEPROM_LAST_ITEM),
"M500_conf address space conflicts with previous items.");
656 EEPROM_MMU_CUTTER_ENABLED_enabled = 1,
657 EEPROM_MMU_CUTTER_ENABLED_always = 2,
662 void eeprom_adjust_bed_reset();
669 void eeprom_switch_to_next_sheet();
670 bool eeprom_is_sheet_initialized(uint8_t sheet_num);
672 bool eeprom_is_initialized_block(
const void *__p,
size_t __n);
673 void eeprom_update_block_P(
const void *__src,
void *__dst,
size_t __n);
674 void eeprom_toggle(uint8_t *__p);
676 void eeprom_increment_byte(uint8_t *__p);
677 void eeprom_increment_word(uint16_t *__p);
678 void eeprom_increment_dword(uint32_t *__p);
680 void eeprom_add_byte(uint8_t *__p, uint8_t add);
681 void eeprom_add_word(uint16_t *__p, uint16_t add);
682 void eeprom_add_dword(uint32_t *__p, uint32_t add);
684 uint8_t eeprom_init_default_byte(uint8_t *__p, uint8_t def);
685 uint16_t eeprom_init_default_word(uint16_t *__p, uint16_t def);
686 uint32_t eeprom_init_default_dword(uint32_t *__p, uint32_t def);
687 void eeprom_init_default_float(
float *__p,
float def);
688 void eeprom_init_default_block(
void *__p,
size_t __n,
const void *def);
689 void eeprom_init_default_block_P(
void *__p,
size_t __n,
const void *def);
691 #ifndef DEBUG_EEPROM_CHANGES
693 void eeprom_update_byte_notify(uint8_t *dst, uint8_t value);
694 void eeprom_write_word_notify(uint16_t *dst, uint16_t value);
695 void eeprom_update_word_notify(uint16_t *dst, uint16_t value);
696 void eeprom_write_dword_notify(uint32_t *dst, uint32_t value);
697 void eeprom_update_dword_notify(uint32_t *dst, uint32_t value);
698 void eeprom_write_float_notify(
float *dst,
float value);
699 void eeprom_update_float_notify(
float *dst,
float value);
700 void eeprom_write_block_notify(
const void *__src,
void *__dst ,
size_t __size);
701 void eeprom_update_block_notify(
const void *__src,
void *__dst,
size_t __size);
704 void eeprom_update_byte_notify(uint8_t *dst, uint8_t value,
bool active =
true);
705 void eeprom_write_word_notify(uint16_t *dst, uint16_t value,
bool active =
true);
706 void eeprom_update_word_notify(uint16_t *dst, uint16_t value,
bool active =
true);
707 void eeprom_write_dword_notify(uint32_t *dst, uint32_t value,
bool active =
true);
708 void eeprom_update_dword_notify(uint32_t *dst, uint32_t value,
bool active =
true);
709 void eeprom_write_float_notify(
float *dst,
float value,
bool active =
true);
710 void eeprom_update_float_notify(
float *dst,
float value,
bool active =
true);
711 void eeprom_write_block_notify(
const void *__src,
void *__dst ,
size_t __size,
bool active =
true);
712 void eeprom_update_block_notify(
const void *__src,
void *__dst,
size_t __size ,
bool active =
true);
void eeprom_default_sheet_name(uint8_t index, SheetName &sheetName)
Get default sheet name for index.
Definition: eeprom.cpp:91
int8_t eeprom_next_initialized_sheet(int8_t sheet)
Get next initialized sheet.
Definition: eeprom.cpp:129
void eeprom_write_byte_notify(uint8_t *dst, uint8_t value)
Updates eeprom byte and notifies the changed eeprom address (just the address!) onto the serial line.
Definition: eeprom.cpp:167
Definition: ConfigurationStore.h:10
uint8_t bed_temp
0 .. 254 [°C] NOTE: currently only written-to and never used
Definition: eeprom.h:33
int16_t z_offset
Z_BABYSTEP_MIN .. Z_BABYSTEP_MAX = Z_BABYSTEP_MIN*2/1000 [mm] .. Z_BABYSTEP_MAX*2/1000 [mm].
Definition: eeprom.h:32
unsigned char name[MAX_SHEET_NAME_LENGTH]
Can be null terminated, doesn't need to be null terminated.
Definition: eeprom.h:31
uint8_t pinda_temp
0 .. 254 [°C] NOTE: currently only written-to and never used
Definition: eeprom.h:34