Skip to content

Commit

Permalink
Merge pull request #27 from burrbull/helpers-alpha6
Browse files Browse the repository at this point in the history
fix Delay in helpers mod
  • Loading branch information
ryankurte committed Feb 1, 2022
2 parents b52669f + 6e04a2a commit 3e4e505
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
18 changes: 6 additions & 12 deletions src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ where
+ Receive<Info = I, Error = E>
+ Rssi<Error = E>
+ Power<Error = E>
+ DelayUs<u32, Error = E>,
+ DelayUs<Error = E>,
I: ReceiveInfo + Default + std::fmt::Debug,
E: std::fmt::Debug,
{
Expand Down Expand Up @@ -95,7 +95,7 @@ pub struct TransmitOptions {

pub fn do_transmit<T, E>(radio: &mut T, options: TransmitOptions) -> Result<(), BlockingError<E>>
where
T: Transmit<Error = E> + Power<Error = E> + DelayUs<u32, Error = E>,
T: Transmit<Error = E> + Power<Error = E> + DelayUs<Error = E>,
E: core::fmt::Debug,
{
// Set output power if specified
Expand Down Expand Up @@ -210,7 +210,7 @@ pub fn do_receive<T, I, E>(
options: ReceiveOptions,
) -> Result<usize, E>
where
T: Receive<Info = I, Error = E> + DelayUs<u32, Error = E>,
T: Receive<Info = I, Error = E> + DelayUs<Error = E>,
I: std::fmt::Debug,
E: std::fmt::Debug,
{
Expand Down Expand Up @@ -273,7 +273,7 @@ pub struct RssiOptions {

pub fn do_rssi<T, I, E>(radio: &mut T, options: RssiOptions) -> Result<(), E>
where
T: Receive<Info = I, Error = E> + Rssi<Error = E> + DelayUs<u32, Error = E>,
T: Receive<Info = I, Error = E> + Rssi<Error = E> + DelayUs<Error = E>,
I: std::fmt::Debug,
E: std::fmt::Debug,
{
Expand Down Expand Up @@ -327,10 +327,7 @@ pub fn do_echo<T, I, E>(
options: EchoOptions,
) -> Result<usize, BlockingError<E>>
where
T: Receive<Info = I, Error = E>
+ Transmit<Error = E>
+ Power<Error = E>
+ DelayUs<u32, Error = E>,
T: Receive<Info = I, Error = E> + Transmit<Error = E> + Power<Error = E> + DelayUs<Error = E>,
I: ReceiveInfo + std::fmt::Debug,
E: std::fmt::Debug,
{
Expand Down Expand Up @@ -414,10 +411,7 @@ pub fn do_ping_pong<T, I, E>(
options: PingPongOptions,
) -> Result<LinkTestInfo, BlockingError<E>>
where
T: Receive<Info = I, Error = E>
+ Transmit<Error = E>
+ Power<Error = E>
+ DelayUs<u32, Error = E>,
T: Receive<Info = I, Error = E> + Transmit<Error = E> + Power<Error = E> + DelayUs<Error = E>,
I: ReceiveInfo,
E: std::fmt::Debug,
{
Expand Down
2 changes: 1 addition & 1 deletion src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ impl<St, Inf, Irq, E> From<Option<E>> for Response<St, Inf, Irq, E> {
}
}

impl<St, Reg, Ch, Inf, Irq, E> DelayUs<u32> for Radio<St, Reg, Ch, Inf, Irq, E>
impl<St, Reg, Ch, Inf, Irq, E> DelayUs for Radio<St, Reg, Ch, Inf, Irq, E>
where
St: PartialEq + Debug + Clone,
Reg: PartialEq + Debug + Clone,
Expand Down

0 comments on commit 3e4e505

Please sign in to comment.