-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Closed
Labels
Library: WireThe Wire Arduino libraryThe Wire Arduino libraryfeature requestA request to make an enhancement (not a bug fix)A request to make an enhancement (not a bug fix)
Description
I suggest making the public methods of the TwoWire class virtual in order to allow polymorphism when subclassing it.
Use case: Have another library that utilizes the Wire library and takes a refrence to a TwoWire instance in constructor. Want to use it on pins without hardware I2C (or other reason for not wanting to use the standard Wire implementation). So I want to pass another class instance that inherits from TwoWire and implements the same methods (but uses software I2C). This does not work with current implementation because of early binding (the base class functions will be called instead of the ones in subclass).
Metadata
Metadata
Assignees
Labels
Library: WireThe Wire Arduino libraryThe Wire Arduino libraryfeature requestA request to make an enhancement (not a bug fix)A request to make an enhancement (not a bug fix)