use bitfield instead of strum

This commit is contained in:
2026-08-27 10:52:52 +08:00
parent 86373a2d33
commit f523b7d394
9 changed files with 83 additions and 80 deletions
+1 -1
View File
@@ -199,7 +199,7 @@ impl<B: Interface, const N: usize> Pn532<B, N> {
/// return error if current buffer contains an error code
pub(crate) fn validate_buffer(&self, len: usize) -> Result<(), Error<B::TransportError>> {
if len == 0 || (self.buffer[0] & 0x3F) != 0 {
Err(Error::Status(StatusCode::from_repr(self.buffer[0] & 0x3F).unwrap()))
Err(Error::Status(StatusCode::from_bits(self.buffer[0] & 0x3F)))
} else {
Ok(())
}