Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
NickCao committed Aug 20, 2024
1 parent ddb9c3d commit 084a2f0
Show file tree
Hide file tree
Showing 12 changed files with 375 additions and 177 deletions.
File renamed without changes.
259 changes: 173 additions & 86 deletions application/Cargo.lock

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions application/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ keywords = ["no-std", "usb-device", "dfu"]
[dependencies]
cortex-m = "0.7.7"
cortex-m-rt = "0.7.3"
stm32f4xx-hal = { version = "0.15.0", features = ["stm32f411", "usb_fs", "rt"] }
stm32f4xx-hal = { version = "0.21.0", features = ["stm32f411", "usb_fs"] }
stm32f4 = { version = "0.15.1", features = ["stm32f411", "rt"]}
panic-halt= "0.2.0"
usb-device = { version="0.2.9", features = ["control-buffer-256"] }
usbd-serial = "0.1.1"
embedded-hal = "0.2.7"
usbd-dfu-rt = { version="0.3.1"}
usb-device = { version="0.3.2", features = ["control-buffer-256"] }
usbd-serial = "0.2.2"
embedded-hal = "1.0.0"
usbd-dfu-rt = { git = "https://github.com/ianrrees/usbd-dfu-rt.git", branch = "update-usb-device" }
arrform = "0.1.1"
cortex-m-rtic = "1.1.4"
systick-monotonic = "1.0.1"
ushell = "0.3.6"
heapless = "0.7.16"
heapless = "0.8.0"
panic-semihosting = "0.6.0"
arrayvec = { version="0.6.1", default-features=false } # anything beyond 0.6.1 fails for no_std
embedded-storage = "0.3.0"
num_enum = { version = "0.7.2", default-features = false }
arrayvec = { version="0.7.6", default-features=false }
embedded-storage = "0.3.1"
num_enum = { version = "0.7.3", default-features = false }
1 change: 1 addition & 0 deletions application/src/control.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ impl<B: UsbBus> UsbClass<B> for ControlClass {
USB_CLASS_VENDOR_SPECIFIC,
USB_SUBCLASS_JUMPSTARTER,
USB_PROTOCOL_JUMPSTARTER,
None,
)?;

