diff options
Diffstat (limited to 'cyw43-pio')
| -rw-r--r-- | cyw43-pio/src/lib.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/cyw43-pio/src/lib.rs b/cyw43-pio/src/lib.rs index dca30c74d..830a5b44a 100644 --- a/cyw43-pio/src/lib.rs +++ b/cyw43-pio/src/lib.rs | |||
| @@ -8,7 +8,6 @@ use cyw43::SpiBusCyw43; | |||
| 8 | use embassy_rp::dma::Channel; | 8 | use embassy_rp::dma::Channel; |
| 9 | use embassy_rp::gpio::{Drive, Level, Output, Pin, Pull, SlewRate}; | 9 | use embassy_rp::gpio::{Drive, Level, Output, Pin, Pull, SlewRate}; |
| 10 | use embassy_rp::pio::{Common, Config, Direction, Instance, Irq, PioPin, ShiftDirection, StateMachine}; | 10 | use embassy_rp::pio::{Common, Config, Direction, Instance, Irq, PioPin, ShiftDirection, StateMachine}; |
| 11 | use embassy_rp::relocate::RelocatedProgram; | ||
| 12 | use embassy_rp::{pio_instr_util, Peripheral, PeripheralRef}; | 11 | use embassy_rp::{pio_instr_util, Peripheral, PeripheralRef}; |
| 13 | use fixed::FixedU32; | 12 | use fixed::FixedU32; |
| 14 | use pio_proc::pio_asm; | 13 | use pio_proc::pio_asm; |
| @@ -88,8 +87,6 @@ where | |||
| 88 | ".wrap" | 87 | ".wrap" |
| 89 | ); | 88 | ); |
| 90 | 89 | ||
| 91 | let relocated = RelocatedProgram::new(&program.program); | ||
| 92 | |||
| 93 | let mut pin_io: embassy_rp::pio::Pin<PIO> = common.make_pio_pin(dio); | 90 | let mut pin_io: embassy_rp::pio::Pin<PIO> = common.make_pio_pin(dio); |
| 94 | pin_io.set_pull(Pull::None); | 91 | pin_io.set_pull(Pull::None); |
| 95 | pin_io.set_schmitt(true); | 92 | pin_io.set_schmitt(true); |
| @@ -102,7 +99,8 @@ where | |||
| 102 | pin_clk.set_slew_rate(SlewRate::Fast); | 99 | pin_clk.set_slew_rate(SlewRate::Fast); |
| 103 | 100 | ||
| 104 | let mut cfg = Config::default(); | 101 | let mut cfg = Config::default(); |
| 105 | cfg.use_program(&common.load_program(&relocated), &[&pin_clk]); | 102 | let loaded_program = common.load_program(&program.program); |
| 103 | cfg.use_program(&loaded_program, &[&pin_clk]); | ||
| 106 | cfg.set_out_pins(&[&pin_io]); | 104 | cfg.set_out_pins(&[&pin_io]); |
| 107 | cfg.set_in_pins(&[&pin_io]); | 105 | cfg.set_in_pins(&[&pin_io]); |
| 108 | cfg.set_set_pins(&[&pin_io]); | 106 | cfg.set_set_pins(&[&pin_io]); |
| @@ -142,7 +140,7 @@ where | |||
| 142 | sm, | 140 | sm, |
| 143 | irq, | 141 | irq, |
| 144 | dma: dma.into_ref(), | 142 | dma: dma.into_ref(), |
| 145 | wrap_target: relocated.wrap().target, | 143 | wrap_target: loaded_program.wrap.target, |
| 146 | } | 144 | } |
| 147 | } | 145 | } |
| 148 | 146 | ||
