File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -270,7 +270,7 @@ impl I2S {
270270 B : WriteBuffer < Word = W > ,
271271 {
272272 let ( ptr, len) = unsafe { buffer. write_buffer ( ) } ;
273- if ptr as u32 & 3 != 0 {
273+ if ptr as u32 % 4 != 0 {
274274 return Err ( Error :: BufferMisaligned ) ;
275275 }
276276 let maxcnt = ( len / ( core:: mem:: size_of :: < u32 > ( ) / core:: mem:: size_of :: < W > ( ) ) ) as u32 ;
@@ -305,7 +305,7 @@ impl I2S {
305305 {
306306 let ( rx_ptr, rx_len) = unsafe { rx_buffer. write_buffer ( ) } ;
307307 let ( tx_ptr, tx_len) = unsafe { tx_buffer. read_buffer ( ) } ;
308- if tx_ptr as u32 & 3 != 0 || rx_ptr as u32 & 3 != 0 {
308+ if tx_ptr as u32 % 4 != 0 || rx_ptr as u32 % 4 != 0 {
309309 return Err ( Error :: BufferMisaligned ) ;
310310 }
311311 let maxcnt = ( tx_len / ( core:: mem:: size_of :: < u32 > ( ) / core:: mem:: size_of :: < W > ( ) ) ) as u32 ;
@@ -348,7 +348,7 @@ impl I2S {
348348 B : ReadBuffer < Word = W > ,
349349 {
350350 let ( ptr, len) = unsafe { buffer. read_buffer ( ) } ;
351- if ptr as u32 & 3 != 0 {
351+ if ptr as u32 % 4 != 0 {
352352 return Err ( Error :: BufferMisaligned ) ;
353353 }
354354 let maxcnt = ( len / ( core:: mem:: size_of :: < u32 > ( ) / core:: mem:: size_of :: < W > ( ) ) ) as u32 ;
You can’t perform that action at this time.
0 commit comments