Skip to content

Pin name PXn could be used instead of Dx #83

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions cores/arduino/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,20 @@ extern "C" {
#endif

#define NOT_AN_INTERRUPT NC // -1

#define DEND PEND
#define NUM_DIGITAL_PINS DEND
#define NUM_ANALOG_INPUTS (AEND-A0)

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

// Convert an analog pin number to a digital pin number
// Used by analogRead api to have A0 == 0
#define analogInputToDigitalPin(p) ((p < NUM_ANALOG_INPUTS) ? (p+A0) : p)
// Convert an analog pin number Axx to a PinName Pxy
// Convert an analog pin number Axx to a PinName PX_n
#define analogInputToPinName(p) (digitalPinToPinName(analogInputToDigitalPin(p)))
// All pins could manage EXTI
#define digitalPinToInterrupt(p) (digitalPinIsValid(p) ? p : NOT_AN_INTERRUPT)
Expand Down
4 changes: 2 additions & 2 deletions cores/arduino/stm32/PinAF_STM32F1.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ static inline void pinF1_DisconnectDebug(PinName pin)

// Disconnect JTAG-DP + SW-DP signals.
// Warning: Need to reconnect under reset
if ((pin == PA13) || (pin == PA14)) {
if ((pin == PA_13) || (pin == PA_14)) {
__HAL_AFIO_REMAP_SWJ_DISABLE(); // JTAG-DP Disabled and SW-DP Disabled
}
if ((pin == PA15) || (pin == PB3) || (pin == PB4)) {
if ((pin == PA_15) || (pin == PB_3) || (pin == PB_4)) {
__HAL_AFIO_REMAP_SWJ_NOJTAG(); // JTAG-DP Disabled and SW-DP enabled
}
#endif /* STM32F1_FORCE_DEBUG */
Expand Down
Loading