From 2de4dfa532462361e25107d15cd129add4a08656 Mon Sep 17 00:00:00 2001 From: enriquezgarc Date: Fri, 6 Oct 2023 13:17:48 +0200 Subject: [PATCH] tests/psoc6: Changes to adapt psoc6 machine module. Signed-off-by: enriquezgarc --- tests/psoc6/adc.py | 7 ++----- tests/psoc6/adcblock.py | 6 ++---- tests/psoc6/pin.py.exp | 4 ++-- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/tests/psoc6/adc.py b/tests/psoc6/adc.py index c0483a6fb5753..24c4d4cc3a818 100644 --- a/tests/psoc6/adc.py +++ b/tests/psoc6/adc.py @@ -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) diff --git a/tests/psoc6/adcblock.py b/tests/psoc6/adcblock.py index 08c672d64ab0b..0946c98a71fdd 100644 --- a/tests/psoc6/adcblock.py +++ b/tests/psoc6/adcblock.py @@ -12,8 +12,6 @@ print("SKIP") raise SystemExit -pin = Pin(pin_name) - # Negative tests try: adcBlock = ADCBlock(1) @@ -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) diff --git a/tests/psoc6/pin.py.exp b/tests/psoc6/pin.py.exp index a8cd86f1919df..99572fff665c4 100644 --- a/tests/psoc6/pin.py.exp +++ b/tests/psoc6/pin.py.exp @@ -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