Parcourir la source

base-station: Fix NRF24L01 initialization errors.

The power cycling needs to be performed with CS high.
Mathias Gottschlag il y a 5 ans
Parent
révision
d0b4b5b256
1 fichiers modifiés avec 4 ajouts et 2 suppressions
  1. 4
    2
      base-station/software/src/radio.rs

+ 4
- 2
base-station/software/src/radio.rs Voir le fichier

@@ -131,10 +131,12 @@ impl RadioTask {
131 131
 
132 132
         // HACK: Cycle power until transfers to the module seem to work.
133 133
         loop {
134
+            cs.set_high()?;
134 135
             pwr.set_high()?;
135
-            delay_for(Duration::from_millis(10)).await;
136
+            delay_for(Duration::from_millis(100)).await;
136 137
             pwr.set_low()?;
137
-            delay_for(Duration::from_millis(10)).await;
138
+            delay_for(Duration::from_millis(50)).await;
139
+
138 140
             cs.set_low()?;
139 141
             let mut read_aw = [0x03, 0x00];
140 142
             if spi.transfer(&mut read_aw).is_ok() {

Loading…
Annuler
Enregistrer