From 512cd6aec0c64c42ec76fd94b5db0e945f59e513 Mon Sep 17 00:00:00 2001 From: 9names <60134748+9names@users.noreply.github.com> Date: Sun, 14 Apr 2024 20:31:13 +1000 Subject: [PATCH] Update nunchuk mocks with calibration reads --- wii-ext/src/nunchuk.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/wii-ext/src/nunchuk.rs b/wii-ext/src/nunchuk.rs index de126b4..93335bc 100644 --- a/wii-ext/src/nunchuk.rs +++ b/wii-ext/src/nunchuk.rs @@ -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()), @@ -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()), @@ -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()), @@ -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()),