File tree Expand file tree Collapse file tree 2 files changed +16
-10
lines changed
Expand file tree Collapse file tree 2 files changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -323,11 +323,6 @@ pub enum Error {
323323///
324324/// This return an `Err`or if called more than once
325325pub fn init ( ) -> Result < Board , Error > {
326- // probe-rs puts us in blocking mode, so wait for blocking mode as a proxy
327- // for waiting for probe-rs to connect.
328- while !defmt_rtt:: in_blocking_mode ( ) {
329- core:: hint:: spin_loop ( ) ;
330- }
331326 // NOTE: this branch runs at most once
332327 #[ cfg( feature = "advanced" ) ]
333328 static EP0IN_BUF : GroundedArrayCell < u8 , 64 > = GroundedArrayCell :: const_init ( ) ;
@@ -337,6 +332,14 @@ pub fn init() -> Result<Board, Error> {
337332 config. lfclk_source = hal:: config:: LfclkSource :: ExternalXtal ;
338333 let periph = hal:: init ( config) ;
339334
335+ // probe-rs puts us in blocking mode, so wait for blocking mode as a proxy
336+ // for waiting for probe-rs to connect.
337+ //
338+ // do this *after* clock set-up to avoid start-up issues
339+ while !defmt_rtt:: in_blocking_mode ( ) {
340+ core:: hint:: spin_loop ( ) ;
341+ }
342+
340343 // NOTE: this branch runs at most once
341344
342345 let mut rtc = hal:: rtc:: Rtc :: new ( periph. RTC0 , 0 ) . unwrap ( ) ;
Original file line number Diff line number Diff line change @@ -295,11 +295,6 @@ pub enum Error {
295295///
296296/// This return an `Err`or if called more than once
297297pub fn init ( ) -> Result < Board , Error > {
298- // probe-rs puts us in blocking mode, so wait for blocking mode as a proxy
299- // for waiting for probe-rs to connect.
300- while !defmt_rtt:: in_blocking_mode ( ) {
301- core:: hint:: spin_loop ( ) ;
302- }
303298 // NOTE: this branch runs at most once
304299 #[ cfg( feature = "advanced" ) ]
305300 static EP0IN_BUF : GroundedArrayCell < u8 , 64 > = GroundedArrayCell :: const_init ( ) ;
@@ -309,6 +304,14 @@ pub fn init() -> Result<Board, Error> {
309304 config. lfclk_source = hal:: config:: LfclkSource :: ExternalXtal ;
310305 let periph = hal:: init ( config) ;
311306
307+ // probe-rs puts us in blocking mode, so wait for blocking mode as a proxy
308+ // for waiting for probe-rs to connect.
309+ //
310+ // do this *after* clock set-up to avoid start-up issues
311+ while !defmt_rtt:: in_blocking_mode ( ) {
312+ core:: hint:: spin_loop ( ) ;
313+ }
314+
312315 // NOTE: this branch runs at most once
313316
314317 let mut rtc = hal:: rtc:: Rtc :: new ( periph. RTC0 , 0 ) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments