1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-22 08:22:04 +03:00

Adding ADXL3xx accelerometer example; minor comment changes.

This commit is contained in:
David A. Mellis
2008-07-02 19:06:27 +00:00
parent 0bdc02cea5
commit 278872728a
4 changed files with 58 additions and 6 deletions

View File

@ -42,6 +42,8 @@ unsigned long millis()
unsigned long m;
uint8_t oldSREG = SREG;
// disable interrupts while we read timer0_millis or we might get an
// inconsistent value (e.g. in the middle of the timer0_millis++)
cli();
m = timer0_millis;
SREG = oldSREG;
@ -57,7 +59,7 @@ void delay(unsigned long ms)
;
}
/* Delay for the given number of microseconds. Assumes a 16 MHz clock.
/* Delay for the given number of microseconds. Assumes a 8 or 16 MHz clock.
* Disables interrupts, which will disrupt the millis() function if used
* too frequently. */
void delayMicroseconds(unsigned int us)