瀏覽代碼

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.
pinchies 5 年之前
父節點
當前提交
4c43e6c48b
共有 1 個檔案被更改,包括 1 行新增1 行删除
  1. 1
    1
      Marlin/src/HAL/HAL_STM32F1/fastio_STM32F1.h

+ 1
- 1
Marlin/src/HAL/HAL_STM32F1/fastio_STM32F1.h 查看文件

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

Loading…
取消
儲存