Better handling of DELAY_NS and DELAY_US (#10716)
Co-Authored-By: ejtagle <ejtagle@hotmail.com>
This commit is contained in:
@@ -60,19 +60,16 @@
|
||||
#include "../module/planner.h"
|
||||
#include "../module/stepper.h"
|
||||
#include "../Marlin.h"
|
||||
#include "../HAL/Delay.h"
|
||||
|
||||
static uint8_t LEDs[8] = { 0 };
|
||||
|
||||
#ifdef CPU_32_BIT
|
||||
// Approximate a 1µs delay on 32-bit ARM
|
||||
void SIG_DELAY() {
|
||||
int16_t delay_cycles = CYCLES_PER_MICROSECOND - 10;
|
||||
while (delay_cycles >= 10) { DELAY_NOPS(6); delay_cycles -= 10; }
|
||||
if (delay_cycles > 0) DELAY_NOPS(delay_cycles);
|
||||
}
|
||||
#define SIG_DELAY() DELAY_US(1)
|
||||
#else
|
||||
// Delay for 0.1875µs (16MHz AVR) or 0.15µs (20MHz AVR)
|
||||
#define SIG_DELAY() DELAY_3_NOP
|
||||
#define SIG_DELAY() DELAY_NS(188)
|
||||
#endif
|
||||
|
||||
void Max7219_PutByte(uint8_t data) {
|
||||
|
||||
Reference in New Issue
Block a user