Skip to content

STM32 update #440

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
Dec 20, 2019
Merged
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
12 changes: 11 additions & 1 deletion Boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -854,18 +854,28 @@ writePort(port, value, bitmask): Write an 8 bit port.
#define TOTAL_ANALOG_PINS NUM_ANALOG_INPUTS
#define TOTAL_PINS NUM_DIGITAL_PINS
#define TOTAL_PORTS MAX_NB_PORT
#ifdef LED_BUILTIN
#define VERSION_BLINK_PIN LED_BUILTIN
#endif
// PIN_SERIALY_RX/TX defined in the variant.h
#define IS_PIN_DIGITAL(p) (digitalPinIsValid(p) && !pinIsSerial(p))
#if !defined(STM32_CORE_VERSION) || (STM32_CORE_VERSION <= 0x01080000)
#define IS_PIN_ANALOG(p) ((p >= A0) && (p < (A0 + TOTAL_ANALOG_PINS)) && !pinIsSerial(p))
#else
#define IS_PIN_ANALOG(p) (pinIsAnalogInput(p) && !pinIsSerial(p))
#endif
#define IS_PIN_PWM(p) (IS_PIN_DIGITAL(p) && digitalPinHasPWM(p))
#define IS_PIN_SERVO(p) IS_PIN_DIGITAL(p)
#define IS_PIN_SERVO(p) (IS_PIN_DIGITAL(p))
#define IS_PIN_I2C(p) (IS_PIN_DIGITAL(p) && digitalPinHasI2C(p))
#define IS_PIN_SPI(p) (IS_PIN_DIGITAL(p) && digitalPinHasSPI(p))
#define IS_PIN_INTERRUPT(p) (IS_PIN_DIGITAL(p) && (digitalPinToInterrupt(p) > NOT_AN_INTERRUPT)))
#define IS_PIN_SERIAL(p) (digitalPinHasSerial(p) && !pinIsSerial(p))
#define PIN_TO_DIGITAL(p) (p)
#if !defined(STM32_CORE_VERSION) || (STM32_CORE_VERSION <= 0x01080000)
#define PIN_TO_ANALOG(p) (p-A0)
#else
#define PIN_TO_ANALOG(p) (digitalPinToAnalogInput(p))
#endif
#define PIN_TO_PWM(p) (p)
#define PIN_TO_SERVO(p) (p)
#define DEFAULT_PWM_RESOLUTION PWM_RESOLUTION
Expand Down