Skip to content

Commit

Permalink
tests/psoc6: Changes to adapt psoc6 machine module.
Browse files Browse the repository at this point in the history
Signed-off-by: enriquezgarc <enriquezgarcia.external@infineon.com>
  • Loading branch information
jaenrig-ifx committed Oct 6, 2023
1 parent a389252 commit 2de4dfa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
7 changes: 2 additions & 5 deletions tests/psoc6/adc.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,13 @@
print("SKIP")
raise SystemExit

adc_pin = Pin(adc_pin_name)
adc_wrong_pin = Pin(adc_wrong_pin_name)

# Exceptions should be raised
try:
adc = ADC(adc_wrong_pin)
adc = ADC(adc_wrong_pin_name)
except:
print("Invalid ADC Pin")

adc = ADC(adc_pin, sample_ns=1000)
adc = ADC(adc_pin_name, sample_ns=1000)
print(adc)

print(adc.read_u16() > 0)
Expand Down
6 changes: 2 additions & 4 deletions tests/psoc6/adcblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
print("SKIP")
raise SystemExit

pin = Pin(pin_name)

# Negative tests
try:
adcBlock = ADCBlock(1)
Expand All @@ -28,11 +26,11 @@
adcBlock = ADCBlock(0)

try:
adcPin = adcBlock.connect(0, pin)
adcPin = adcBlock.connect(0, pin_name)
except:
print("TypeError: Wrong pin specified for the mentioned channel")


adcPin = adcBlock.connect(3, pin)
adcPin = adcBlock.connect(3, pin_name)

print(adcPin.read_uv() > 0)
4 changes: 2 additions & 2 deletions tests/psoc6/pin.py.exp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pin:111 or P13_7, Mode=OUT, Pull=None, Value=0
Pin:111 or P13_7, Mode=OUT, Pull=None
None
None
None
Pin:4 or P0_4, Mode=IN, Pull=None, Value=1
Pin:4 or P0_4, Mode=IN, Pull=None
1

0 comments on commit 2de4dfa

Please sign in to comment.