Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to dependencies / serial port updates #214

Merged
merged 8 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from 7 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.
26 changes: 13 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ features = ["stm32f746", "rt"]

[dependencies]
as-slice = "0.2"
cortex-m = "0.7.4"
cortex-m = "0.7.7"
cortex-m-rt = ">=0.6.15, <0.8"
nb = "1.0"
nb = "1.1.0"
stm32f7 = "0.15"
micromath = "2.0"
synopsys-usb-otg = { version = "0.3", features = ["cortex-m"], optional = true }
micromath = "2.1.0"
synopsys-usb-otg = { version = "0.4.0", features = ["cortex-m"], optional = true }
stm32-fmc = { version = "0.3", features = ["sdram"], optional = true }
rand_core = "0.6"
bxcan = "0.7"
bare-metal = "1.0"
fugit = "0.3.5"
fugit = "0.3.7"
fugit-timer = "0.1.3"
bitflags = "1.3.2"
bitflags = "2.6.0"
rtic-monotonic = { version = "1.0", optional = true }

[dependencies.time]
Expand All @@ -43,23 +43,23 @@ version = "0.3.0"

[dependencies.embedded-hal]
features = ["unproven"]
version = "0.2.3"
version = "0.2.7"

[dependencies.void]
default-features = false
version = "1.0.2"

[dependencies.display-interface]
optional = true
version = "0.4.1"
version = "0.5.0"

[dev-dependencies]
cortex-m-semihosting = "0.3.3"
cortex-m-semihosting = "0.5.0"
panic-halt = "0.2.0"
panic-semihosting = "0.5.2"
embedded-graphics = "0.6.1"
usb-device = "0.2.5"
usbd-serial = "0.1.0"
panic-semihosting = "0.6.0"
embedded-graphics = "0.6.2"
usb-device = "0.3.2"
usbd-serial = "0.2.2"

[dev-dependencies.time]
version = "0.3"
Expand Down
2 changes: 1 addition & 1 deletion examples/flash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ fn main() -> ! {

// Compare the written data with the expected value.
if flash_data == DATA {
hprintln!("Flash programming successful").unwrap();
hprintln!("Flash programming successful");
}

loop {}
Expand Down
2 changes: 1 addition & 1 deletion examples/fmc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ fn main() -> ! {
}
}

hprintln!("Success!").unwrap();
hprintln!("Success!");

loop {}
}
2 changes: 1 addition & 1 deletion examples/hello.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ use cortex_m_semihosting::hprintln;

#[entry]
fn main() -> ! {
hprintln!("Hello, world!").unwrap();
hprintln!("Hello, world!");
loop {}
}
16 changes: 8 additions & 8 deletions examples/i2c_scanner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,26 +36,26 @@ fn main() -> ! {
50_000,
);

hprintln!("Start i2c scanning...").expect("Error using hprintln.");
hprintln!().unwrap();
hprintln!("Start i2c scanning...");
hprintln!();

for addr in 0x00_u8..0x80 {
// Write the empty array and check the slave response.
let byte: [u8; 1] = [0; 1];
if VALID_ADDR_RANGE.contains(&addr) && i2c.write(addr, &byte).is_ok() {
hprint!("{:02x}", addr).unwrap();
hprint!("{:02x}", addr);
} else {
hprint!("..").unwrap();
hprint!("..");
}
if addr % 0x10 == 0x0F {
hprintln!().unwrap();
hprintln!();
} else {
hprint!(" ").unwrap();
hprint!(" ");
}
}

hprintln!().unwrap();
hprintln!("Done!").unwrap();
hprintln!();
hprintln!("Done!");

loop {}
}
2 changes: 1 addition & 1 deletion examples/rng.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fn main() -> ! {
let p = pac::Peripherals::take().unwrap();
let mut rng = p.RNG.init();
let val = rng.get_rand().unwrap();
hprintln!("random value {}", val).unwrap();
hprintln!("random value {}", val);
loop {
core::hint::spin_loop();
}
Expand Down
2 changes: 1 addition & 1 deletion examples/rtc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ fn main() -> ! {
// rtc.set_minutes(59).unwrap();
// rtc.set_seconds(59).unwrap();
loop {
hprintln!("{}", rtc.get_datetime()).unwrap();
hprintln!("{}", rtc.get_datetime());
}
}
4 changes: 2 additions & 2 deletions examples/stm32f7disco-qspi-flash/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ fn memory_example_polling(mt25q: &mut mt25q::Mt25q) {
}
}

