Skip to content

Commit

Permalink
nec: debug: Add repeat state to NecDebugCmd
Browse files Browse the repository at this point in the history
Add repeat flag to the Nec debug cmd to allow differentiating
between a repeat press and all 0 bits.
  • Loading branch information
sjoerdsimons committed Feb 9, 2024
1 parent b0cb9e3 commit e0217e2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/protocol/nec/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use crate::protocol::nec::{NecCommandVariant, NecPulseLen, NEC_STANDARD_TIMING};
/// Nec Command without parsing of bit meaning
pub struct NecDebugCmd {
pub bits: u32,
pub repeat: bool,
}

impl NecCommandVariant for NecDebugCmd {
Expand All @@ -16,8 +17,8 @@ impl NecCommandVariant for NecDebugCmd {
true
}

fn unpack(bits: u32, _repeat: bool) -> Option<Self> {
Some(NecDebugCmd { bits })
fn unpack(bits: u32, repeat: bool) -> Option<Self> {
Some(NecDebugCmd { bits, repeat })
}

fn pack(&self) -> u32 {
Expand Down

0 comments on commit e0217e2

Please sign in to comment.