writer.interface(
Expand Down
25 changes: 12 additions & 13 deletions application/src/ctlpins.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

use stm32f4xx_hal::gpio::DynamicPin;
use embedded_hal::digital::v2::OutputPin;
use embedded_hal::digital;
use stm32f4xx_hal::gpio::{self,DynamicPin};
use embedded_hal::digital::OutputPin;

// create an enum with 3 possibilities: High, Low, and Floating
// this is used to set the CTL pins to a specific state
Expand Down Expand Up @@ -89,40 +88,40 @@ where

fn _set_ctl_a(&mut self, state:PinState) {
match state {
PinState::High => self.ctl_a.make_push_pull_output_in_state(digital::v2::PinState::High),
PinState::Low => self.ctl_a.make_push_pull_output_in_state(digital::v2::PinState::Low),
PinState::High => self.ctl_a.make_push_pull_output_in_state(gpio::PinState::High),
PinState::Low => self.ctl_a.make_push_pull_output_in_state(gpio::PinState::Low),
PinState::Floating => self.ctl_a.make_floating_input(),
}
}

fn _set_ctl_b(&mut self, state: PinState) {
match state {
PinState::High => self.ctl_b.make_push_pull_output_in_state(digital::v2::PinState::High),
PinState::Low => self.ctl_b.make_push_pull_output_in_state(digital::v2::PinState::Low),
PinState::High => self.ctl_b.make_push_pull_output_in_state(gpio::PinState::High),
PinState::Low => self.ctl_b.make_push_pull_output_in_state(gpio::PinState::Low),
PinState::Floating => self.ctl_b.make_floating_input(),
}
}

fn _set_ctl_c(&mut self, state: PinState) {
match state {
PinState::High => self.ctl_c.make_push_pull_output_in_state(digital::v2::PinState::High),
PinState::Low => self.ctl_c.make_push_pull_output_in_state(digital::v2::PinState::Low),
PinState::High => self.ctl_c.make_push_pull_output_in_state(gpio::PinState::High),
PinState::Low => self.ctl_c.make_push_pull_output_in_state(gpio::PinState::Low),
PinState::Floating => self.ctl_c.make_floating_input(),
}
}

fn _set_ctl_d(&mut self, state: PinState) {
match state {
PinState::High => self.ctl_d.make_push_pull_output_in_state(digital::v2::PinState::High),
PinState::Low => self.ctl_d.make_push_pull_output_in_state(digital::v2::PinState::Low),
PinState::High => self.ctl_d.make_push_pull_output_in_state(gpio::PinState::High),
PinState::Low => self.ctl_d.make_push_pull_output_in_state(gpio::PinState::Low),
PinState::Floating => self.ctl_d.make_floating_input(),
}
}

fn _set_reset(&mut self, state: PinState) {
match state {
PinState::High => self.reset.make_push_pull_output_in_state(digital::v2::PinState::High),
PinState::Low => self.reset.make_push_pull_output_in_state(digital::v2::PinState::Low),
PinState::High => self.reset.make_push_pull_output_in_state(gpio::PinState::High),
PinState::Low => self.reset.make_push_pull_output_in_state(gpio::PinState::Low),
PinState::Floating => self.reset.make_floating_input(),
}
}
Expand Down
28 changes: 14 additions & 14 deletions application/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,11 @@ mod app {
usb_dp.set_low();
cortex_m::asm::delay(1024 * 50);

let usb_periph = USB {
usb_global: dp.OTG_FS_GLOBAL,
usb_device: dp.OTG_FS_DEVICE,
usb_pwrclk: dp.OTG_FS_PWRCLK,
hclk: clocks.hclk(),
pin_dm: gpioa.pa11.into_alternate(),
pin_dp: usb_dp.into_alternate(),
};
let usb_periph = USB::new(
(dp.OTG_FS_GLOBAL, dp.OTG_FS_DEVICE, dp.OTG_FS_PWRCLK),
(gpioa.pa11.into_alternate(), usb_dp.into_alternate()),
&clocks,
);

unsafe {
USB_BUS = Some(UsbBus::new(usb_periph, &mut EP_MEMORY));
Expand All @@ -212,13 +209,16 @@ mod app {
unsafe { USB_BUS.as_ref().unwrap() },
UsbVidPid(0x2b23, 0x1012),
)
.manufacturer("Red Hat Inc.")
.product("Jumpstarter")
.serial_number(get_serial_str())
.strings(&[
StringDescriptors::new(LangID::EN)
.manufacturer("Red Hat Inc.")
.product("Jumpstarter")
.serial_number(get_serial_str())
]).unwrap()
.device_release(version::usb_version_bcd_device())
.self_powered(false)
.max_power(250)
.max_packet_size_0(64)
.max_power(250).unwrap()
.max_packet_size_0(64).unwrap()
.build();

let shell = shell::new(serial1);
Expand Down Expand Up @@ -427,7 +427,7 @@ mod app {

ctx.shared
.timer
.lock(|tim| tim.clear_interrupt(timer::Event::Update));
.lock(|tim| tim.clear_flags(timer::Flag::Update));
}

#[task(binds = DMA2_STREAM0, shared=[adc_dma_transfer, power_meter], local=[adc_buffer])]
Expand Down
2 changes: 1 addition & 1 deletion application/src/shell.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use core::str;
use embedded_hal::digital::v2::OutputPin;
use embedded_hal::digital::OutputPin;
use core::fmt::Write;

use arrayvec::ArrayString;
Expand Down
2 changes: 1 addition & 1 deletion application/src/storage.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

use embedded_hal::digital::v2::OutputPin;
use embedded_hal::digital::OutputPin;

// Device control abstractions

Expand Down
File renamed without changes.
Loading

0 comments on commit 084a2f0

Please sign in to comment.