From 88cb7c8e5d0355762ae7f282373e7317400e5e23 Mon Sep 17 00:00:00 2001 From: Fio Date: Thu, 21 Sep 2023 13:54:50 +0200 Subject: [PATCH] Update pins_arduino.h Corrected analog I/O, BUILTIN_LED and added missing soc/soc_caps.h. Before neopixelWrite() would end up in / RMT GPIO ERROR / set gpio for RMT driver failed / rmtInit(): RMT failed to initilize. => None working onboard RGB LED. --- variants/lolin_s3/pins_arduino.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/variants/lolin_s3/pins_arduino.h b/variants/lolin_s3/pins_arduino.h index 46a168c6b7e..6fa2e396176 100644 --- a/variants/lolin_s3/pins_arduino.h +++ b/variants/lolin_s3/pins_arduino.h @@ -2,6 +2,7 @@ #define Pins_Arduino_h #include +#include "soc/soc_caps.h" #define USB_VID 0x303a #define USB_PID 0x1001 @@ -11,13 +12,13 @@ #define NUM_ANALOG_INPUTS 18 -static const uint8_t LED_BUILTIN = 38; +static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+38; #define BUILTIN_LED LED_BUILTIN // backward compatibility #define LED_BUILTIN LED_BUILTIN #define RGB_BUILTIN LED_BUILTIN #define RGB_BRIGHTNESS 64 -#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) +#define analogInputToDigitalPin(p) (((p)<18)?(analogChannelToDigitalPin(p)):-1) #define digitalPinToInterrupt(p) (((p)<48)?(p):-1) #define digitalPinHasPWM(p) (p < 46)