Skip to content

Commit

Permalink
tests/ports/psoc6: Fixed ruff code format rules.
Browse files Browse the repository at this point in the history
Signed-off-by: enriquezgarc <[email protected]>
  • Loading branch information
jaenrig-ifx committed Feb 27, 2025
1 parent bfb167b commit 5b0c701
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion tests/ports/psoc6/board_ext_hw/multi/i2s_rx.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def rx_complete_irq(obj):
###############################################################################
print("\n3. shift ")

buf = bytearray(b"\xFF\xFF\xFF\xFF")
buf = bytearray(b"\xff\xff\xff\xff")
I2S.shift(buf=buf, bits=16, shift=3)
print(binascii.hexlify(buf))
I2S.shift(buf=buf, bits=16, shift=-3)
Expand Down
20 changes: 11 additions & 9 deletions tests/ports/psoc6/board_ext_hw/single/adc.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
### ADC Functional test
""" Setup description:
Construct a basic voltage divider with 120 ohms each resistor. Supply the ends with 3.3V and GND.
Available voltage values are then - 3.3V, ~1.7V, 0V.
Pin connections:
Voltage Divider circuit On Target Board
3.3V end adc_pin_max
Mid point adc_pin_mid
GND end adc_pin_gnd
*Known issue: When connected to GND, you may not get exact 0V and this may vary board to board.

"""Setup description:
Construct a basic voltage divider with 120 ohms each resistor. Supply the ends with 3.3V and GND.
Available voltage values are then - 3.3V, ~1.7V, 0V.
Pin connections:
Voltage Divider circuit On Target Board
3.3V end adc_pin_max
Mid point adc_pin_mid
GND end adc_pin_gnd
*Known issue: When connected to GND, you may not get exact 0V and this may vary board to board.
"""

import os
import time
from machine import ADC, ADCBlock
Expand Down
4 changes: 2 additions & 2 deletions tests/ports/psoc6/board_ext_hw/single/i2c.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,14 @@ def i2c_tests(i2c_master):
i2c_slave_rcv_buf = bytearray(8)
i2c_slave.conf_receive_buffer(i2c_slave_rcv_buf)

master_write_data = [b"\x01\x44\x55\x23", b"\x98\x03\x44\xEE"]
master_write_data = [b"\x01\x44\x55\x23", b"\x98\x03\x44\xee"]
i2c_master.writevto(slave_addr, master_write_data)

time.sleep_ms(100)

print(
"master writevto() and received by slave: ",
i2c_slave_rcv_buf == b"\x01\x44\x55\x23\x98\x03\x44\xEE",
i2c_slave_rcv_buf == b"\x01\x44\x55\x23\x98\x03\x44\xee",
)

# 4. Master to slave read
Expand Down
1 change: 1 addition & 0 deletions tests/ports/psoc6/board_ext_hw/single/pwm.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"""
Setup: Connect pwm_pin to pin_in
"""

from machine import PWM, Pin
import os
import time
Expand Down

0 comments on commit 5b0c701

Please sign in to comment.