Skip to content

Commit 8433db3

Browse files
authored
Merge pull request #83 from fpistm/pinnaming
Pin name PXn could be used instead of Dx
2 parents f3f81b6 + 2514e7a commit 8433db3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+4454
-3546
lines changed

Diff for: cores/arduino/pins_arduino.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,20 @@ extern "C" {
3333
#endif
3434

3535
#define NOT_AN_INTERRUPT NC // -1
36-
36+
#define DEND PEND
3737
#define NUM_DIGITAL_PINS DEND
3838
#define NUM_ANALOG_INPUTS (AEND-A0)
3939

40-
// Convert a digital pin number Dxx to a PinName Pxy
40+
// Convert a digital pin number Dxx to a PinName PX_n
4141
// Note: Analog pin is also a digital pin.
4242
#define digitalPinToPinName(p) ((p < NUM_DIGITAL_PINS) ? digitalPin[p] : NC)
43-
// Convert a PinName Pxy to a digital pin number
43+
// Convert a PinName PX_n to a digital pin number
4444
uint32_t pinNametoDigitalPin(PinName p);
4545

4646
// Convert an analog pin number to a digital pin number
4747
// Used by analogRead api to have A0 == 0
4848
#define analogInputToDigitalPin(p) ((p < NUM_ANALOG_INPUTS) ? (p+A0) : p)
49-
// Convert an analog pin number Axx to a PinName Pxy
49+
// Convert an analog pin number Axx to a PinName PX_n
5050
#define analogInputToPinName(p) (digitalPinToPinName(analogInputToDigitalPin(p)))
5151
// All pins could manage EXTI
5252
#define digitalPinToInterrupt(p) (digitalPinIsValid(p) ? p : NOT_AN_INTERRUPT)

Diff for: cores/arduino/stm32/PinAF_STM32F1.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ static inline void pinF1_DisconnectDebug(PinName pin)
5050

5151
// Disconnect JTAG-DP + SW-DP signals.
5252
// Warning: Need to reconnect under reset
53-
if ((pin == PA13) || (pin == PA14)) {
53+
if ((pin == PA_13) || (pin == PA_14)) {
5454
__HAL_AFIO_REMAP_SWJ_DISABLE(); // JTAG-DP Disabled and SW-DP Disabled
5555
}
56-
if ((pin == PA15) || (pin == PB3) || (pin == PB4)) {
56+
if ((pin == PA_15) || (pin == PB_3) || (pin == PB_4)) {
5757
__HAL_AFIO_REMAP_SWJ_NOJTAG(); // JTAG-DP Disabled and SW-DP enabled
5858
}
5959
#endif /* STM32F1_FORCE_DEBUG */

0 commit comments

Comments
 (0)