File tree Expand file tree Collapse file tree 3 files changed +12
-20
lines changed
r3_port_arm_m_test_driver/src Expand file tree Collapse file tree 3 files changed +12
-20
lines changed Original file line number Diff line number Diff line change @@ -18,8 +18,15 @@ fn panic(info: &PanicInfo) -> ! {
18
18
19
19
r3_support_rp2040:: sprintln!( "{}{}" , mux:: BEGIN_MAIN , info) ;
20
20
21
- // TODO: keep polling
22
- loop { }
21
+ enter_poll_loop ( ) ;
22
+ }
23
+
24
+ /// Start polling USB so that we can deliver the test result and reset the
25
+ /// device when requested.
26
+ pub fn enter_poll_loop ( ) -> ! {
27
+ loop {
28
+ usbstdio:: poll :: < Options > ( ) ;
29
+ }
23
30
}
24
31
25
32
struct Logger ;
Original file line number Diff line number Diff line change @@ -49,6 +49,9 @@ macro_rules! instantiate_test {
49
49
crate :: board_rp2040:: mux:: BEGIN_MAIN ,
50
50
) ;
51
51
52
+ #[ cfg( feature = "board-rp_pico" ) ]
53
+ board_rp2040:: enter_poll_loop( ) ;
54
+
52
55
loop { }
53
56
}
54
57
Original file line number Diff line number Diff line change @@ -221,24 +221,6 @@ impl UsbStdioGlobal {
221
221
}
222
222
}
223
223
224
- // TODO:
225
- //
226
- // - The USB controller needs to be periodically polled to work correctly.
227
- // The panic handler should poll USB instead of doing nothing.
228
- //
229
- // - We also need to handle incoming data. The test driver will need this to
230
- // hold off the test execution until requested and to prepare the target for
231
- // a subsequent test run.
232
- //
233
- // - If there's incoming data, the interrupt will not be deassserted until
234
- // `SerialPort::read` is called. And `SerialPort::read` does not consume
235
- // the incoming data if its internal buffer is full.
236
- //
237
- // The only way to do flow control seems to be disabling or ignoring USB
238
- // interrupts. Of course, this can only be done for a few milliseconds, the
239
- // upper bound defined by the USB specification.
240
- //
241
-
242
224
struct Deque < T , const LEN : usize > {
243
225
buf : [ T ; LEN ] ,
244
226
start : usize ,
You can’t perform that action at this time.
0 commit comments