From 5509a8aa0530606bc8079d0e78d00bdae53773c6 Mon Sep 17 00:00:00 2001 From: NikhitaR-IFX Date: Mon, 6 Nov 2023 15:02:22 +0530 Subject: [PATCH] tests/psoc6/dut: Codeformatting i2c tests. Signed-off-by: NikhitaR-IFX --- tests/psoc6/dut/i2c_hard.py | 8 ++++---- tests/psoc6/dut/i2c_soft.py | 7 +++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/tests/psoc6/dut/i2c_hard.py b/tests/psoc6/dut/i2c_hard.py index 1f45cee576e4..5e91fcf7c7bd 100644 --- a/tests/psoc6/dut/i2c_hard.py +++ b/tests/psoc6/dut/i2c_hard.py @@ -13,16 +13,16 @@ scl_pin = "P6_4" sda_pin = "P6_5" -i2c = I2C(0,scl=scl_pin,sda=sda_pin,freq=400000) +i2c = I2C(0, scl=scl_pin, sda=sda_pin, freq=400000) addr = i2c.scan() -master_data = b'\x01\x00\x17' +master_data = b"\x01\x00\x17" counter = 0 -while(counter!=5): +while counter != 5: i2c.writeto(addr[0], master_data) time.sleep(1) slave_data = i2c.readfrom(addr[0], 3) print("Slave sent data: ", slave_data) master_data = slave_data time.sleep(1) - counter = counter+1 + counter = counter + 1 diff --git a/tests/psoc6/dut/i2c_soft.py b/tests/psoc6/dut/i2c_soft.py index 667b8c6b7088..e437a3f1e15f 100644 --- a/tests/psoc6/dut/i2c_soft.py +++ b/tests/psoc6/dut/i2c_soft.py @@ -14,15 +14,14 @@ i2c = SoftI2C(scl=scl_pin, sda=sda_pin, freq=400000) addr = i2c.scan() -master_data = b'\x01\x00\x17' +master_data = b"\x01\x00\x17" counter = 0 -while(counter!=5): +while counter != 5: i2c.writeto(addr[0], master_data) time.sleep(1) slave_data = i2c.readfrom(addr[0], 3) print("Slave sent data: ", slave_data) master_data = slave_data time.sleep(1) - counter = counter+1 - + counter = counter + 1