Reorder args

This commit is contained in:
Henrik Alsér 2022-08-30 22:55:53 +02:00 committed by Henrik Alsér
parent 6d347af9fa
commit 99dd2a9386
2 changed files with 3 additions and 3 deletions

View File

@ -264,11 +264,11 @@ impl<'d, T: Instance, M: Mode> Spi<'d, T, M> {
impl<'d, T: Instance> Spi<'d, T, Async> { impl<'d, T: Instance> Spi<'d, T, Async> {
pub fn new( pub fn new(
inner: impl Peripheral<P = T> + 'd, inner: impl Peripheral<P = T> + 'd,
tx_dma: impl Peripheral<P = impl Channel> + 'd,
rx_dma: impl Peripheral<P = impl Channel> + 'd,
clk: impl Peripheral<P = impl ClkPin<T> + 'd> + 'd, clk: impl Peripheral<P = impl ClkPin<T> + 'd> + 'd,
mosi: impl Peripheral<P = impl MosiPin<T> + 'd> + 'd, mosi: impl Peripheral<P = impl MosiPin<T> + 'd> + 'd,
miso: impl Peripheral<P = impl MisoPin<T> + 'd> + 'd, miso: impl Peripheral<P = impl MisoPin<T> + 'd> + 'd,
tx_dma: impl Peripheral<P = impl Channel> + 'd,
rx_dma: impl Peripheral<P = impl Channel> + 'd,
config: Config, config: Config,
) -> Self { ) -> Self {
into_ref!(tx_dma, rx_dma, clk, mosi, miso); into_ref!(tx_dma, rx_dma, clk, mosi, miso);

View File

@ -17,7 +17,7 @@ async fn main(_spawner: Spawner) {
let mosi = p.PIN_11; let mosi = p.PIN_11;
let clk = p.PIN_10; let clk = p.PIN_10;
let mut spi: Spi<'_, _, Async> = Spi::new(p.SPI1, p.DMA_CH0, p.DMA_CH1, clk, mosi, miso, Config::default()); let mut spi: Spi<'_, _, Async> = Spi::new(p.SPI1, clk, mosi, miso, p.DMA_CH0, p.DMA_CH1, Config::default());
loop { loop {
let tx_buf = [1_u8, 2, 3, 4, 5, 6]; let tx_buf = [1_u8, 2, 3, 4, 5, 6];