aboutsummaryrefslogtreecommitdiff
path: root/cores/arduino/wiring.c
diff options
context:
space:
mode:
authorDave Madison <dmadison@users.noreply.github.com>2022-02-22 02:32:00 -0500
committerGitHub <noreply@github.com>2022-02-22 02:32:00 -0500
commitd52b6ea456dd145025659359847e3ba8b58b5a27 (patch)
tree7c106c4e741e47ef5dd9f4f45529fd6a6010a896 /cores/arduino/wiring.c
parentf47a97522dc28c16c432422e3085035de69cfaf6 (diff)
parent6f5881438af5b416fe83b0721a51215b9833498c (diff)
Merge pull request #14 from dmadison/upstream-1.8.4
Merge upstream tag '1.8.4'
Diffstat (limited to 'cores/arduino/wiring.c')
-rw-r--r--cores/arduino/wiring.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/cores/arduino/wiring.c b/cores/arduino/wiring.c
index 9727135..8caf455 100644
--- a/cores/arduino/wiring.c
+++ b/cores/arduino/wiring.c
@@ -125,7 +125,7 @@ void delayMicroseconds(unsigned int us)
// 2 microseconds) gives delays longer than desired.
//delay_us(us);
#if F_CPU >= 24000000L
- // for the 24 MHz clock for the aventurous ones, trying to overclock
+ // for the 24 MHz clock for the adventurous ones trying to overclock
// zero delay fix
if (!us) return; // = 3 cycles, (4 when true)
@@ -135,9 +135,9 @@ void delayMicroseconds(unsigned int us)
// delay requested.
us *= 6; // x6 us, = 7 cycles
- // account for the time taken in the preceeding commands.
+ // account for the time taken in the preceding commands.
// we just burned 22 (24) cycles above, remove 5, (5*4=20)
- // us is at least 6 so we can substract 5
+ // us is at least 6 so we can subtract 5
us -= 5; //=2 cycles
#elif F_CPU >= 20000000L
@@ -157,9 +157,9 @@ void delayMicroseconds(unsigned int us)
// delay requested.
us = (us << 2) + us; // x5 us, = 7 cycles
- // account for the time taken in the preceeding commands.
+ // account for the time taken in the preceding commands.
// we just burned 26 (28) cycles above, remove 7, (7*4=28)
- // us is at least 10 so we can substract 7
+ // us is at least 10 so we can subtract 7
us -= 7; // 2 cycles
#elif F_CPU >= 16000000L
@@ -174,9 +174,9 @@ void delayMicroseconds(unsigned int us)
// delay requested.
us <<= 2; // x4 us, = 4 cycles
- // account for the time taken in the preceeding commands.
+ // account for the time taken in the preceding commands.
// we just burned 19 (21) cycles above, remove 5, (5*4=20)
- // us is at least 8 so we can substract 5
+ // us is at least 8 so we can subtract 5
us -= 5; // = 2 cycles,
#elif F_CPU >= 12000000L
@@ -191,9 +191,9 @@ void delayMicroseconds(unsigned int us)
// delay requested.
us = (us << 1) + us; // x3 us, = 5 cycles
- // account for the time taken in the preceeding commands.
+ // account for the time taken in the preceding commands.
// we just burned 20 (22) cycles above, remove 5, (5*4=20)
- // us is at least 6 so we can substract 5
+ // us is at least 6 so we can subtract 5
us -= 5; //2 cycles
#elif F_CPU >= 8000000L
@@ -208,9 +208,9 @@ void delayMicroseconds(unsigned int us)
// delay requested.
us <<= 1; //x2 us, = 2 cycles
- // account for the time taken in the preceeding commands.
+ // account for the time taken in the preceding commands.
// we just burned 17 (19) cycles above, remove 4, (4*4=16)
- // us is at least 6 so we can substract 4
+ // us is at least 6 so we can subtract 4
us -= 4; // = 2 cycles
#else
@@ -218,9 +218,9 @@ void delayMicroseconds(unsigned int us)
// the overhead of the function calls is 14 (16) cycles
if (us <= 16) return; //= 3 cycles, (4 when true)
- if (us <= 25) return; //= 3 cycles, (4 when true), (must be at least 25 if we want to substract 22)
+ if (us <= 25) return; //= 3 cycles, (4 when true), (must be at least 25 if we want to subtract 22)
- // compensate for the time taken by the preceeding and next commands (about 22 cycles)
+ // compensate for the time taken by the preceding and next commands (about 22 cycles)
us -= 22; // = 2 cycles
// the following loop takes 4 microseconds (4 cycles)
// per iteration, so execute it us/4 times