Allow unused fields temporarily in i2c

This commit is contained in:
Mathias 2022-09-27 08:03:49 +02:00 committed by Dario Nieuwenhuis
parent 44c46e3c93
commit bf1da0497c

View File

@ -52,9 +52,9 @@ impl Default for Config {
const FIFO_SIZE: u8 = 16; const FIFO_SIZE: u8 = 16;
pub struct I2c<'d, T: Instance, M: Mode> { pub struct I2c<'d, T: Instance, M: Mode> {
tx_dma: Option<PeripheralRef<'d, AnyChannel>>, _tx_dma: Option<PeripheralRef<'d, AnyChannel>>,
rx_dma: Option<PeripheralRef<'d, AnyChannel>>, _rx_dma: Option<PeripheralRef<'d, AnyChannel>>,
dma_buf: [u16; 256], _dma_buf: [u16; 256],
phantom: PhantomData<(&'d mut T, M)>, phantom: PhantomData<(&'d mut T, M)>,
} }
@ -75,8 +75,8 @@ impl<'d, T: Instance, M: Mode> I2c<'d, T, M> {
_peri: impl Peripheral<P = T> + 'd, _peri: impl Peripheral<P = T> + 'd,
scl: PeripheralRef<'d, AnyPin>, scl: PeripheralRef<'d, AnyPin>,
sda: PeripheralRef<'d, AnyPin>, sda: PeripheralRef<'d, AnyPin>,
tx_dma: Option<PeripheralRef<'d, AnyChannel>>, _tx_dma: Option<PeripheralRef<'d, AnyChannel>>,
rx_dma: Option<PeripheralRef<'d, AnyChannel>>, _rx_dma: Option<PeripheralRef<'d, AnyChannel>>,
config: Config, config: Config,
) -> Self { ) -> Self {
into_ref!(_peri); into_ref!(_peri);
@ -173,9 +173,9 @@ impl<'d, T: Instance, M: Mode> I2c<'d, T, M> {
} }
Self { Self {
tx_dma, _tx_dma,
rx_dma, _rx_dma,
dma_buf: [0; 256], _dma_buf: [0; 256],
phantom: PhantomData, phantom: PhantomData,
} }
} }