mirror of
https://github.com/arduino/Arduino.git
synced 2024-12-01 12:24:14 +01:00
tuned costant for pulseIn
This commit is contained in:
parent
1aea8f32dd
commit
e4fdb9ece3
@ -54,8 +54,8 @@ extern uint32_t pulseIn( uint32_t pin, uint32_t state, uint32_t timeout )
|
||||
}
|
||||
|
||||
// convert the reading to microseconds. The loop has been determined
|
||||
// to be 22 clock cycles long and have about 16 clocks between the edge
|
||||
// to be 52 clock cycles long and have about 16 clocks between the edge
|
||||
// and the start of the loop. There will be some error introduced by
|
||||
// the interrupt handlers.
|
||||
return clockCyclesToMicroseconds(width * 22 + 16);
|
||||
return clockCyclesToMicroseconds(width * 52 + 16);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user