Skip to content

Commit

Permalink
🔧 Sanity-check PRINTCOUNTER_SAVE_INTERVAL + ESP32 I2S Exp (MarlinFirm…
Browse files Browse the repository at this point in the history
…ware#25527)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
  • Loading branch information
HoverClub and thinkyhead committed Apr 7, 2023
1 parent 176ecf4 commit ccb4d11
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions Marlin/src/HAL/ESP32/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,7 @@
#if BOTH(I2S_STEPPER_STREAM, LIN_ADVANCE) && DISABLED(EXPERIMENTAL_I2S_LA)
#error "I2S stream is currently incompatible with LIN_ADVANCE."
#endif

#if BOTH(I2S_STEPPER_STREAM, PRINTCOUNTER) && PRINTCOUNTER_SAVE_INTERVAL > 0 && DISABLED(PRINTCOUNTER_SYNC)
#error "PRINTCOUNTER_SAVE_INTERVAL may cause issues on ESP32 with an I2S expander. Define PRINTCOUNTER_SYNC in Configuration.h for an imperfect solution."
#endif
2 changes: 1 addition & 1 deletion Marlin/src/HAL/LPC1768/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@
// LPC1768 boards seem to lose steps when saving to EEPROM during print (issue #20785)
// TODO: Which other boards are incompatible?
#if defined(MCU_LPC1768) && ENABLED(FLASH_EEPROM_EMULATION) && PRINTCOUNTER_SAVE_INTERVAL > 0
#define PRINTCOUNTER_SYNC 1
#define PRINTCOUNTER_SYNC
#endif
2 changes: 1 addition & 1 deletion Marlin/src/HAL/STM32/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@

// Some STM32F4 boards may lose steps when saving to EEPROM during print (PR #17946)
#if defined(STM32F4xx) && ENABLED(FLASH_EEPROM_EMULATION) && PRINTCOUNTER_SAVE_INTERVAL > 0
#define PRINTCOUNTER_SYNC 1
#define PRINTCOUNTER_SYNC
#endif
2 changes: 1 addition & 1 deletion Marlin/src/inc/Warnings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@
#warning "Creality 4.2.2 boards come with a variety of stepper drivers. Check the board label (typically on SD Card module) and set the correct *_DRIVER_TYPE! (C=HR4988, E=A4988, A=TMC2208, B=TMC2209, H=TMC2225, H8=HR4988). (Define NO_CREALITY_422_DRIVER_WARNING to suppress this warning.)"
#endif

#if PRINTCOUNTER_SYNC
#if ENABLED(PRINTCOUNTER_SYNC)
#warning "To prevent step loss, motion will pause for PRINTCOUNTER auto-save."
#endif

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/module/printcounter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Stopwatch print_job_timer; // Global Print Job Timer instance
#include "../libs/buzzer.h"
#endif

#if PRINTCOUNTER_SYNC
#if ENABLED(PRINTCOUNTER_SYNC)
#include "../module/planner.h"
#endif

Expand Down

0 comments on commit ccb4d11

Please sign in to comment.