Skip to content

Commit

Permalink
Fix incorrect order of FlashBuffer type parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
DBLouis committed Aug 14, 2024
1 parent 384b70c commit 285759a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions esp-storage/src/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ pub type FlashSectorBuffer = FlashBuffer<4096, 1024>;

#[repr(C)]
pub union FlashBuffer<const N: usize, const M: usize> {
bytes: [MaybeUninit<u8>; M],
words: [MaybeUninit<u32>; N],
bytes: [MaybeUninit<u8>; N],
words: [MaybeUninit<u32>; M],
}

impl<const N: usize, const M: usize> FlashBuffer<N, M> {
pub const fn uninit() -> Self {
debug_assert!(N * 4 == M);
assert!(N == M * 4);
Self {
words: [MaybeUninit::uninit(); N],
words: [MaybeUninit::uninit(); M],
}
}

Expand Down

0 comments on commit 285759a

Please sign in to comment.