File tree Expand file tree Collapse file tree 4 files changed +5
-59
lines changed
Expand file tree Collapse file tree 4 files changed +5
-59
lines changed Original file line number Diff line number Diff line change @@ -90,8 +90,6 @@ extern const uint8_t PROGMEM digital_pin_to_port[];
9090extern const uint8_t PROGMEM digital_pin_to_bit_mask [];
9191extern const uint8_t PROGMEM digital_pin_to_bit_position [];
9292extern const uint8_t PROGMEM digital_pin_to_timer [];
93- extern const uint8_t PROGMEM port_interrupt_offset [];
94- extern const uint8_t PROGMEM digital_pin_to_interrupt [];
9593
9694// Get the bit location within the hardware port of the given virtual pin.
9795// This comes from the pins_*.c file for the active board configuration.
@@ -132,8 +130,7 @@ bool isDoubleBondedActive(uint8_t pin);
132130#define portToPortStruct (port ) ( (port < NUM_TOTAL_PORTS) ? ((PORT_t *)&PORTA + port) : NULL)
133131#define digitalPinToPortStruct (pin ) ( (pin < NUM_TOTAL_PINS) ? ((PORT_t *)&PORTA + digitalPinToPort(pin)) : NULL)
134132#define getPINnCTRLregister (port , bit_pos ) ( ((port != NULL) && (bit_pos < NOT_A_PIN)) ? ((uint8_t *)&(port->PIN0CTRL) + bit_pos) : NULL )
135- #define digitalPinToInterrupt (p ) ( pgm_read_byte(digital_pin_to_interrupt + p) )
136- #define portPinToInterrupt (port , bit_pos ) ( pgm_read_byte(port_interrupt_offset + port) + bit_pos )
133+ #define digitalPinToInterrupt (p ) ( digitalPinToPort(p) * 8 + digitalPinToBitPosition(p) )
137134
138135#ifdef __cplusplus
139136} // extern "C"
Original file line number Diff line number Diff line change @@ -121,7 +121,7 @@ static void port_interrupt_handler(uint8_t port) {
121121 if (int_flags & bit_mask ){
122122
123123 /* Get interrupt */
124- uint8_t interrupt_num = portPinToInterrupt ( port , bit_pos ) ;
124+ uint8_t interrupt_num = port * 8 + bit_pos ;
125125
126126 /* Check if function defined */
127127 if (intFunc [interrupt_num ] != 0 ){
Original file line number Diff line number Diff line change 2626#include "wiring_private.h"
2727#include "pins_arduino.h"
2828
29- __attribute__((weak )) bool isDoubleBondedActive (uint8_t pin ) {};
29+ __attribute__((weak )) bool isDoubleBondedActive (uint8_t pin __attribute__((unused ))) {
30+ return false;
31+ };
3032
3133void pinMode (uint8_t pin , PinMode mode )
3234{
Original file line number Diff line number Diff line change @@ -160,59 +160,6 @@ static const uint8_t A7 = PIN_A7;
160160// (10~*) (1) (0) (4) (A0) (A1) (A2) (A3) (A4)
161161//
162162
163- const uint8_t PROGMEM digital_pin_to_interrupt [] = {
164- 19 , //0 USART1_Rx PC5
165- 18 , //1 USART1_Tx PC4
166- 0 , //2 PA0
167- 39 , //3 PF5
168- 20 , //4 PC6
169- 10 , //5 PB2
170- 38 , //6 PF4
171- 1 , //7 PA1
172- 33 , //8 PE3
173- 8 , //9 PB0
174- 9 , //10 PB1
175- 14 , //11 PC0
176- 15 , //12 PC1
177- 16 , //13 PC2
178- 22 , //14 AI0 PD0
179- 23 , //15 AI1 PD1
180- 24 , //16 AI2 PD2
181- 25 , //17 AI3 PD3
182- 26 , //18 AI4 PD4
183- 27 , //19 AI5 PD5
184- 2 , //20 TWI_SDA PA2
185- 3 , //21 TWI_SCL PA3
186- 17 , //22 SPI SS PC3
187- 5 , //23 USART0_Rx PA5
188- 4 , //24 USART0_Tx PA4
189- 28 , //25 LED_BUILTIN PD6
190- 13 , //26 USART3_Rx PB5
191- 12 , //27 USART3_Tx PB4
192- 6 , // 28 PA6
193- 7 , // 29 PA7
194- 11 , // 30 PB3
195- 21 , // 31 PC7
196- 30 , // 32 PE0
197- 31 , // 33 PE1
198- 32 , // 34 PE2
199- 36 , // 35 PF2
200- 37 , // 36 PF3
201- 34 , // 37 PF0 TOSC 1
202- 35 , // 38 PF1 TOSC 2
203- 29 , // 39 PD7 VREF
204- 40 // 40 PF6 RESET
205- };
206-
207- const uint8_t PROGMEM port_interrupt_offset [] = {
208- 0 , //PA
209- 8 , //PB
210- 14 , //PC
211- 22 , //PD
212- 30 , //PE
213- 34 , //PF
214- };
215-
216163const uint8_t PROGMEM digital_pin_to_port [] = {
217164 PC , //0 USART1_Rx PC5
218165 PC , //1 USART1_Tx PC4
You can’t perform that action at this time.
0 commit comments