File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -51,15 +51,15 @@ void FastIO_init(); // Must be called before using fast io macros
5151
5252#if defined(STM32F0xx ) || defined(STM32F1xx ) || defined(STM32F3xx ) || defined(STM32L0xx ) || defined(STM32L4xx )
5353 #define _WRITE (IO , V ) do { \
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 ) ; \
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]) ) ; \
5656 }while(0)
5757#else
58- #define _WRITE (IO , V ) (FastIOPortMap[STM_PORT(digitalPin[IO])]->BSRR = _BV32(digitalPinToPinName(IO ) + ((V) ? 0 : 16)))
58+ #define _WRITE (IO , V ) (FastIOPortMap[STM_PORT(digitalPin[IO])]->BSRR = _BV32(STM_PIN(digitalPin[IO] ) + ((V) ? 0 : 16)))
5959#endif
6060
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 ))
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]) ))
6363
6464#define _GET_MODE (IO )
6565#define _SET_MODE (IO ,M ) pinMode(IO, M)
You can’t perform that action at this time.
0 commit comments