diff options
author | Martino Facchin <m.facchin@arduino.cc> | 2021-05-26 15:50:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-26 15:50:02 +0200 |
commit | 24e6edd475c287cdafee0a4db2eb98927ce3cf58 (patch) | |
tree | b3251605dc629e3bbc8ab899b4f4ffe66b1e1e98 /cores/arduino/wiring.c | |
parent | 1ac42f7ac0c365cfa4d901889ff6d4c23d3b4796 (diff) | |
parent | 20dc2e532e5cecd17a7f463cf86541d87e5090e8 (diff) |
Merge pull request #413 from per1234/ci
Use GitHub Actions for continuous integration
Diffstat (limited to 'cores/arduino/wiring.c')
-rw-r--r-- | cores/arduino/wiring.c | 26 |
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 |