You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a new 'OUTPUT_OPENDRAIN' pinmode for platforms.
Not every MCU offers open drain pins, but some do. This change
means that they'll no longer have to play games to implement an
API-compatible pinMode() function that offers open drain.
Fixes#155
If you're reading this commit message because you need to add another
pin mode to this enum, the hacky trivial workaround is to do something
like this in your core:
```
// This typedef is used to extend the PinMode typedef enum
// in the ArduinoAPI, since they don't have contants
typedef enum {
INPUT_ANALOG = 99 , // We assume that the Arduino core will never have 99 PinModes
OUTPUT_OPEN_DRAIN // It'd be cleaner to be able to count the size of that enum
} PinModeExtension;
```
Because PinMode is an enum and not a proper type, the compiler will
let the user pass either a PinMode or a PinModeExtension to your
pinMode() function, even though the signature is
`void pinMode(pin_size_t ulPin, PinMode ulMode)`
0 commit comments