File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ extern const uint8_t PROGMEM digital_pin_to_interrupt[];
9292#define analogPinToBitMask (pin ) ( (pin < NUM_ANALOG_INPUTS) ? (1 << analogPinToBitPosition(pin)) : NOT_A_PIN )
9393#define digitalPinToTimer (pin ) ( (pin < NUM_TOTAL_PINS) ? pgm_read_byte(digital_pin_to_timer + pin) : NOT_ON_TIMER )
9494
95- #define portToPortStruct (port ) ( (port < NOT_A_PORT ) ? ((PORT_t *)&PORTA + port) : NULL)
95+ #define portToPortStruct (port ) ( (port < NUMBER_OF_PORTS ) ? ((PORT_t *)&PORTA + port) : NULL)
9696#define digitalPinToPortStruct (pin ) ( (pin < NUM_TOTAL_PINS) ? ((PORT_t *)&PORTA + digitalPinToPort(pin)) : NULL)
9797#define getPINnCTRLregister (port , bit_pos ) ( ((port != NULL) && (bit_pos < NOT_A_PIN)) ? ((uint8_t *)&(port->PIN0CTRL) + bit_pos) : NULL )
9898
@@ -109,6 +109,7 @@ extern const uint8_t PROGMEM digital_pin_to_interrupt[];
109109#define PD 3
110110#define PE 4
111111#define PF 5
112+ #define NUMBER_OF_PORTS 6
112113
113114#define NOT_ON_TIMER 0
114115#define TIMERA0 1
You can’t perform that action at this time.
0 commit comments