tests/pyb: Adjust UART and Timer tests to work on PYBD_SF6.

pull/1/head
Damien George 2019-12-20 16:42:38 +11:00
parent 073c5f3a40
commit 39bc430e44
3 changed files with 2 additions and 3 deletions

View File

@ -16,4 +16,4 @@ print(tim.period())
tim = Timer(2, freq=100) tim = Timer(2, freq=100)
print(tim.freq()) print(tim.freq())
tim.freq(0.001) tim.freq(0.001)
print(tim.freq()) print('{:.3f}'.format(tim.freq()))

View File

@ -1,7 +1,7 @@
from pyb import UART from pyb import UART
# test we can correctly create by id # test we can correctly create by id
for bus in (-1, 0, 1, 2, 5, 6, 7): for bus in (-1, 0, 1, 2, 5, 6):
try: try:
UART(bus, 9600) UART(bus, 9600)
print("UART", bus) print("UART", bus)

View File

@ -4,7 +4,6 @@ UART 1
UART 2 UART 2
ValueError 5 ValueError 5
UART 6 UART 6
ValueError 7
UART(1, baudrate=9600, bits=8, parity=None, stop=1, flow=0, timeout=0, timeout_char=3, rxbuf=64) UART(1, baudrate=9600, bits=8, parity=None, stop=1, flow=0, timeout=0, timeout_char=3, rxbuf=64)
UART(1, baudrate=2400, bits=8, parity=None, stop=1, flow=0, timeout=0, timeout_char=7, rxbuf=64) UART(1, baudrate=2400, bits=8, parity=None, stop=1, flow=0, timeout=0, timeout_char=7, rxbuf=64)
0 0