hprintln!("Flash device memory test successful!").unwrap();
hprintln!("Flash device memory test successful!");
}

fn memory_example_dma(
Expand Down Expand Up @@ -174,5 +174,5 @@ fn memory_example_dma(
}
}

hprintln!("Flash device memory DMA test successful!").unwrap();
hprintln!("Flash device memory DMA test successful!");
}
12 changes: 6 additions & 6 deletions examples/timer-periph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,32 +30,32 @@ fn main() -> ! {
let mut timer = dp.TIM1.counter_ms(&clocks);
timer.start(1.secs()).unwrap();

hprintln!("hello!").unwrap();
hprintln!("hello!");
// wait until timer expires
nb::block!(timer.wait()).unwrap();
hprintln!("timer expired 1").unwrap();
hprintln!("timer expired 1");

// the function counter_ms() creates a periodic timer, so it is automatically
// restarted
nb::block!(timer.wait()).unwrap();
hprintln!("timer expired 2").unwrap();
hprintln!("timer expired 2");

// cancel current timer
timer.cancel().unwrap();

// start it again
timer.start(1.secs()).unwrap();
nb::block!(timer.wait()).unwrap();
hprintln!("timer expired 3").unwrap();
hprintln!("timer expired 3");

timer.cancel().unwrap();
let cancel_outcome = timer.cancel();
assert_eq!(cancel_outcome, Err(Error::Disabled));
hprintln!("ehy, you cannot cancel a timer two times!").unwrap();
hprintln!("ehy, you cannot cancel a timer two times!");
// this time the timer was not restarted, therefore this function should
// wait forever
nb::block!(timer.wait()).unwrap();
// you should never see this print
hprintln!("if you see this there is something wrong").unwrap();
hprintln!("if you see this there is something wrong");
panic!();
}
12 changes: 6 additions & 6 deletions examples/timer-syst.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,32 +31,32 @@ fn main() -> ! {
let mut timer = cp.SYST.counter_us(&clocks);
timer.start(42.millis()).unwrap();

hprintln!("hello!").unwrap();
hprintln!("hello!");
// wait until timer expires
nb::block!(timer.wait()).unwrap();
hprintln!("timer expired 1").unwrap();
hprintln!("timer expired 1");

// the function syst() creates a periodic timer, so it is automatically
// restarted
nb::block!(timer.wait()).unwrap();
hprintln!("timer expired 2").unwrap();
hprintln!("timer expired 2");

// cancel current timer
timer.cancel().unwrap();

// start it again
timer.start(42.millis()).unwrap();
nb::block!(timer.wait()).unwrap();
hprintln!("timer expired 3").unwrap();
hprintln!("timer expired 3");

timer.cancel().unwrap();
let cancel_outcome = timer.cancel();
assert_eq!(cancel_outcome, Err(Error::Disabled));
hprintln!("ehy, you cannot cancel a timer two times!").unwrap();
hprintln!("ehy, you cannot cancel a timer two times!");
// this time the timer was not restarted, therefore this function should
// wait forever
nb::block!(timer.wait()).unwrap();
// you should never see this print
hprintln!("if you see this there is something wrong").unwrap();
hprintln!("if you see this there is something wrong");
panic!();
}
9 changes: 6 additions & 3 deletions examples/usb_serial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,14 @@ fn main() -> ! {
let mut serial = usbd_serial::SerialPort::new(&usb_bus);

let mut usb_dev = UsbDeviceBuilder::new(&usb_bus, UsbVidPid(0x16c0, 0x27dd))
.manufacturer("Fake company")
.product("Serial port")
.serial_number("TEST")
.strings(&[StringDescriptors::default()
.manufacturer("Fake company")
.product("Serial port")
.serial_number("TEST")
]).unwrap()
.device_class(usbd_serial::USB_CLASS_CDC)
.max_packet_size_0(64) // Size required for HS, and ok for FS
.unwrap()
.build();

loop {
Expand Down
Loading