Fix gpio::TogglePin on AVR

TogglePin was incorrectly using the PINx pin for toggling, causing the
current pins (in addition to the requested ones) to be toggled, causing
stepping havoc.
pull/108/head
Yuri D'Elia 2021-08-28 18:10:50 +02:00 committed by DRracer
parent a58450acb6
commit 1f2662518b
1 changed files with 1 additions and 1 deletions

View File

@ -70,7 +70,7 @@ __attribute__((always_inline)) inline Level ReadPin(const GPIO_pin portPin) {
__attribute__((always_inline)) inline void TogglePin(const GPIO_pin portPin) {
#ifdef __AVR__
// Optimized path for AVR, resulting in a pin toggle
portPin.port->PINx |= (1 << portPin.pin);
portPin.port->PINx = (1 << portPin.pin);
#else
WritePin(portPin, (Level)(ReadPin(portPin) != Level::high));
#endif