浏览代码

base-station: Fix NRF24L01 initialization errors.

The power cycling needs to be performed with CS high.
父节点
当前提交
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() {

正在加载...
取消
保存