|
51 | 51 | * It contains: |
52 | 52 | * - name of the signal |
53 | 53 | * - the Ard_num assigned by the pins_YOUR_BOARD.h file using the platform defines. |
54 | | - * EXAMPLE: "#define KILL_PIN PB1" results in Ard_num of 57. 57 is then used as an |
55 | | - * index into digitalPin[] to get the Port_pin number |
| 54 | + * EXAMPLE: "#define KILL_PIN PB1" results in Ard_num of 57. 57 is then used as the |
| 55 | + * argument to digitalPinToPinName(IO) to get the Port_pin number |
56 | 56 | * - if it is a digital or analog signal. PWMs are considered digital here. |
57 | 57 | * |
58 | 58 | * pin_xref is a structure generated by this header file. It is generated by the |
|
68 | 68 | * signal. The Arduino pin number is listed by the M43 I command. |
69 | 69 | */ |
70 | 70 |
|
71 | | -extern const PinName digitalPin[]; // provided by the platform |
72 | | - |
73 | 71 | //////////////////////////////////////////////////////// |
74 | 72 | // |
75 | 73 | // make a list of the Arduino pin numbers in the Port/Pin order |
@@ -137,7 +135,7 @@ const XrefInfo pin_xref[] PROGMEM = { |
137 | 135 |
|
138 | 136 | uint8_t get_pin_mode(const pin_t Ard_num) { |
139 | 137 | uint32_t mode_all = 0; |
140 | | - const PinName dp = digitalPin[Ard_num]; |
| 138 | + const PinName dp = digitalPinToPinName(Ard_num); |
141 | 139 | switch (PORT_ALPHA(dp)) { |
142 | 140 | case 'A' : mode_all = GPIOA->MODER; break; |
143 | 141 | case 'B' : mode_all = GPIOB->MODER; break; |
@@ -218,7 +216,7 @@ bool pwm_status(const pin_t Ard_num) { |
218 | 216 | void pwm_details(const pin_t Ard_num) { |
219 | 217 | if (pwm_status(Ard_num)) { |
220 | 218 | uint32_t alt_all = 0; |
221 | | - const PinName dp = digitalPin[Ard_num]; |
| 219 | + const PinName dp = digitalPinToPinName(Ard_num); |
222 | 220 | pin_t pin_number = uint8_t(PIN_NUM(dp)); |
223 | 221 | const bool over_7 = pin_number >= 8; |
224 | 222 | const uint8_t ind = over_7 ? 1 : 0; |
|
0 commit comments