Better handling of DELAY_NS and DELAY_US (#10716)

Co-Authored-By: ejtagle <ejtagle@hotmail.com>
This commit is contained in:
Scott Lahteine
2018-05-12 08:34:04 -05:00
committed by GitHub
parent f5aaa2d6c0
commit a1062eec5b
21 changed files with 273 additions and 268 deletions

View File

@@ -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