Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pin 5 on ESP32 is also available as GPIO #123

Merged
merged 1 commit into from
Nov 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/utility/Boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,7 @@ writePort(port, value, bitmask): Write an 8 bit port.
#define DEFAULT_PWM_RESOLUTION PWM_RESOLUTION

// ESP32
// GPIO 6-11 are used for FLASH I/O, therefore they're unavailable here
#elif defined(ESP32)
#define TOTAL_ANALOG_PINS NUM_ANALOG_INPUTS
#define TOTAL_PINS NUM_DIGITAL_PINS
Expand All @@ -693,8 +694,8 @@ writePort(port, value, bitmask): Write an 8 bit port.
#define digitalPinHasSerial(p) ((p) == 16 || (p) == 17 || (p) == 1 || (p) == 3)
// Pins 1 and 3 are used for the USB Serial communication. If we enable them here, the initial pin reset causes the serial communication
// to not work after boot.
#define IS_PIN_DIGITAL(p) ((p) == 0 || (p) == 2 || (p) == 4 || ((p) >= 12 && (p) < 24) || ((p) >= 25 && (p) < 28) || ((p) >= 32 && (p) <= 39))
#define IS_PIN_ANALOG(p) ((p) == 0 || (p) == 2 || (p) == 4 || ((p) >= 12 && (p) < 16) || ((p >= 25 && (p) < 28) || ((p) >= 32 && (p) < 37) || (p) == 39))
#define IS_PIN_DIGITAL(p) ((p) == 0 || (p) == 2 || (p) == 4 || (p) == 5 || ((p) >= 12 && (p) < 24) || ((p) >= 25 && (p) < 28) || ((p) >= 32 && (p) <= 39))
#define IS_PIN_ANALOG(p) ((p) == 0 || (p) == 2 || (p) == 4 || (p) == 5 || ((p) >= 12 && (p) < 16) || ((p >= 25 && (p) < 28) || ((p) >= 32 && (p) < 37) || (p) == 39))
#define IS_PIN_PWM(p) (IS_PIN_DIGITAL(p) && digitalPinHasPWM(p))
#define IS_PIN_SERVO(p) IS_PIN_DIGITAL(p)
#define IS_PIN_I2C(p) ((IS_PIN_DIGITAL(p)) && ((p == 21) || (p == 22)))
Expand Down