Skip to content

Commit ee314f2

Browse files
committed
fix portInput(Output, Mode)Register definitions to return pointers (#1110)
1 parent c6c7d24 commit ee314f2

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

cores/esp8266/Arduino.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -219,14 +219,12 @@ void loop(void);
219219
void yield(void);
220220
void optimistic_yield(uint32_t interval_us);
221221

222-
// Get the bit location within the hardware port of the given virtual pin.
223-
// This comes from the pins_*.c file for the active board configuration.
224222
#define digitalPinToPort(pin) (0)
225223
#define digitalPinToBitMask(pin) (1UL << (pin))
226224
#define digitalPinToTimer(pin) (0)
227-
#define portOutputRegister(port) ((volatile uint32_t*) GPO)
228-
#define portInputRegister(port) ((volatile uint32_t*) GPI)
229-
#define portModeRegister(port) ((volatile uint32_t*) GPE)
225+
#define portOutputRegister(port) ((volatile uint32_t*) &GPO)
226+
#define portInputRegister(port) ((volatile uint32_t*) &GPI)
227+
#define portModeRegister(port) ((volatile uint32_t*) &GPE)
230228

231229
#define NOT_A_PIN -1
232230
#define NOT_A_PORT -1

0 commit comments

Comments
 (0)