mirror of
https://github.com/ferrous-systems/embedded-trainings-2020.git
synced 2025-01-25 07:18:08 +00:00
rm unused imports and fix logging
This commit is contained in:
parent
59f20c1c05
commit
5be260503a
9 changed files with 13 additions and 19 deletions
|
@ -46,7 +46,7 @@ mod app {
|
|||
}
|
||||
|
||||
fn on_event(_usbd: &USBD, event: Event) {
|
||||
defmt::println!("USB: {:?}", event);
|
||||
defmt::println!("USB: {}", event);
|
||||
|
||||
match event {
|
||||
Event::UsbReset => {
|
||||
|
@ -58,7 +58,7 @@ mod app {
|
|||
|
||||
Event::UsbEp0Setup => {
|
||||
defmt::println!("goal reached; move to the next section");
|
||||
asm::bkpt();
|
||||
dk::exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ mod app {
|
|||
// leave this at it is for now.
|
||||
Event::UsbEp0Setup => {
|
||||
defmt::println!("goal reached; move to the next section");
|
||||
asm::bkpt()
|
||||
dk::exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,6 @@ mod app {
|
|||
use dk::{
|
||||
peripheral::USBD,
|
||||
usbd::{self, Event},
|
||||
Peripherals,
|
||||
};
|
||||
|
||||
use usb::{Descriptor, Request};
|
||||
|
|
|
@ -10,7 +10,6 @@ mod app {
|
|||
use dk::{
|
||||
peripheral::USBD,
|
||||
usbd::{self, Event},
|
||||
Peripherals,
|
||||
};
|
||||
|
||||
use usb::{Descriptor, Request};
|
||||
|
@ -44,7 +43,7 @@ mod app {
|
|||
}
|
||||
|
||||
fn on_event(_usbd: &USBD, event: Event) {
|
||||
defmt::println!("USB: {:?} @ {:?}", event, dk::uptime());
|
||||
defmt::println!("USB: {} @ {}", event, dk::uptime());
|
||||
|
||||
match event {
|
||||
Event::UsbReset => {
|
||||
|
|
|
@ -9,8 +9,8 @@ mod app {
|
|||
use dk::{
|
||||
peripheral::USBD,
|
||||
usbd::{self, Ep0In, Event},
|
||||
Peripherals,
|
||||
};
|
||||
|
||||
use usb::{Descriptor, Request};
|
||||
|
||||
#[local]
|
||||
|
@ -44,7 +44,7 @@ mod app {
|
|||
}
|
||||
|
||||
fn on_event(usbd: &USBD, ep0in: &mut Ep0In, event: Event) {
|
||||
defmt::println!("USB: {:?} @ {:?}", event, dk::uptime());
|
||||
defmt::println!("USB: {} @ {}", event, dk::uptime());
|
||||
|
||||
match event {
|
||||
Event::UsbReset => {
|
||||
|
|
|
@ -9,7 +9,6 @@ mod app {
|
|||
use dk::{
|
||||
peripheral::USBD,
|
||||
usbd::{self, Ep0In, Event},
|
||||
Peripherals,
|
||||
};
|
||||
use usb::{Descriptor, Request};
|
||||
|
||||
|
@ -43,7 +42,7 @@ mod app {
|
|||
}
|
||||
|
||||
fn on_event(usbd: &USBD, ep0in: &mut Ep0In, event: Event) {
|
||||
defmt::println!("USB: {:?} @ {:?}", event, dk::uptime());
|
||||
defmt::println!("USB: {} @ {}", event, dk::uptime());
|
||||
|
||||
match event {
|
||||
Event::UsbReset => {
|
||||
|
|
|
@ -12,7 +12,6 @@ mod app {
|
|||
use dk::{
|
||||
peripheral::USBD,
|
||||
usbd::{self, Ep0In, Event},
|
||||
Peripherals,
|
||||
};
|
||||
use usb2::{GetDescriptor as Descriptor, StandardRequest as Request, State};
|
||||
|
||||
|
@ -90,8 +89,8 @@ mod app {
|
|||
|
||||
let request = Request::parse(bmrequesttype, brequest, wvalue, windex, wlength)
|
||||
.expect("Error parsing request");
|
||||
defmt::println!("EP0: {:?}", defmt::Debug2Format(&request));
|
||||
// ^^^^^^^^^^^^^^^^^^^ this adapter is currently needed to log
|
||||
defmt::println!("EP0: {}", defmt::Debug2Format(&request));
|
||||
// ^^^^^^^^^^^^^^^^^^^ this adapter is currently needed to log
|
||||
// `StandardRequest` with `defmt`
|
||||
match request {
|
||||
// section 9.4.3
|
||||
|
|
|
@ -13,7 +13,6 @@ mod app {
|
|||
use dk::{
|
||||
peripheral::USBD,
|
||||
usbd::{self, Ep0In, Event},
|
||||
Peripherals,
|
||||
};
|
||||
use usb2::State;
|
||||
// HEADS UP to use *your* USB packet parser uncomment line 12 and remove line 13
|
||||
|
@ -52,7 +51,7 @@ mod app {
|
|||
}
|
||||
|
||||
fn on_event(usbd: &USBD, ep0in: &mut Ep0In, state: &mut State, event: Event) {
|
||||
defmt::println!("USB: {:?} @ {:?}", event, dk::uptime());
|
||||
defmt::println!("USB: {} @ {}", event, dk::uptime());
|
||||
|
||||
match event {
|
||||
// TODO change `state` as specified in chapter 9.1 USB Device States, of the USB specification
|
||||
|
@ -94,7 +93,7 @@ mod app {
|
|||
|
||||
let request = Request::parse(bmrequesttype, brequest, wvalue, windex, wlength)
|
||||
.expect("Error parsing request");
|
||||
defmt::println!("EP0: {:?}", defmt::Debug2Format(&request));
|
||||
defmt::println!("EP0: {}", defmt::Debug2Format(&request));
|
||||
// ^^^^^^^^^^^^^^^^^^^ this adapter is currently needed to log
|
||||
// `StandardRequest` with `defmt`
|
||||
|
||||
|
|
|
@ -12,7 +12,6 @@ mod app {
|
|||
use dk::{
|
||||
peripheral::USBD,
|
||||
usbd::{self, Ep0In, Event},
|
||||
Peripherals,
|
||||
};
|
||||
use usb2::{GetDescriptor as Descriptor, StandardRequest as Request, State};
|
||||
|
||||
|
@ -47,7 +46,7 @@ mod app {
|
|||
}
|
||||
}
|
||||
fn on_event(usbd: &USBD, ep0in: &mut Ep0In, state: &mut State, event: Event) {
|
||||
defmt::println!("USB: {:?} @ {:?}", event, dk::uptime());
|
||||
defmt::println!("USB: {} @ {}", event, dk::uptime());
|
||||
|
||||
match event {
|
||||
Event::UsbReset => {
|
||||
|
@ -90,7 +89,7 @@ mod app {
|
|||
|
||||
let request = Request::parse(bmrequesttype, brequest, wvalue, windex, wlength)
|
||||
.expect("Error parsing request");
|
||||
defmt::println!("EP0: {:?}", defmt::Debug2Format(&request));
|
||||
defmt::println!("EP0: {}", defmt::Debug2Format(&request));
|
||||
// ^^^^^^^^^^^^^^^^^^^ this adapter is currently needed to log
|
||||
// `StandardRequest` with `defmt`
|
||||
|
||||
|
|
Loading…
Reference in a new issue