Skip to content

Commit 3bf65ea

Browse files
CoolSlimboRahix
authored andcommitted
Adjust example to properly run.
(Tested)[Rahix#562 (comment)]. Introduces points for other examples commented in.
1 parent 028c617 commit 3bf65ea

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

examples/atmega2560/src/bin/atmega2560-usart_spi-feedback.rs

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,34 @@ fn main() -> ! {
3636

3737
// Create SPI interface.
3838
let (mut spi, _) = usart_spi::Usart1Spi::new(
39-
dp.SPI,
39+
dp.USART1,
4040
pins.pd5.into_output(),
4141
pins.pd3.into_output(),
4242
pins.pd2.into_pull_up_input(),
4343
pins.pd4.into_output().downgrade(),
44-
spi::Settings::default(),
44+
atmega_hal::spi::Settings::default(),
4545
);
4646

47+
/* Other SPI examples for other USART's
48+
let (mut spi, _) = usart_spi::Usart2Spi::new(
49+
dp.USART2,
50+
pins.ph2.into_output(),
51+
pins.ph1.into_output(),
52+
pins.ph0.into_pull_up_input(),
53+
pins.pd4.into_output().downgrade(),
54+
atmega_hal::spi::Settings::default(),
55+
);
56+
57+
let (mut spi, _) = usart_spi::Usart3Spi::new(
58+
dp.USART3,
59+
pins.pj2.into_output(),
60+
pins.pj1.into_output(),
61+
pins.pj0.into_pull_up_input(),
62+
pins.pd4.into_output().downgrade(),
63+
atmega_hal::spi::Settings::default(),
64+
);
65+
*/
66+
4767
loop {
4868
// Send a byte
4969
let data_out: [u8; 1] = [42];

0 commit comments

Comments
 (0)