Преглед на файлове

base-station: Fix NRF24L01 initialization errors.

The power cycling needs to be performed with CS high.
Mathias Gottschlag преди 5 години
родител
ревизия
d0b4b5b256
променени са 1 файла, в които са добавени 4 реда и са изтрити 2 реда
  1. 4
    2
      base-station/software/src/radio.rs

+ 4
- 2
base-station/software/src/radio.rs Целия файл

@@ -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…
Отказ
Запис