Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/uEncoderISR.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ class uEncoderISR : public uEncoderVirt {
noInterrupts();
uint8_t state = _buf & 0xf;
_buf >>= 4;
// _state лежит в одном байте с _e0/_e1, а их пишет tickISR. Запись
// битового поля это read-modify-write всего байта, поэтому вне
// критической секции прерывание потеряет своё обновление ног
_state = state ? state : State::Idle;
interrupts();

_state = state ? state : State::Idle;
return state;
}

Expand Down