Save 12 bytes by adjusting math, inspried by Jack Purdum

This commit is contained in:
reedbn 2020-12-13 21:51:46 -08:00
parent 4eecda170d
commit 4918670eaa

View File

@ -16,7 +16,7 @@ static const uint8_t MOMENTUM_MULTIPLIER = 1;
uint8_t enc_state (void)
{
return ((digitalRead(PIN_ENC_A)?1:0) + (digitalRead(PIN_ENC_B)?2:0));
return (digitalRead(PIN_ENC_B) << 1) + (digitalRead(PIN_ENC_A) << 0);
}
/*