Skip to content

Commit 9a14221

Browse files
committed
Move analog_pin_to_channel to main Arduino.h
1 parent 04fbbd0 commit 9a14221

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

Diff for: cores/arduino/Arduino.h

+8
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ extern const uint8_t digital_pin_to_port[];
9090
extern const uint8_t digital_pin_to_bit_mask[];
9191
extern const uint8_t digital_pin_to_bit_position[];
9292
extern const uint8_t digital_pin_to_timer[];
93+
extern const uint8_t analog_pin_to_channel[];
9394

9495
// Get the bit location within the hardware port of the given virtual pin.
9596
// This comes from the pins_*.c file for the active board configuration.
@@ -155,5 +156,12 @@ bool isDoubleBondedActive(uint8_t pin);
155156

156157
#endif
157158

159+
#ifdef __cplusplus
160+
extern "C" {
161+
#endif
158162
#include "pins_arduino.h"
163+
#ifdef __cplusplus
164+
} // extern "C"
165+
#endif
166+
159167
#endif

Diff for: cores/arduino/wiring_analog.c

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
*/
2424

2525
#include "wiring_private.h"
26-
#include "pins_arduino.h"
2726
#include "Arduino.h"
2827

2928
uint8_t analog_reference = DEFAULT;

Diff for: variants/nona4809/pins_arduino.h

-1
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,6 @@ const uint8_t analog_pin_to_channel[] = {
273273

274274
#endif
275275

276-
extern const uint8_t analog_pin_to_channel[];
277276
#define digitalPinToAnalogInput(p) ((p < ANALOG_INPUT_OFFSET) ? analog_pin_to_channel[p] : analog_pin_to_channel[p - ANALOG_INPUT_OFFSET] )
278277

279278
// These serial port names are intended to allow libraries and architecture-neutral

0 commit comments

Comments
 (0)