Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kofls committed Jul 27, 2024
1 parent 95679e3 commit 57a4c47
Show file tree
Hide file tree
Showing 5 changed files with 310 additions and 313 deletions.
3 changes: 1 addition & 2 deletions crates/board/src/usb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
#[cfg(feature = "api-usb-serial")]
pub mod serial;

// TODO: Should this also be gated behind api-usb-serial feature or should it be
// a different one?
#[cfg(feature = "api-usb-ctap")]
pub mod ctap;

/// USB event.
Expand Down
6 changes: 3 additions & 3 deletions crates/board/src/usb/ctap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ pub trait Api: Send {
/// Reads from the USB serial into a buffer.
///
/// Returns the number of bytes read. It could be zero if there's nothing to read.
fn read(output: &mut [u8]) -> Result<usize, Error>;
fn read(output: &mut [u8; 64]) -> Result<usize, Error>;

/// Writes from a buffer to the USB serial.
///
/// Returns the number of bytes written. It could be zero if the other side is not ready.
fn write(input: &[u8]) -> Result<usize, Error>;
fn write(input: &[u8; 64]) -> Result<usize, Error>;
}

pub trait HasCtapHid: Send {
Expand All @@ -60,7 +60,7 @@ pub trait HasCtapHid: Send {
/// Wrapper type for boards using the `usbd_ctaphid` crate.
pub struct WithCtapHid<T: HasCtapHid> {
_never: !,
_has_serial: T,
_has_ctap: T,
}

/// Helper struct for boards using the `usbd_ctaphid` crate.
Expand Down
1 change: 1 addition & 0 deletions crates/prelude/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ api-store = ["internal-api-store", "wasefire-applet-api/api-store"]
api-store-fragment = ["internal-api-store", "wasefire-applet-api/api-store-fragment"]
api-timer = ["wasefire-applet-api/api-timer"]
api-uart = ["internal-serial", "wasefire-applet-api/api-uart"]
api-usb-ctap = ["internal-api-usb", "internal-serial", "wasefire-applet-api/api-usb-ctap"]
api-usb-serial = ["internal-api-usb", "internal-serial", "wasefire-applet-api/api-usb-serial"]
# Enables all API features.
full-api = [
Expand Down
Loading

0 comments on commit 57a4c47

Please sign in to comment.