use 115200 baud and print panic over serial
This commit is contained in:
14
src/main.rs
14
src/main.rs
@@ -1,7 +1,15 @@
|
||||
#![no_std]
|
||||
#![no_main]
|
||||
|
||||
use panic_halt as _;
|
||||
use arduino_hal::prelude::*;
|
||||
|
||||
panic_serial::impl_panic_handler!(
|
||||
arduino_hal::usart::Usart<
|
||||
arduino_hal::pac::USART0,
|
||||
arduino_hal::port::Pin<arduino_hal::port::mode::Input, arduino_hal::hal::port::PD0>,
|
||||
arduino_hal::port::Pin<arduino_hal::port::mode::Output, arduino_hal::hal::port::PD1>
|
||||
>
|
||||
);
|
||||
|
||||
#[arduino_hal::entry]
|
||||
fn main() -> ! {
|
||||
@@ -19,6 +27,10 @@ fn main() -> ! {
|
||||
*/
|
||||
|
||||
let mut led = pins.d13.into_output();
|
||||
let serial = arduino_hal::default_serial!(dp, pins, 115200);
|
||||
let mut serial = share_serial_port_with_panic(serial);
|
||||
|
||||
ufmt::uwriteln!(&mut serial, "Hello from Arduino!").unwrap_infallible();
|
||||
|
||||
loop {
|
||||
led.toggle();
|
||||
|
||||
Reference in New Issue
Block a user