Skip to content

Commit

Permalink
reset mode settings in bit-mode switch
Browse files Browse the repository at this point in the history
  • Loading branch information
Paval-from-Belarus committed Dec 24, 2024
1 parent 191efb4 commit c886951
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/can/filter/bit32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ use embedded_can::Id;
use super::{Bit16Mode, Bit32Mode, CanFilter, FilterMode, FilterOptions, ListMode, MaskMode};

impl<MODE: FilterMode> CanFilter<Bit32Mode, MODE> {
/// Convert filter to 16bit mode
/// Register values in selected bank will be reset
pub fn use_16bit(self) -> CanFilter<Bit16Mode, MODE> {
CanFilter {
id_mask: self.id_mask,
id_value: self.id_value,
id_mask: 0,
id_value: 0,
mode: self.mode,
bank: self.bank,
bit_mode: PhantomData,
Expand All @@ -28,6 +30,7 @@ impl CanFilter<Bit32Mode, ListMode> {
}
}

/// Create a filter to configure id list
pub fn new_id_list() -> Self {
Self {
bank: 0,
Expand Down

0 comments on commit c886951

Please sign in to comment.