aboutsummaryrefslogtreecommitdiff
path: root/cores/arduino/wiring.h
diff options
context:
space:
mode:
authorDavid A. Mellis <d.mellis@arduino.cc>2008-03-08 21:30:00 +0000
committerDavid A. Mellis <d.mellis@arduino.cc>2008-03-08 21:30:00 +0000
commitc7cac2f165aa224462a625a892d834fc94938913 (patch)
tree9995ff3aad71215d6fdc6fa95d96a774cdc1ee7a /cores/arduino/wiring.h
parentf3893aba50116631007060697169b0150fd5caf8 (diff)
Added timeout (in microseconds) parameter to pulseIn(). Defaults to 1000000 (1 second).
Diffstat (limited to 'cores/arduino/wiring.h')
-rwxr-xr-xcores/arduino/wiring.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/cores/arduino/wiring.h b/cores/arduino/wiring.h
index df43e6c..26cba9e 100755
--- a/cores/arduino/wiring.h
+++ b/cores/arduino/wiring.h
@@ -87,6 +87,7 @@ extern "C"{
#define clockCyclesPerMicrosecond() ( F_CPU / 1000000L )
#define clockCyclesToMicroseconds(a) ( (a) / clockCyclesPerMicrosecond() )
+#define microsecondsToClockCycles(a) ( (a) * clockCyclesPerMicrosecond() )
typedef uint8_t boolean;
typedef uint8_t byte;
@@ -118,7 +119,7 @@ void printIntegerInBase(unsigned long n, unsigned long base);
unsigned long millis(void);
void delay(unsigned long);
void delayMicroseconds(unsigned int us);
-unsigned long pulseIn(uint8_t pin, uint8_t state);
+unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout);
void shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, byte val);