diff --git a/Marlin/Max7219_Debug_LEDs.cpp b/Marlin/Max7219_Debug_LEDs.cpp index 102ec21cb..a0800c4fe 100644 --- a/Marlin/Max7219_Debug_LEDs.cpp +++ b/Marlin/Max7219_Debug_LEDs.cpp @@ -63,41 +63,38 @@ static uint8_t LEDs[8] = { 0 }; -#ifdef CPU_32_BIT - void MS_DELAY() { DELAY_1US; } // 32-bit processors need a delay to stabilize the signal -#else - #define MS_DELAY() DELAY_3_NOP -#endif +// Delay for 0.1875µs (16MHz AVR) or 0.15µs (20MHz AVR) +#define SIG_DELAY() DELAY_3_NOP void Max7219_PutByte(uint8_t data) { CRITICAL_SECTION_START for (uint8_t i = 8; i--;) { - MS_DELAY(); + SIG_DELAY(); WRITE(MAX7219_CLK_PIN, LOW); // tick - MS_DELAY(); + SIG_DELAY(); WRITE(MAX7219_DIN_PIN, (data & 0x80) ? HIGH : LOW); // send 1 or 0 based on data bit - MS_DELAY(); + SIG_DELAY(); WRITE(MAX7219_CLK_PIN, HIGH); // tock - MS_DELAY(); + SIG_DELAY(); data <<= 1; } CRITICAL_SECTION_END } void Max7219(const uint8_t reg, const uint8_t data) { - MS_DELAY(); + SIG_DELAY(); CRITICAL_SECTION_START WRITE(MAX7219_LOAD_PIN, LOW); // begin - MS_DELAY(); + SIG_DELAY(); Max7219_PutByte(reg); // specify register - MS_DELAY(); + SIG_DELAY(); Max7219_PutByte(data); // put data - MS_DELAY(); + SIG_DELAY(); WRITE(MAX7219_LOAD_PIN, LOW); // and tell the chip to load the data - MS_DELAY(); + SIG_DELAY(); WRITE(MAX7219_LOAD_PIN, HIGH); CRITICAL_SECTION_END - MS_DELAY(); + SIG_DELAY(); } void Max7219_LED_Set(const uint8_t col, const uint8_t row, const bool on) { diff --git a/Marlin/printcounter.h b/Marlin/printcounter.h index 89c61cb2e..299405a6b 100644 --- a/Marlin/printcounter.h +++ b/Marlin/printcounter.h @@ -44,7 +44,7 @@ class PrintCounter: public Stopwatch { private: typedef Stopwatch super; - #if ENABLED(I2C_EEPROM) || ENABLED(SPI_EEPROM) || defined(CPU_32_BIT) + #if ENABLED(I2C_EEPROM) || ENABLED(SPI_EEPROM) typedef uint32_t promdress; #else typedef uint16_t promdress;