Skip to content

Commit

Permalink
Wire: Define WIRE_HAS_TIMEOUT
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
matthijskooijman committed Apr 23, 2021
1 parent 9f8d27f commit 5c2ee7c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libraries/Wire/src/Wire.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@

// WIRE_HAS_END means Wire has end()
#define WIRE_HAS_END 1
// WIRE_HAS_TIMEOUT means Wire has setWireTimeout(), getWireTimeoutFlag
// and clearWireTimeoutFlag()
#define WIRE_HAS_TIMEOUT 1

class TwoWire : public Stream
{
Expand Down

0 comments on commit 5c2ee7c

Please sign in to comment.