Skip to content

Commit

Permalink
Update the panel-protocol dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
bschwind committed Dec 19, 2023
1 parent 6698bf7 commit f5eebb4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
10 changes: 6 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ cortex-m = "0.7"
cortex-m-rt = "0.6"
panic-reset = "0.1"
nb = "1"
panel-protocol = { git = "https://github.com/tonarino/panel-protocol.git", rev = "0.4" }
panel-protocol = { git = "https://github.com/tonarino/panel-protocol.git", branch = "const-generics" }
usb-device = "0.2"
usbd-serial = "0.1"
libm = "0.2"
6 changes: 4 additions & 2 deletions src/serial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ use hal::{
otg_fs::{UsbBus, USB},
serial::{self},
};
use panel_protocol::{ArrayString, ArrayVec, MAX_COMMAND_LEN, MAX_COMMAND_QUEUE_LEN};
use panel_protocol::{ArrayString, ArrayVec, MAX_COMMAND_LEN};
pub use panel_protocol::{Command, CommandReader, Report};
use usb_device::{device::UsbDevice, UsbError};
use usbd_serial::SerialPort;

const MAX_COMMAND_QUEUE_LEN: usize = 8;

type Stm32F4UsbDevice = stm32f4xx_hal::otg_fs::UsbBus<stm32f4xx_hal::otg_fs::USB>;

#[derive(Debug)]
Expand Down Expand Up @@ -65,7 +67,7 @@ impl<'a> SerialProtocol<'a> {
}

/// Check to see if a new command from host is available
pub fn poll(&mut self) -> Result<ArrayVec<[Command; MAX_COMMAND_QUEUE_LEN]>, Error> {
pub fn poll(&mut self) -> Result<ArrayVec<Command, MAX_COMMAND_QUEUE_LEN>, Error> {
self.usb_device.poll(&mut [&mut self.usb_serial_device]);

match self.usb_serial_device.read(&mut self.read_buf[..]) {
Expand Down

0 comments on commit f5eebb4

Please sign in to comment.