File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change 16
16
uart_id = 0
17
17
tx_pin = "GPIO0"
18
18
rx_pin = "GPIO1"
19
- min_window = 1
20
19
elif "samd" in sys .platform and "ItsyBitsy M0" in sys .implementation ._machine :
21
20
uart_id = 0
22
21
tx_pin = "D1"
23
22
rx_pin = "D0"
24
- # For SAMD delay_ms has to be used for the trailing window, and the
25
- # mininmal time is 11 ms to allow for scheduling.
26
- min_window = 11
27
23
elif "samd" in sys .platform and "ItsyBitsy M4" in sys .implementation ._machine :
28
24
uart_id = 3
29
25
tx_pin = "D1"
30
26
rx_pin = "D0"
31
- min_window = 11
32
27
elif "mimxrt" in sys .platform :
33
28
uart_id = 1
34
29
tx_pin = None
35
- min_window = 0
36
30
elif "nrf" in sys .platform :
37
31
uart_id = 0
38
32
tx_pin = None
39
- min_window = 0
40
33
else :
41
34
print ("Please add support for this test on this platform." )
42
35
raise SystemExit
@@ -61,12 +54,11 @@ def irq(u):
61
54
# the test marks a time window close to the expected of the sending
62
55
# and the time at which the IRQ should have been fired.
63
56
# It is just a rough estimation of 10 characters before and
64
- # 20 characters after the data's end, unless there is a need to
65
- # wait a minimal time, like for SAMD devices.
57
+ # 20 characters after the data's end.
66
58
67
59
bits_per_char = 10 # 1(startbit) + 8(bits) + 1(stopbit) + 0(parity)
68
60
start_time_us = (len (text ) - 10 ) * bits_per_char * 1_000_000 // bits_per_s
69
- window_ms = max ( min_window , 20 * bits_per_char * 1_000 // bits_per_s + 1 )
61
+ window_ms = 20 * bits_per_char * 1_000 // bits_per_s + 1
70
62
71
63
print ("write" , bits_per_s )
72
64
uart .write (text )
You can’t perform that action at this time.
0 commit comments