Skip to content

Commit d64ebc2

Browse files
committed
Fix Arduino.h inclusion in C files
1 parent 93e56ff commit d64ebc2

File tree

7 files changed

+23
-1
lines changed

7 files changed

+23
-1
lines changed

cores/arduino/macros.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
#include <Arduino.h>
2727
#include <PinNames.h>
28-
#include <platform/FileHandle.h>
2928

3029
// this is needed for backwards compatibility
3130
#define digitalPinToInterrupt(P) (P)
@@ -38,6 +37,9 @@
3837

3938
#endif
4039

40+
#ifdef __cplusplus
41+
#include <platform/FileHandle.h>
42+
4143
#define REDIRECT_STDOUT_TO(stream) namespace mbed { \
4244
FileHandle *mbed_override_console(int fd) { \
4345
return static_cast<mbed::FileHandle*>(stream); \
@@ -46,3 +48,5 @@
4648
return static_cast<mbed::FileHandle*>(stream); \
4749
} \
4850
}
51+
52+
#endif //__cplusplus

variants/ARDUINO_NANO33BLE/pinmode_arduino.h

+3
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ typedef enum {
4444
INPUT_PULLDOWN = TempINPUT_PULLDOWN
4545
} PinMode;
4646

47+
#if defined(__cplusplus)
48+
4749
/* Redeclare Common.h functions with the updated PinMode */
4850
void pinMode(pin_size_t pinNumber, PinMode pinMode);
4951

52+
#endif

variants/EDGE_CONTROL/pinmode_arduino.h

+3
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ typedef enum {
4444
INPUT_PULLDOWN = TempINPUT_PULLDOWN
4545
} PinMode;
4646

47+
#if defined(__cplusplus)
48+
4749
/* Redeclare Common.h functions with the updated PinMode */
4850
void pinMode(pin_size_t pinNumber, PinMode pinMode);
4951

52+
#endif

variants/NANO_RP2040_CONNECT/pinmode_arduino.h

+3
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ typedef enum {
6666
INPUT_PULLDOWN = TempINPUT_PULLDOWN
6767
} PinMode;
6868

69+
#if defined(__cplusplus)
70+
6971
/* Redeclare Common.h functions with the updated PinMode */
7072
void pinMode(pin_size_t pinNumber, PinMode pinMode);
7173

74+
#endif

variants/PORTENTA_H7_M4/pinmode_arduino.h

+3
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ typedef enum {
6666
INPUT_PULLDOWN = TempINPUT_PULLDOWN
6767
} PinMode;
6868

69+
#if defined(__cplusplus)
70+
6971
/* Redeclare Common.h functions with the updated PinMode */
7072
void pinMode(pin_size_t pinNumber, PinMode pinMode);
7173

74+
#endif

variants/PORTENTA_H7_M7/pinmode_arduino.h

+3
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ typedef enum {
6666
INPUT_PULLDOWN = TempINPUT_PULLDOWN
6767
} PinMode;
6868

69+
#if defined(__cplusplus)
70+
6971
/* Redeclare Common.h functions with the updated PinMode */
7072
void pinMode(pin_size_t pinNumber, PinMode pinMode);
7173

74+
#endif

variants/RASPBERRY_PI_PICO/pinmode_arduino.h

+3
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ typedef enum {
6666
INPUT_PULLDOWN = TempINPUT_PULLDOWN
6767
} PinMode;
6868

69+
#if defined(__cplusplus)
70+
6971
/* Redeclare Common.h functions with the updated PinMode */
7072
void pinMode(pin_size_t pinNumber, PinMode pinMode);
7173

74+
#endif

0 commit comments

Comments
 (0)