Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
matrix: # All permutations of {rust, mcu}
rust:
- 1.68.2 # MSRV
- 1.70.0 # MSRV
- stable
logger:
- log-rtt
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ opt-level = "s" # optimize for binary size

[dev_dependencies]
embedded-sdmmc = "0.5.0"
usbd-midi = { git = "https://github.com/btrepp/usbd-midi/" }
usbd-midi = "0.3.0"
num_enum = { version = "0.7.3", default-features = false }
usb-device = "0.3.0"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ cargo objcopy --example passthru --release -- -O binary passthru.bin
[cargo-binutils-url]: https://github.com/rust-embedded/cargo-binutils

# Minimum supported Rust version
The Minimum Supported Rust Version (MSRV) at the moment is 1.68.2
The Minimum Supported Rust Version (MSRV) at the moment is 1.70.0
# Demos

[Looper](https://github.com/mtthw-meyer/daisy-looper) - Basic one button looper.
2 changes: 1 addition & 1 deletion examples/sdmmc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
mod app {
use log::info;

use embedded_sdmmc::{VolumeManager, TimeSource, Timestamp, VolumeIdx};
use embedded_sdmmc::{TimeSource, Timestamp, VolumeIdx, VolumeManager};
use libdaisy::{
gpio,
// Includes a panic handler and optional logging facilities
Expand Down Expand Up @@ -102,7 +102,7 @@
gpio.daisy6.take().unwrap(),
device.SDMMC1,
ccdr.peripheral.SDMMC1,
&mut ccdr.clocks,

Check warning on line 105 in examples/sdmmc.rs

View workflow job for this annotation

GitHub Actions / clippy

the function `sdmmc::init` doesn't need a mutable reference

warning: the function `sdmmc::init` doesn't need a mutable reference --> examples/sdmmc.rs:105:13 | 105 | &mut ccdr.clocks, | ^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed = note: `#[warn(clippy::unnecessary_mut_passed)]` on by default
);

gpio.led.set_low();
Expand Down
3 changes: 2 additions & 1 deletion examples/usb_midi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
let mut timer2 = device.TIM2.timer(
MilliSeconds::from_ticks(200).into_rate(),
ccdr.peripheral.TIM2,
&mut ccdr.clocks,

Check warning on line 71 in examples/usb_midi.rs

View workflow job for this annotation

GitHub Actions / clippy

the method `timer` doesn't need a mutable reference

warning: the method `timer` doesn't need a mutable reference --> examples/usb_midi.rs:71:13 | 71 | &mut ccdr.clocks, | ^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed = note: `#[warn(clippy::unnecessary_mut_passed)]` on by default
);
timer2.listen(Event::TimeOut);

Expand Down Expand Up @@ -129,14 +129,15 @@

let usb_bus = cortex_m::singleton!(
: usb_device::class_prelude::UsbBusAllocator<UsbBus<USB2>> =
UsbBus::new(usb, unsafe { &mut EP_MEMORY })

Check warning on line 132 in examples/usb_midi.rs

View workflow job for this annotation

GitHub Actions / clippy

creating a mutable reference to mutable static is discouraged

warning: creating a mutable reference to mutable static is discouraged --> examples/usb_midi.rs:132:43 | 132 | UsbBus::new(usb, unsafe { &mut EP_MEMORY }) | ^^^^^^^^^^^^^^ mutable reference to mutable static | = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html> = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives = note: `#[warn(static_mut_refs)]` on by default help: use `&raw mut` instead to create a raw pointer | 132 | UsbBus::new(usb, unsafe { &raw mut EP_MEMORY }) | ~~~~~~~~

Check warning on line 132 in examples/usb_midi.rs

View workflow job for this annotation

GitHub Actions / ci

creating a mutable reference to mutable static is discouraged
)
.unwrap();

let midi = MidiClass::new(usb_bus, 1, 1).unwrap();

let usb_dev = UsbDeviceBuilder::new(usb_bus, UsbVidPid(0x16c0, 0x5e4))
.strings(&[StringDescriptors::default().product("daisy midi")]).unwrap()
.strings(&[StringDescriptors::default().product("daisy midi")])
.unwrap()
.device_class(USB_CLASS_NONE)
.build();

Expand Down Expand Up @@ -203,19 +204,19 @@
let mut buffer = [0; 64];
if let Ok(size) = midi.read(&mut buffer) {
let buffer_reader = MidiPacketBufferReader::new(&buffer, size);
for packet in buffer_reader.into_iter() {
if let Ok(packet) = packet {
match packet.message {
Message::NoteOn(_, _, U7::MIN) | Message::NoteOff(..) => {
led.set_low();
}
Message::NoteOn(..) => {
led.set_high();
}
_ => {}
}
}
}

Check warning on line 219 in examples/usb_midi.rs

View workflow job for this annotation

GitHub Actions / clippy

unnecessary `if let` since only the `Ok` variant of the iterator element is used

warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used --> examples/usb_midi.rs:207:17 | 207 | for packet in buffer_reader.into_iter() { | ^ ------------------------- help: try: `buffer_reader.into_iter().flatten()` | _________________| | | 208 | | if let Ok(packet) = packet { 209 | | match packet.message { 210 | | Message::NoteOn(_, _, U7::MIN) | Message::NoteOff(..) => { ... | 218 | | } 219 | | } | |_________________^ | help: ...and remove the `if let` statement in the for loop --> examples/usb_midi.rs:208:21 | 208 | / if let Ok(packet) = packet { 209 | | match packet.message { 210 | | Message::NoteOn(_, _, U7::MIN) | Message::NoteOff(..) => { 211 | | led.set_low(); ... | 217 | | } 218 | | } | |_____________________^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten = note: `#[warn(clippy::manual_flatten)]` on by default
}
});
}
Expand Down
4 changes: 2 additions & 2 deletions src/logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ cfg_if::cfg_if! {
use cortex_m_log::printer::semihosting;
use cortex_m_log::printer::semihosting::Semihosting;
use cortex_m_log::modes::InterruptOk;
use cortex_m_semihosting::hio::HStdout;
use cortex_m_semihosting::hio::HostStream;

lazy_static! {
static ref LOGGER: Logger<Semihosting<InterruptOk, HStdout>> = Logger {
static ref LOGGER: Logger<Semihosting<InterruptOk, HostStream>> = Logger {
level: LevelFilter::Info,
inner: semihosting::InterruptOk::<_>::stdout().expect("Get Semihosting stdout"),
};
Expand Down
Loading