STM32F1: Restore M43 build support (#17336)

This commit is contained in:
Tanguy Pruvot 2020-03-31 21:13:20 +02:00 committed by GitHub
parent ac0a7f2281
commit c759729478
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -67,7 +67,11 @@ inline void toggle_pins() {
else { else {
watchdog_refresh(); watchdog_refresh();
report_pin_state_extended(pin, ignore_protection, true, PSTR("Pulsing ")); report_pin_state_extended(pin, ignore_protection, true, PSTR("Pulsing "));
const bool prior_mode = GET_PINMODE(pin); #ifdef __STM32F1__
const auto prior_mode = _GET_MODE(i);
#else
const bool prior_mode = GET_PINMODE(pin);
#endif
#if AVR_AT90USB1286_FAMILY // Teensy IDEs don't know about these pins so must use FASTIO #if AVR_AT90USB1286_FAMILY // Teensy IDEs don't know about these pins so must use FASTIO
if (pin == TEENSY_E2) { if (pin == TEENSY_E2) {
SET_OUTPUT(TEENSY_E2); SET_OUTPUT(TEENSY_E2);
@ -96,7 +100,11 @@ inline void toggle_pins() {
watchdog_refresh(); watchdog_refresh();
} }
} }
pinMode(pin, prior_mode); #ifdef __STM32F1__
_SET_MODE(i, prior_mode);
#else
pinMode(pin, prior_mode);
#endif
} }
SERIAL_EOL(); SERIAL_EOL();
} }