Better handling of DELAY_NS and DELAY_US (#10716)
Co-Authored-By: ejtagle <ejtagle@hotmail.com>
This commit is contained in:
@@ -37,6 +37,7 @@
|
||||
//
|
||||
//#include <WInterrupts.h>
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
#include "../Delay.h"
|
||||
#include <stdint.h>
|
||||
#include <stdarg.h>
|
||||
#include <Arduino.h>
|
||||
@@ -78,28 +79,9 @@ static const DELAY_TABLE table[] = {
|
||||
// Private methods
|
||||
//
|
||||
|
||||
#if 0
|
||||
/* static */
|
||||
inline void SoftwareSerial::tunedDelay(const uint32_t count) {
|
||||
|
||||
asm volatile(
|
||||
|
||||
"mov r3, %[loopsPerMicrosecond] \n\t" //load the initial loop counter
|
||||
"1: \n\t"
|
||||
"sub r3, r3, #1 \n\t"
|
||||
"bne 1b \n\t"
|
||||
|
||||
://empty output list
|
||||
:[loopsPerMicrosecond] "r" (count)
|
||||
:"r3", "cc" //clobber list
|
||||
);
|
||||
|
||||
DELAY_US(count);
|
||||
}
|
||||
#else
|
||||
inline void SoftwareSerial::tunedDelay(const uint32_t count) {
|
||||
delayMicroseconds(count);
|
||||
}
|
||||
#endif
|
||||
|
||||
// This function sets the current object as the "listening"
|
||||
// one and returns true if it replaces another
|
||||
|
||||
Reference in New Issue
Block a user