소스 검색

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…
취소
저장