Skip to content

Commit 5c2ee7c

Browse files
Wire: Define WIRE_HAS_TIMEOUT
In commit deea929 (Introduce non compulsory Wire timeout), some timeout-related functions were added. To allow writing portable sketches, it is important for those sketch to know whether they are using a Wire library version that is new enough to offer these functions without having to rely on version number checking (since other Arduino cores have their own versioning schemes). This adds a WIRE_HAS_TIMEOUT macro, similar to the existing WIRE_HAS_END macro, to facilitate that. This relates to arduino#42.
1 parent 9f8d27f commit 5c2ee7c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: libraries/Wire/src/Wire.h

+3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030

3131
// WIRE_HAS_END means Wire has end()
3232
#define WIRE_HAS_END 1
33+
// WIRE_HAS_TIMEOUT means Wire has setWireTimeout(), getWireTimeoutFlag
34+
// and clearWireTimeoutFlag()
35+
#define WIRE_HAS_TIMEOUT 1
3336

3437
class TwoWire : public Stream
3538
{

0 commit comments

Comments
 (0)