Skip to content

Commit b9a9acb

Browse files
committed
fix(build): More occurrences of SOC_UART_HP_NUM
1 parent a76a7a0 commit b9a9acb

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

cores/esp32/HardwareSerial.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ typedef enum {
146146

147147
// Default pins for UART1 are arbitrary, and defined here for convenience.
148148

149-
#if SOC_UART_NUM > 1
149+
#if SOC_UART_HP_NUM > 1
150150
#ifndef RX1
151151
#if CONFIG_IDF_TARGET_ESP32
152152
#define RX1 (gpio_num_t)26
@@ -182,11 +182,11 @@ typedef enum {
182182
#define TX1 (gpio_num_t)1
183183
#endif
184184
#endif
185-
#endif /* SOC_UART_NUM > 1 */
185+
#endif /* SOC_UART_HP_NUM > 1 */
186186

187187
// Default pins for UART2 are arbitrary, and defined here for convenience.
188188

189-
#if SOC_UART_NUM > 2
189+
#if SOC_UART_HP_NUM > 2
190190
#ifndef RX2
191191
#if CONFIG_IDF_TARGET_ESP32
192192
#define RX2 (gpio_num_t)4
@@ -202,7 +202,7 @@ typedef enum {
202202
#define TX2 (gpio_num_t)20
203203
#endif
204204
#endif
205-
#endif /* SOC_UART_NUM > 2 */
205+
#endif /* SOC_UART_HP_NUM > 2 */
206206

207207
typedef std::function<void(void)> OnReceiveCb;
208208
typedef std::function<void(hardwareSerial_error_t)> OnReceiveErrorCb;
@@ -357,10 +357,10 @@ extern void serialEventRun(void) __attribute__((weak));
357357
#endif // ARDUINO_USB_CDC_ON_BOOT
358358
// There is always Seria0 for UART0
359359
extern HardwareSerial Serial0;
360-
#if SOC_UART_NUM > 1
360+
#if SOC_UART_HP_NUM > 1
361361
extern HardwareSerial Serial1;
362362
#endif
363-
#if SOC_UART_NUM > 2
363+
#if SOC_UART_HP_NUM > 2
364364
extern HardwareSerial Serial2;
365365
#endif
366366
#endif //!defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_SERIAL)

libraries/ESP32/examples/Serial/Serial_STD_Func_OnReceive/Serial_STD_Func_OnReceive.ino

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/
1212

1313
// soc/soc_caps.h has information about each SoC target
14-
// in this example, we use SOC_UART_NUM that goes from 1 to 3,
14+
// in this example, we use SOC_UART_HP_NUM that goes from 1 to 3,
1515
// depending on the number of available UARTs in the ESP32xx
1616
// This makes the code transparent to what SoC is used.
1717
#include "soc/soc_caps.h"
@@ -24,9 +24,9 @@
2424
#define TXPIN 5 // GPIO 5 => TX for Serial1 or Serial2
2525

2626
// declare testingSerial (as reference) related to TEST_UART number defined above (only for Serial1 and Serial2)
27-
#if SOC_UART_NUM > 1 && TEST_UART == 1
27+
#if SOC_UART_HP_NUM > 1 && TEST_UART == 1
2828
HardwareSerial &testingSerial = Serial1;
29-
#elif SOC_UART_NUM > 2 && TEST_UART == 2
29+
#elif SOC_UART_HP_NUM > 2 && TEST_UART == 2
3030
HardwareSerial &testingSerial = Serial2;
3131
#endif
3232

@@ -36,11 +36,11 @@ void processOnReceiving(HardwareSerial &mySerial) {
3636
int8_t uart_num = -1;
3737
if (&mySerial == &Serial0) {
3838
uart_num = 0;
39-
#if SOC_UART_NUM > 1
39+
#if SOC_UART_HP_NUM > 1
4040
} else if (&mySerial == &Serial1) {
4141
uart_num = 1;
4242
#endif
43-
#if SOC_UART_NUM > 2
43+
#if SOC_UART_HP_NUM > 2
4444
} else if (&mySerial == &Serial2) {
4545
uart_num = 2;
4646
#endif

0 commit comments

Comments
 (0)