8000 work around missing SOC_GPIO_PIN_COUNT, MHZ · summivox/arduino-esp32@0554771 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0554771

Browse files
author
summivox
committed
work around missing SOC_GPIO_PIN_COUNT, MHZ
1 parent 7d3f499 commit 0554771

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

cores/esp32/esp32-hal-cpu.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ extern "C" {
2323
#include <stdbool.h>
2424
#include <stdlib.h>
2525

26+
#ifndef MHZ
27+
#define MHZ (1000000)
28+
#endif // MHZ
29+
2630
typedef enum { APB_BEFORE_CHANGE, APB_AFTER_CHANGE } apb_change_ev_t;
2731

2832
typedef void (* apb_change_cb_t)(void * arg, apb_change_ev_t ev_type, uint32_t old_apb, uint32_t new_apb);

cores/esp32/esp32-hal-gpio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const int8_t esp32_adc2gpio[20] = {36, 37, 38, 39, 32, 33, 34, 35, -1, -1, 4, 0,
5050
const int8_t esp32_adc2gpio[20] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20};
5151
#endif
5252

53-
const DRAM_ATTR esp32_gpioMux_t esp32_gpioMux[SOC_GPIO_PIN_COUNT]={
53+
const DRAM_ATTR esp32_gpioMux_t esp32_gpioMux[GPIO_PIN_COUNT]={
5454
#if CONFIG_IDF_TARGET_ESP32
5555
{0x44, 11, 11, 1},
5656
{0x88, -1, -1, -1},
@@ -151,7 +151,7 @@ typedef struct {
151151
void* arg;
152152
bool functional;
153153
} InterruptHandle_t;
154-
static InterruptHandle_t __pinInterruptHandlers[SOC_GPIO_PIN_COUNT] = {0,};
154+
static InterruptHandle_t __pinInterruptHandlers[GPIO_PIN_COUNT] = {0,};
155155

156156
#include "driver/rtc_io.h"
157157

cores/esp32/esp32-hal-gpio.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,14 @@ typedef struct {
7575
int8_t touch; /*!< Touch Channel number (-1 if not Touch pin) */
7676
} esp32_gpioMux_t;
7777

78-
extern const esp32_gpioMux_t esp32_gpioMux[SOC_GPIO_PIN_COUNT];
78+
extern const esp32_gpioMux_t esp32_gpioMux[GPIO_PIN_COUNT];
7979
extern const int8_t esp32_adc2gpio[20];
8080

81-
#define digitalPinIsValid(pin) ((pin) < SOC_GPIO_PIN_COUNT && esp32_gpioMux[(pin)].reg)
81+
#define digitalPinIsValid(pin) ((pin) < GPIO_PIN_COUNT && esp32_gpioMux[(pin)].reg)
8282
#define digitalPinCanOutput(pin) ((pin) < NUM_OUPUT_PINS && esp32_gpioMux[(pin)].reg)
83-
#define digitalPinToRtcPin(pin) (((pin) < SOC_GPIO_PIN_COUNT)?esp32_gpioMux[(pin)].rtc:-1)
84-
#define digitalPinToAnalogChannel(pin) (((pin) < SOC_GPIO_PIN_COUNT)?esp32_gpioMux[(pin)].adc:-1)
85-
#define digitalPinToTouchChannel(pin) (((pin) < SOC_GPIO_PIN_COUNT)?esp32_gpioMux[(pin)].touch:-1)
83+
#define digitalPinToRtcPin(pin) (((pin) < GPIO_PIN_COUNT)?esp32_gpioMux[(pin)].rtc:-1)
84+
#define digitalPinToAnalogChannel(pin) (((pin) < GPIO_PIN_COUNT)?esp32_gpioMux[(pin)].adc:-1)
85+
#define digitalPinToTouchChannel(pin) (((pin) < GPIO_PIN_COUNT)?esp32_gpioMux[(pin)].touch:-1)
8686
#define digitalPinToDacChannel(pin) (((pin) == PIN_DAC1)?0:((pin) == PIN_DAC2)?1:-1)
8787

8888
void pinMode(uint8_t pin, uint8_t mode);

0 commit comments

Comments
 (0)
0