Skip to content

Commit 651a14c

Browse files
authoredMar 18, 2024
backport: variants from 3.0.0 + fixes (espressif#9381)
* feat: backport variants from 3.0.0 * heltec update from espressif#9367

File tree

221 files changed

+658
-1975
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

221 files changed

+658
-1975
lines changed
 

‎boards.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23471,7 +23471,7 @@ unphone8.build.partitions=default_8MB
2347123471
unphone8.build.defines=-DBOARD_HAS_PSRAM -DUNPHONE_SPIN=8
2347223472
unphone8.build.loop_core=-DARDUINO_RUNNING_CORE=1
2347323473
unphone8.build.event_core=-DARDUINO_EVENT_RUNNING_CORE=1
23474-
unphone8.build.flash_type=qspi
23474+
unphone8.build.flash_type=qio
2347523475
unphone8.build.psram_type=qspi
2347623476
unphone8.build.memory_type={build.flash_type}_{build.psram_type}
2347723477

‎cores/esp32/Arduino.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,18 @@
129129
#define NOT_AN_INTERRUPT -1
130130
#define NOT_ON_TIMER 0
131131

132+
// some defines generic for all SoC moved from variants/board_name/pins_arduino.h
133+
#define NUM_DIGITAL_PINS SOC_GPIO_PIN_COUNT // All GPIOs
134+
#if SOC_ADC_PERIPH_NUM == 1
135+
#define NUM_ANALOG_INPUTS (SOC_ADC_CHANNEL_NUM(0))
136+
#elif SOC_ADC_PERIPH_NUM == 2
137+
#define NUM_ANALOG_INPUTS (SOC_ADC_CHANNEL_NUM(0)+SOC_ADC_CHANNEL_NUM(1))
138+
#endif
139+
#define EXTERNAL_NUM_INTERRUPTS NUM_DIGITAL_PINS // All GPIOs
140+
#define analogInputToDigitalPin(p) (((p)<NUM_ANALOG_INPUTS)?(analogChannelToDigitalPin(p)):-1)
141+
#define digitalPinToInterrupt(p) ((((uint8_t)digitalPinToGPIONumber(p))<NUM_DIGITAL_PINS)?digitalPinToGPIONumber(p):NOT_AN_INTERRUPT)
142+
#define digitalPinHasPWM(p) (((uint8_t)digitalPinToGPIONumber(p))<NUM_DIGITAL_PINS)
143+
132144
typedef bool boolean;
133145
typedef uint8_t byte;
134146
typedef unsigned int word;

0 commit comments

Comments
 (0)
Please sign in to comment.