Browse Source

Fix "spontaneous heating" issue (WRITE bug) on STM32 (#13356)

Should fix "spontanous heating" problems due to order of operations error. Error occurs at least with ststm32 v5.1.0 in PlatformIO.
pull/1/head
pinchies 6 years ago
committed by Scott Lahteine
parent
commit
4c43e6c48b
  1. 2
      Marlin/src/HAL/HAL_STM32F1/fastio_STM32F1.h

2
Marlin/src/HAL/HAL_STM32F1/fastio_STM32F1.h

@ -30,7 +30,7 @@
#include <libmaple/gpio.h>
#define READ(IO) (PIN_MAP[IO].gpio_device->regs->IDR & (1U << PIN_MAP[IO].gpio_bit) ? HIGH : LOW)
#define WRITE(IO,V) (PIN_MAP[IO].gpio_device->regs->BSRR = (1U << PIN_MAP[IO].gpio_bit) << (16 * !(bool)V))
#define WRITE(IO,V) (PIN_MAP[IO].gpio_device->regs->BSRR = (1U << PIN_MAP[IO].gpio_bit) << (16 * !((bool)V)))
#define TOGGLE(IO) (PIN_MAP[IO].gpio_device->regs->ODR = PIN_MAP[IO].gpio_device->regs->ODR ^ (1U << PIN_MAP[IO].gpio_bit))
#define WRITE_VAR(IO,V) WRITE(IO,V)

Loading…
Cancel
Save