Add encoder abstraction. (#21548)
This commit is contained in:
parent
2eb9ff8efd
commit
9d9cdaaa2d
50 changed files with 863 additions and 653 deletions
|
@ -50,7 +50,7 @@ bool encoder_update_kb(uint8_t index, bool clockwise) {
|
|||
|
||||
bool setAndRead(pin_t pin, bool val) {
|
||||
setPin(pin, val);
|
||||
return encoder_read();
|
||||
return encoder_task();
|
||||
}
|
||||
|
||||
class EncoderSplitTestRole : public ::testing::Test {
|
||||
|
@ -87,9 +87,6 @@ TEST_F(EncoderSplitTestRole, TestPrimaryRight) {
|
|||
setAndRead(6, true);
|
||||
setAndRead(7, true);
|
||||
|
||||
uint8_t slave_state[32] = {0};
|
||||
encoder_state_raw(slave_state);
|
||||
|
||||
EXPECT_EQ(num_updates, 1); // one update received
|
||||
}
|
||||
|
||||
|
@ -116,8 +113,5 @@ TEST_F(EncoderSplitTestRole, TestNotPrimaryRight) {
|
|||
setAndRead(6, true);
|
||||
setAndRead(7, true);
|
||||
|
||||
uint8_t slave_state[32] = {0};
|
||||
encoder_state_raw(slave_state);
|
||||
|
||||
EXPECT_EQ(num_updates, 0); // zero updates received
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue