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 {
270
270
B : WriteBuffer < Word = W > ,
271
271
{
272
272
let ( ptr, len) = unsafe { buffer. write_buffer ( ) } ;
273
- if ptr as u32 & 3 != 0 {
273
+ if ptr as u32 % 4 != 0 {
274
274
return Err ( Error :: BufferMisaligned ) ;
275
275
}
276
276
let maxcnt = ( len / ( core:: mem:: size_of :: < u32 > ( ) / core:: mem:: size_of :: < W > ( ) ) ) as u32 ;
@@ -305,7 +305,7 @@ impl I2S {
305
305
{
306
306
let ( rx_ptr, rx_len) = unsafe { rx_buffer. write_buffer ( ) } ;
307
307
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 {
309
309
return Err ( Error :: BufferMisaligned ) ;
310
310
}
311
311
let maxcnt = ( tx_len / ( core:: mem:: size_of :: < u32 > ( ) / core:: mem:: size_of :: < W > ( ) ) ) as u32 ;
@@ -348,7 +348,7 @@ impl I2S {
348
348
B : ReadBuffer < Word = W > ,
349
349
{
350
350
let ( ptr, len) = unsafe { buffer. read_buffer ( ) } ;
351
- if ptr as u32 & 3 != 0 {
351
+ if ptr as u32 % 4 != 0 {
352
352
return Err ( Error :: BufferMisaligned ) ;
353
353
}
354
354
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