Skip to content

Commit

Permalink
Merge pull request #35 from ssp-rs/fixup/firmware-minor
Browse files Browse the repository at this point in the history
fixup: firmware: minor convenience functions
  • Loading branch information
ssp-rs authored Dec 22, 2023
2 parents 0185ee2 + c13f577 commit 1a9acff
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/types/firmware/ram.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,16 @@ impl FirmwareRam {
pub const fn index(&self) -> usize {
self.index
}

/// Gets the length of the [FirmwareRam] buffer.
pub fn len(&self) -> usize {
self.block.len()
}

/// Gets whether the [FirmwareRam] buffer is empty.
pub fn is_empty(&self) -> bool {
self.block.is_empty()
}
}

impl TryFrom<&[u8]> for FirmwareRam {
Expand Down

0 comments on commit 1a9acff

Please sign in to comment.