Skip to content

Commit

Permalink
Update nunchuk mocks with calibration reads
Browse files Browse the repository at this point in the history
  • Loading branch information
9names committed Apr 14, 2024
1 parent 05a937e commit 512cd6a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions wii-ext/src/nunchuk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ mod tests {
// Init
Transaction::write(EXT_I2C_ADDR as u8, vec![240, 85]),
Transaction::write(EXT_I2C_ADDR as u8, vec![251, 0]),
// Calibration read
Transaction::write(EXT_I2C_ADDR as u8, vec![0]),
Transaction::read(EXT_I2C_ADDR as u8, test_data::NUNCHUCK_IDLE.to_vec()),
// Read
Transaction::write(EXT_I2C_ADDR as u8, vec![0]),
Transaction::read(EXT_I2C_ADDR as u8, test_data::NUNCHUCK_IDLE.to_vec()),
Expand Down Expand Up @@ -279,6 +282,9 @@ mod tests {
// Init
Transaction::write(EXT_I2C_ADDR as u8, vec![240, 85]),
Transaction::write(EXT_I2C_ADDR as u8, vec![251, 0]),
// Calibration read
Transaction::write(EXT_I2C_ADDR as u8, vec![0]),
Transaction::read(EXT_I2C_ADDR as u8, test_data::NUNCHUCK_IDLE.to_vec()),
// Read
Transaction::write(EXT_I2C_ADDR as u8, vec![0]),
Transaction::read(EXT_I2C_ADDR as u8, test_data::NUNCHUCK_IDLE.to_vec()),
Expand Down Expand Up @@ -306,6 +312,9 @@ mod tests {
// Init
Transaction::write(EXT_I2C_ADDR as u8, vec![240, 85]),
Transaction::write(EXT_I2C_ADDR as u8, vec![251, 0]),
// Calibration read
Transaction::write(EXT_I2C_ADDR as u8, vec![0]),
Transaction::read(EXT_I2C_ADDR as u8, test_data::NUNCHUCK_IDLE.to_vec()),
// Read
Transaction::write(EXT_I2C_ADDR as u8, vec![0]),
Transaction::read(EXT_I2C_ADDR as u8, test_data::NUNCHUCK_BTN_C.to_vec()),
Expand All @@ -328,6 +337,9 @@ mod tests {
// Init
Transaction::write(EXT_I2C_ADDR as u8, vec![240, 85]),
Transaction::write(EXT_I2C_ADDR as u8, vec![251, 0]),
// Calibration read
Transaction::write(EXT_I2C_ADDR as u8, vec![0]),
Transaction::read(EXT_I2C_ADDR as u8, test_data::NUNCHUCK_IDLE.to_vec()),
// Read
Transaction::write(EXT_I2C_ADDR as u8, vec![0]),
Transaction::read(EXT_I2C_ADDR as u8, test_data::NUNCHUCK_BTN_Z.to_vec()),
Expand Down

0 comments on commit 512cd6a

Please sign in to comment.