Unverified Commit 725146d1 authored by Rodrigo Garcia's avatar Rodrigo Garcia Committed by GitHub

Fix pin attachInterrupt(digitalPinToInterrupt(48)) on all S3 based SOCs (#8600)

* Test GPIO number in attachInterrupt()

* Fixes S3 GPIO48 in digitalPinToInterrupt()

* Changes test of GPIO number in attachInterrupt()

* Fixes NUM_DIGITAL_PINS in Adafruit board

* Fixes GPIO48 in Edgebox-ESP-100 board
parent 8e2af4b9
...@@ -167,6 +167,9 @@ extern void __attachInterruptFunctionalArg(uint8_t pin, voidFuncPtrArg userFunc, ...@@ -167,6 +167,9 @@ extern void __attachInterruptFunctionalArg(uint8_t pin, voidFuncPtrArg userFunc,
{ {
static bool interrupt_initialized = false; static bool interrupt_initialized = false;
// makes sure that pin -1 (255) will never work -- this follows Arduino standard
if (pin >= SOC_GPIO_PIN_COUNT) return;
if(!interrupt_initialized) { if(!interrupt_initialized) {
esp_err_t err = gpio_install_isr_service((int)ARDUINO_ISR_FLAG); esp_err_t err = gpio_install_isr_service((int)ARDUINO_ISR_FLAG);
interrupt_initialized = (err == ESP_OK) || (err == ESP_ERR_INVALID_STATE); interrupt_initialized = (err == ESP_OK) || (err == ESP_ERR_INVALID_STATE);
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#define NUM_ANALOG_INPUTS 7 #define NUM_ANALOG_INPUTS 7
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) #define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) #define digitalPinToInterrupt(p) (((p)<49)?(p):-1)
#define digitalPinHasPWM(p) (p < 46) #define digitalPinHasPWM(p) (p < 46)
static const uint8_t TX = 43; static const uint8_t TX = 43;
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#define NUM_ANALOG_INPUTS 12 #define NUM_ANALOG_INPUTS 12
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) #define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) #define digitalPinToInterrupt(p) (((p)<49)?(p):-1)
#define digitalPinHasPWM(p) (p < 46) #define digitalPinHasPWM(p) (p < 46)
static const uint8_t TX = 43; static const uint8_t TX = 43;
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#define NUM_ANALOG_INPUTS 11 #define NUM_ANALOG_INPUTS 11
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) #define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) #define digitalPinToInterrupt(p) (((p)<49)?(p):-1)
#define digitalPinHasPWM(p) (p < 46) #define digitalPinHasPWM(p) (p < 46)
static const uint8_t TX = 43; static const uint8_t TX = 43;
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#define NUM_ANALOG_INPUTS 8 #define NUM_ANALOG_INPUTS 8
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) #define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) #define digitalPinToInterrupt(p) (((p)<49)?(p):-1)
#define digitalPinHasPWM(p) (p < 46) #define digitalPinHasPWM(p) (p < 46)
static const uint8_t TX = 43; static const uint8_t TX = 43;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#define NUM_ANALOG_INPUTS 2 #define NUM_ANALOG_INPUTS 2
#define analogInputToDigitalPin(p) (((p)<2)?(analogChannelToDigitalPin(p)):-1) #define analogInputToDigitalPin(p) (((p)<2)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<34)?(p):-1) #define digitalPinToInterrupt(p) (((p)<49)?(p):-1)
#define digitalPinHasPWM(p) (p < 34) #define digitalPinHasPWM(p) (p < 34)
//Programming and Debugging Port //Programming and Debugging Port
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#define NUM_ANALOG_INPUTS 6 #define NUM_ANALOG_INPUTS 6
#define analogInputToDigitalPin(p) (((p)<6)?(analogChannelToDigitalPin(p)):-1) #define analogInputToDigitalPin(p) (((p)<6)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<20)?(p):-1) #define digitalPinToInterrupt(p) (((p)<49)?(p):-1)
#define digitalPinHasPWM(p) (p < 20) #define digitalPinHasPWM(p) (p < 20)
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
#define USB_VID 0x2886 #define USB_VID 0x2886
#define USB_PID 0x0056 #define USB_PID 0x0056
#define EXTERNAL_NUM_INTERRUPTS 46 #define EXTERNAL_NUM_INTERRUPTS 49
#define NUM_DIGITAL_PINS 48 #define NUM_DIGITAL_PINS 49
#define NUM_ANALOG_INPUTS 20 #define NUM_ANALOG_INPUTS 20
static const uint8_t LED_BUILTIN = 21; static const uint8_t LED_BUILTIN = 21;
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#define NUM_ANALOG_INPUTS 20 #define NUM_ANALOG_INPUTS 20
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) #define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) #define digitalPinToInterrupt(p) (((p)<49)?(p):-1)
#define digitalPinHasPWM(p) (p < 46) #define digitalPinHasPWM(p) (p < 46)
#define LED_BUILTIN 13 #define LED_BUILTIN 13
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#define NUM_ANALOG_INPUTS 20 #define NUM_ANALOG_INPUTS 20
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) #define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) #define digitalPinToInterrupt(p) (((p)<49)?(p):-1)
#define digitalPinHasPWM(p) (p < 46) #define digitalPinHasPWM(p) (p < 46)
#define LED_BUILTIN 13 #define LED_BUILTIN 13
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#define NUM_ANALOG_INPUTS 20 #define NUM_ANALOG_INPUTS 20
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) #define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) #define digitalPinToInterrupt(p) (((p)<49)?(p):-1)
#define digitalPinHasPWM(p) (p < 46) #define digitalPinHasPWM(p) (p < 46)
#define LED_BUILTIN 13 #define LED_BUILTIN 13
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#define NUM_ANALOG_INPUTS 20 #define NUM_ANALOG_INPUTS 20
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) #define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) #define digitalPinToInterrupt(p) (((p)<49)?(p):-1)
#define digitalPinHasPWM(p) (p < 46) #define digitalPinHasPWM(p) (p < 46)
#define LED_BUILTIN 13 #define LED_BUILTIN 13
......
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
#define USB_PRODUCT "MatrixPortal ESP32-S3" #define USB_PRODUCT "MatrixPortal ESP32-S3"
#define USB_SERIAL "" // Empty string for MAC adddress #define USB_SERIAL "" // Empty string for MAC adddress
#define EXTERNAL_NUM_INTERRUPTS 46 #define EXTERNAL_NUM_INTERRUPTS 49
#define NUM_DIGITAL_PINS 48 #define NUM_DIGITAL_PINS 49
#define NUM_ANALOG_INPUTS 6 #define NUM_ANALOG_INPUTS 6
#define analogInputToDigitalPin(p) (((p)<NUM_ANALOG_INPUTS)?(analogChannelToDigitalPin(p)):-1) #define analogInputToDigitalPin(p) (((p)<NUM_ANALOG_INPUTS)?(analogChannelToDigitalPin(p)):-1)
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#define NUM_ANALOG_INPUTS 20 #define NUM_ANALOG_INPUTS 20
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) #define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) #define digitalPinToInterrupt(p) (((p)<49)?(p):-1)
#define digitalPinHasPWM(p) (p < 46) #define digitalPinHasPWM(p) (p < 46)
#define LED_BUILTIN 13 #define LED_BUILTIN 13
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#define NUM_ANALOG_INPUTS 20 #define NUM_ANALOG_INPUTS 20
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) #define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) #define digitalPinToInterrupt(p) (((p)<49)?(p):-1)
#define digitalPinHasPWM(p) (p < 46) #define digitalPinHasPWM(p) (p < 46)
#define PIN_NEOPIXEL 39 #define PIN_NEOPIXEL 39
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#define NUM_ANALOG_INPUTS 20 #define NUM_ANALOG_INPUTS 20
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) #define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) #define digitalPinToInterrupt(p) (((p)<49)?(p):-1)
#define digitalPinHasPWM(p) (p < 46) #define digitalPinHasPWM(p) (p < 46)
#define PIN_NEOPIXEL 39 #define PIN_NEOPIXEL 39
......
...@@ -24,7 +24,7 @@ static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+48; ...@@ -24,7 +24,7 @@ static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+48;
#define RGB_BRIGHTNESS 25 #define RGB_BRIGHTNESS 25
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) #define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) #define digitalPinToInterrupt(p) (((p)<49)?(p):-1)
#define digitalPinHasPWM(p) (p < 46) #define digitalPinHasPWM(p) (p < 46)
static const uint8_t TX = 43; static const uint8_t TX = 43;
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#define NUM_ANALOG_INPUTS 20 #define NUM_ANALOG_INPUTS 20
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) #define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) #define digitalPinToInterrupt(p) (((p)<49)?(p):-1)
#define digitalPinHasPWM(p) (p < 46) #define digitalPinHasPWM(p) (p < 46)
static const uint8_t LED_BUILTIN = 21; static const uint8_t LED_BUILTIN = 21;
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#define NUM_ANALOG_INPUTS 12 #define NUM_ANALOG_INPUTS 12
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) #define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) #define digitalPinToInterrupt(p) (((p)<49)?(p):-1)
#define digitalPinHasPWM(p) (p < 46) #define digitalPinHasPWM(p) (p < 46)
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#define NUM_ANALOG_INPUTS 20 #define NUM_ANALOG_INPUTS 20
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) #define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) #define digitalPinToInterrupt(p) (((p)<49)?(p):-1)
#define digitalPinHasPWM(p) (p < 46) #define digitalPinHasPWM(p) (p < 46)
static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+48; static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+48;
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#define NUM_ANALOG_INPUTS 20 #define NUM_ANALOG_INPUTS 20
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) #define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) #define digitalPinToInterrupt(p) (((p)<49)?(p):-1)
#define digitalPinHasPWM(p) (p < 46) #define digitalPinHasPWM(p) (p < 46)
static const uint8_t LED_BUILTIN = 35; static const uint8_t LED_BUILTIN = 35;
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#define NUM_ANALOG_INPUTS 20 #define NUM_ANALOG_INPUTS 20
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) #define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) #define digitalPinToInterrupt(p) (((p)<49)?(p):-1)
#define digitalPinHasPWM(p) (p < 46) #define digitalPinHasPWM(p) (p < 46)
static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+33; static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+33;
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#define NUM_ANALOG_INPUTS 20 #define NUM_ANALOG_INPUTS 20
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) #define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) #define digitalPinToInterrupt(p) (((p)<49)?(p):-1)
#define digitalPinHasPWM(p) (p < 46) #define digitalPinHasPWM(p) (p < 46)
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#define NUM_ANALOG_INPUTS 20 #define NUM_ANALOG_INPUTS 20
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) #define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) #define digitalPinToInterrupt(p) (((p)<49)?(p):-1)
#define digitalPinHasPWM(p) (p < 46) #define digitalPinHasPWM(p) (p < 46)
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#define NUM_ANALOG_INPUTS 20 #define NUM_ANALOG_INPUTS 20
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) #define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) #define digitalPinToInterrupt(p) (((p)<49)?(p):-1)
#define digitalPinHasPWM(p) (p < 46) #define digitalPinHasPWM(p) (p < 46)
static const uint8_t TX = 43; static const uint8_t TX = 43;
......
...@@ -21,7 +21,7 @@ static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+48; ...@@ -21,7 +21,7 @@ static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+48;
#define RGB_BRIGHTNESS 64 #define RGB_BRIGHTNESS 64
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) #define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) #define digitalPinToInterrupt(p) (((p)<49)?(p):-1)
#define digitalPinHasPWM(p) (p < 46) #define digitalPinHasPWM(p) (p < 46)
static const uint8_t TX = 43; static const uint8_t TX = 43;
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#define NUM_ANALOG_INPUTS 20 #define NUM_ANALOG_INPUTS 20
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) #define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) #define digitalPinToInterrupt(p) (((p)<49)?(p):-1)
#define digitalPinHasPWM(p) (p < 46) #define digitalPinHasPWM(p) (p < 46)
static const uint8_t TX = 43; static const uint8_t TX = 43;
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#define NUM_ANALOG_INPUTS 20 #define NUM_ANALOG_INPUTS 20
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) #define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) #define digitalPinToInterrupt(p) (((p)<49)?(p):-1)
#define digitalPinHasPWM(p) (p < 46) #define digitalPinHasPWM(p) (p < 46)
static const uint8_t TX = 43; static const uint8_t TX = 43;
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#define NUM_ANALOG_INPUTS 20 #define NUM_ANALOG_INPUTS 20
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) #define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) #define digitalPinToInterrupt(p) (((p)<49)?(p):-1)
#define digitalPinHasPWM(p) (p < 46) #define digitalPinHasPWM(p) (p < 46)
static const uint8_t TX = 43; static const uint8_t TX = 43;
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#define NUM_ANALOG_INPUTS 20 #define NUM_ANALOG_INPUTS 20
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) #define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) #define digitalPinToInterrupt(p) (((p)<49)?(p):-1)
#define digitalPinHasPWM(p) (p < 46) #define digitalPinHasPWM(p) (p < 46)
static const uint8_t LED_BUILTIN = 35; static const uint8_t LED_BUILTIN = 35;
......
...@@ -25,7 +25,7 @@ static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+48; ...@@ -25,7 +25,7 @@ static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+48;
#define RGB_BRIGHTNESS 64 #define RGB_BRIGHTNESS 64
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) #define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) #define digitalPinToInterrupt(p) (((p)<49)?(p):-1)
#define digitalPinHasPWM(p) (p < 46) #define digitalPinHasPWM(p) (p < 46)
static const uint8_t TX = 43; static const uint8_t TX = 43;
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#define NUM_ANALOG_INPUTS 15 #define NUM_ANALOG_INPUTS 15
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) #define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) #define digitalPinToInterrupt(p) (((p)<49)?(p):-1)
#define digitalPinHasPWM(p) (p < 34) #define digitalPinHasPWM(p) (p < 34)
static const uint8_t LED_BUILTIN = 35; static const uint8_t LED_BUILTIN = 35;
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#define NUM_ANALOG_INPUTS 20 #define NUM_ANALOG_INPUTS 20
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) #define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) #define digitalPinToInterrupt(p) (((p)<49)?(p):-1)
#define digitalPinHasPWM(p) (p < 46) #define digitalPinHasPWM(p) (p < 46)
static const uint8_t BUTTON_1 = 0; static const uint8_t BUTTON_1 = 0;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#define NUM_ANALOG_INPUTS 16 #define NUM_ANALOG_INPUTS 16
#define analogInputToDigitalPin(p) (((p) < 20) ? (analogChannelToDigitalPin(p)) : -1) #define analogInputToDigitalPin(p) (((p) < 20) ? (analogChannelToDigitalPin(p)) : -1)
#define digitalPinToInterrupt(p) (((p) < 40) ? (p) : -1) #define digitalPinToInterrupt(p) (((p) < 49) ? (p) : -1)
#define digitalPinHasPWM(p) (p < 34) #define digitalPinHasPWM(p) (p < 34)
static const uint8_t LED_BUILTIN = 0; //GPIO0, static const uint8_t LED_BUILTIN = 0; //GPIO0,
......
...@@ -18,7 +18,7 @@ static const uint8_t LED_BUILTIN = 38; ...@@ -18,7 +18,7 @@ static const uint8_t LED_BUILTIN = 38;
#define RGB_BRIGHTNESS 64 #define RGB_BRIGHTNESS 64
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) #define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) #define digitalPinToInterrupt(p) (((p)<49)?(p):-1)
#define digitalPinHasPWM(p) (p < 46) #define digitalPinHasPWM(p) (p < 46)
static const uint8_t TX = 43; static const uint8_t TX = 43;
......
...@@ -18,7 +18,7 @@ static const uint8_t LED_BUILTIN = 47; ...@@ -18,7 +18,7 @@ static const uint8_t LED_BUILTIN = 47;
#define RGB_BRIGHTNESS 64 #define RGB_BRIGHTNESS 64
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) #define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) #define digitalPinToInterrupt(p) (((p)<49)?(p):-1)
#define digitalPinHasPWM(p) (p < 46) #define digitalPinHasPWM(p) (p < 46)
static const uint8_t TX = 43; static const uint8_t TX = 43;
......
...@@ -18,7 +18,7 @@ static const uint8_t LED_BUILTIN = 38; ...@@ -18,7 +18,7 @@ static const uint8_t LED_BUILTIN = 38;
#define RGB_BRIGHTNESS 64 #define RGB_BRIGHTNESS 64
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) #define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) #define digitalPinToInterrupt(p) (((p)<49)?(p):-1)
#define digitalPinHasPWM(p) (p < 46) #define digitalPinHasPWM(p) (p < 46)
static const uint8_t TX = 43; static const uint8_t TX = 43;
......
...@@ -22,7 +22,7 @@ static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + 48; ...@@ -22,7 +22,7 @@ static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + 48;
#define analogInputToDigitalPin(p) \ #define analogInputToDigitalPin(p) \
(((p) < 20) ? (analogChannelToDigitalPin(p)) : -1) (((p) < 20) ? (analogChannelToDigitalPin(p)) : -1)
#define digitalPinToInterrupt(p) (((p) < 48) ? (p) : -1) #define digitalPinToInterrupt(p) (((p) < 49) ? (p) : -1)
#define digitalPinHasPWM(p) (p < 46) #define digitalPinHasPWM(p) (p < 46)
static const uint8_t TX = 43; static const uint8_t TX = 43;
......
...@@ -22,7 +22,7 @@ static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + 48; ...@@ -22,7 +22,7 @@ static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + 48;
#define analogInputToDigitalPin(p) \ #define analogInputToDigitalPin(p) \
(((p) < 20) ? (analogChannelToDigitalPin(p)) : -1) (((p) < 20) ? (analogChannelToDigitalPin(p)) : -1)
#define digitalPinToInterrupt(p) (((p) < 48) ? (p) : -1) #define digitalPinToInterrupt(p) (((p) < 49) ? (p) : -1)
#define digitalPinHasPWM(p) (p < 46) #define digitalPinHasPWM(p) (p < 46)
static const uint8_t TX = 43; static const uint8_t TX = 43;
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#define analogInputToDigitalPin(p) \ #define analogInputToDigitalPin(p) \
(((p) < 20) ? (analogChannelToDigitalPin(p)) : -1) (((p) < 20) ? (analogChannelToDigitalPin(p)) : -1)
#define digitalPinToInterrupt(p) (((p) < 48) ? (p) : -1) #define digitalPinToInterrupt(p) (((p) < 49) ? (p) : -1)
#define digitalPinHasPWM(p) (p < 46) #define digitalPinHasPWM(p) (p < 46)
static const uint8_t TX = 43; static const uint8_t TX = 43;
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#define NUM_ANALOG_INPUTS 20 #define NUM_ANALOG_INPUTS 20
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) #define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) #define digitalPinToInterrupt(p) (((p)<49)?(p):-1)
#define digitalPinHasPWM(p) (p < 46) #define digitalPinHasPWM(p) (p < 46)
// The pin assignments in this file are based on u-blox EVK-NORA-W1, a Arduino compatible board. // The pin assignments in this file are based on u-blox EVK-NORA-W1, a Arduino compatible board.
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#define NUM_ANALOG_INPUTS 20 #define NUM_ANALOG_INPUTS 20
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) #define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) #define digitalPinToInterrupt(p) (((p)<49)?(p):-1)
#define digitalPinHasPWM(p) (p < 46) #define digitalPinHasPWM(p) (p < 46)
static const uint8_t LED_BUILTIN = 3; static const uint8_t LED_BUILTIN = 3;
......
...@@ -21,7 +21,7 @@ static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+48; ...@@ -21,7 +21,7 @@ static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+48;
#define RGB_BRIGHTNESS 64 #define RGB_BRIGHTNESS 64
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) #define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) #define digitalPinToInterrupt(p) (((p)<49)?(p):-1)
#define digitalPinHasPWM(p) (p < 46) #define digitalPinHasPWM(p) (p < 46)
static const uint8_t TX = 43; static const uint8_t TX = 43;
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#define NUM_ANALOG_INPUTS 13 #define NUM_ANALOG_INPUTS 13
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) #define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) #define digitalPinToInterrupt(p) (((p)<49)?(p):-1)
#define digitalPinHasPWM(p) (p < 46) #define digitalPinHasPWM(p) (p < 46)
static const uint8_t TX = 43; static const uint8_t TX = 43;
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#define NUM_ANALOG_INPUTS 9 #define NUM_ANALOG_INPUTS 9
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) #define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) #define digitalPinToInterrupt(p) (((p)<49)?(p):-1)
#define digitalPinHasPWM(p) (p < 46) #define digitalPinHasPWM(p) (p < 46)
static const uint8_t TX = 43; static const uint8_t TX = 43;
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#define NUM_ANALOG_INPUTS 14 #define NUM_ANALOG_INPUTS 14
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) #define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) #define digitalPinToInterrupt(p) (((p)<49)?(p):-1)
#define digitalPinHasPWM(p) (p < 46) #define digitalPinHasPWM(p) (p < 46)
static const uint8_t TX = 43; static const uint8_t TX = 43;
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#define NUM_ANALOG_INPUTS 9 #define NUM_ANALOG_INPUTS 9
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) #define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) #define digitalPinToInterrupt(p) (((p)<49)?(p):-1)
#define digitalPinHasPWM(p) (p < 46) #define digitalPinHasPWM(p) (p < 46)
static const uint8_t TX = 43; static const uint8_t TX = 43;
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#define NUM_ANALOG_INPUTS 20 #define NUM_ANALOG_INPUTS 20
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) #define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) #define digitalPinToInterrupt(p) (((p)<49)?(p):-1)
#define digitalPinHasPWM(p) (p < 46) #define digitalPinHasPWM(p) (p < 46)
#define LED_BUILTIN 13 #define LED_BUILTIN 13
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#define NUM_ANALOG_INPUTS 20 #define NUM_ANALOG_INPUTS 20
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) #define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) #define digitalPinToInterrupt(p) (((p)<49)?(p):-1)
#define digitalPinHasPWM(p) (p < 46) #define digitalPinHasPWM(p) (p < 46)
#define LED_BUILTIN 13 #define LED_BUILTIN 13
......
...@@ -21,7 +21,7 @@ static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+48; ...@@ -21,7 +21,7 @@ static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+48;
#define LED_BRIGHTNESS 64 #define LED_BRIGHTNESS 64
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) #define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) #define digitalPinToInterrupt(p) (((p)<49)?(p):-1)
#define digitalPinHasPWM(p) (p < 46) #define digitalPinHasPWM(p) (p < 46)
static const uint8_t TX = 45; static const uint8_t TX = 45;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment