Skip to content

Commit db2bdad

Browse files
committed
tests/pyb: Update tests to run correctly on PYBv1.0.
In adcall.py the pyb module may not be imported, so use ADCAll directly. In dac.py the DAC object now prints more info, so update .exp file. In spi.py the SPI should be deinitialised upon exit, so the test can run a second time correctly.
1 parent 051686b commit db2bdad

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

Diff for: tests/pyb/adcall.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@
55
# set pins to IN mode, init ADCAll, then check pins are ANALOG
66
for p in pins:
77
p.init(p.IN)
8-
adc = pyb.ADCAll(12)
8+
adc = ADCAll(12)
99
for p in pins:
1010
print(p)
1111

1212
# set pins to IN mode, init ADCAll with mask, then check some pins are ANALOG
1313
for p in pins:
1414
p.init(p.IN)
15-
adc = pyb.ADCAll(12, 0x70003)
15+
adc = ADCAll(12, 0x70003)
1616
for p in pins:
1717
print(p)
1818

1919
# init all pins to ANALOG
20-
adc = pyb.ADCAll(12)
20+
adc = ADCAll(12)
2121
print(adc)
2222

2323
# read all channels

Diff for: tests/pyb/dac.py.exp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<DAC>
1+
DAC(1, bits=8)

Diff for: tests/pyb/spi.py

+2
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,5 @@
2929
spi.send(1, timeout=100)
3030
print(spi.recv(1, timeout=100))
3131
print(spi.send_recv(1, timeout=100))
32+
33+
spi.deinit()

0 commit comments

Comments
 (0)