diff options
| author | huntc <[email protected]> | 2021-10-15 18:30:53 +1100 |
|---|---|---|
| committer | huntc <[email protected]> | 2021-10-18 10:26:11 +1100 |
| commit | fa82913bc3f227151c0ea574c135a54de0900279 (patch) | |
| tree | 51163048fd48832e6ed91dad503cdf70ebb07d7e /examples/nrf | |
| parent | 3be274dc2a471bb837e53f06065a20ec48d445d5 (diff) | |
We have to reduce the buffer size to cater for the number of channels to scan
Diffstat (limited to 'examples/nrf')
| -rw-r--r-- | examples/nrf/src/bin/saadc_continuous.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/nrf/src/bin/saadc_continuous.rs b/examples/nrf/src/bin/saadc_continuous.rs index 8bbdca665..dfcb46171 100644 --- a/examples/nrf/src/bin/saadc_continuous.rs +++ b/examples/nrf/src/bin/saadc_continuous.rs | |||
| @@ -39,7 +39,7 @@ async fn main(_spawner: Spawner, mut p: Peripherals) { | |||
| 39 | 39 | ||
| 40 | timer.start(); | 40 | timer.start(); |
| 41 | 41 | ||
| 42 | let mut bufs = [[0; 3 * 500]; 2]; // Each buffer of the double buffer has to be large enough for all channels. | 42 | let mut bufs = [[0; 3 * 50]; 2]; // Each buffer of the double buffer has to be large enough for all channels. |
| 43 | 43 | ||
| 44 | let mut c = 0; | 44 | let mut c = 0; |
| 45 | let mut a: i32 = 0; | 45 | let mut a: i32 = 0; |
| @@ -54,7 +54,7 @@ async fn main(_spawner: Spawner, mut p: Peripherals) { | |||
| 54 | } | 54 | } |
| 55 | if c > 10000 { | 55 | if c > 10000 { |
| 56 | a = a / c as i32; | 56 | a = a / c as i32; |
| 57 | info!("sample: {=i32}", a); | 57 | info!("channel 1: {=i32}", a); |
| 58 | c = 0; | 58 | c = 0; |
| 59 | a = 0; | 59 | a = 0; |
| 60 | } | 60 | } |
