Skip to content

Commit 9c73cde

Browse files
committed
factory_test_clocking now includes project reset test as well
1 parent b9b085d commit 9c73cde

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

src/ttboard/util/shuttle_tests.py

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,39 @@ def factory_test_clocking(tt:DemoBoard, read_bidirs:bool, max_idx:int=128, delay
115115
tt.clock_project_stop()
116116
tt.reset_project(False)
117117

118-
return clock_and_compare_output(tt, read_bidirs, max_idx, delay_interval_ms)
118+
err = clock_and_compare_output(tt, read_bidirs, max_idx, delay_interval_ms)
119+
if err is not None:
120+
# error encountered, we're done here
121+
return err
122+
123+
124+
# test that reset actually resets
125+
log.info('RP2040 test project reset')
126+
127+
# make sure we're not exactly on
128+
if tt.output_byte == 0:
129+
for _i in range(5):
130+
tt.clock_project_once()
131+
132+
if tt.output_byte == 0:
133+
log.warn("Something is off: clocked a few times, still reporting 0")
134+
135+
136+
tt.reset_project(True)
137+
time.sleep_ms(10)
138+
tt.reset_project(False)
139+
err = clock_and_compare_output(tt, read_bidirs, 0xf, delay_interval_ms)
140+
if err is not None:
141+
log.error(f'Problem with clocking test post-reset: {err}')
142+
return err
143+
144+
log.info('RP2040: reset well behaved!')
145+
return None
146+
147+
148+
149+
150+
119151

120152

121153

0 commit comments

Comments
 (0)