Преглед изворни кода

Fixes for TFTGLCD Panel, FastIO (#19614)

Serhiy-K пре 3 година
родитељ
комит
bd196e7efc
1 измењених фајлова са 5 додато и 5 уклоњено
  1. 5
    5
      Marlin/src/HAL/STM32/fastio.h

+ 5
- 5
Marlin/src/HAL/STM32/fastio.h Прегледај датотеку

51
 
51
 
52
 #if defined(STM32F0xx) || defined(STM32F1xx) || defined(STM32F3xx) || defined(STM32L0xx) || defined(STM32L4xx)
52
 #if defined(STM32F0xx) || defined(STM32F1xx) || defined(STM32F3xx) || defined(STM32L0xx) || defined(STM32L4xx)
53
   #define _WRITE(IO, V) do { \
53
   #define _WRITE(IO, V) do { \
54
-    if (V) FastIOPortMap[STM_PORT(digitalPin[IO])]->BSRR = _BV32(STM_PIN(digitalPin[IO])) ; \
55
-    else   FastIOPortMap[STM_PORT(digitalPin[IO])]->BRR  = _BV32(STM_PIN(digitalPin[IO])) ; \
54
+    if (V) FastIOPortMap[STM_PORT(digitalPin[IO])]->BSRR = _BV32(digitalPinToPinName(IO) & 0x1F) ; \
55
+    else   FastIOPortMap[STM_PORT(digitalPin[IO])]->BRR  = _BV32(digitalPinToPinName(IO) & 0x1F) ; \
56
   }while(0)
56
   }while(0)
57
 #else
57
 #else
58
-  #define _WRITE(IO, V) (FastIOPortMap[STM_PORT(digitalPin[IO])]->BSRR = _BV32(STM_PIN(digitalPin[IO]) + ((V) ? 0 : 16)))
58
+  #define _WRITE(IO, V) (FastIOPortMap[STM_PORT(digitalPin[IO])]->BSRR = _BV32(digitalPinToPinName(IO) + ((V) ? 0 : 16)))
59
 #endif
59
 #endif
60
 
60
 
61
-#define _READ(IO)               bool(READ_BIT(FastIOPortMap[STM_PORT(digitalPin[IO])]->IDR, _BV32(STM_PIN(digitalPin[IO]))))
62
-#define _TOGGLE(IO)             (FastIOPortMap[STM_PORT(digitalPin[IO])]->ODR ^= _BV32(STM_PIN(digitalPin[IO])))
61
+#define _READ(IO)               bool(READ_BIT(FastIOPortMap[STM_PORT(digitalPin[IO])]->IDR, _BV32(digitalPinToPinName(IO) & 0x1F)))
62
+#define _TOGGLE(IO)             (FastIOPortMap[STM_PORT(digitalPin[IO])]->ODR ^= _BV32(digitalPinToPinName(IO) & 0x1F))
63
 
63
 
64
 #define _GET_MODE(IO)
64
 #define _GET_MODE(IO)
65
 #define _SET_MODE(IO,M)         pinMode(IO, M)
65
 #define _SET_MODE(IO,M)         pinMode(IO, M)

Loading…
Откажи
Сачувај