This repository was archived by the owner on Aug 9, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +9
-13
lines changed Expand file tree Collapse file tree 1 file changed +9
-13
lines changed Original file line number Diff line number Diff line change 77
77
// Clear all I2C interrupts
78
78
i2c. 0 . int_clr . write ( |w| unsafe { w. bits ( 0x3FFF ) } ) ;
79
79
80
- // enable I2C_ACK_ERR_INT
81
- i2c. 0 . int_ena . write ( |w| w. ack_err_int_ena ( ) . set_bit ( ) ) ;
82
-
83
80
i2c. 0 . ctr . modify ( |_, w| unsafe {
84
81
// Clear register
85
82
w. bits ( 0 )
@@ -265,7 +262,7 @@ where
265
262
w. command1 ( ) . bits (
266
263
Command :: Write {
267
264
ack_exp : Ack :: ACK ,
268
- ack_check_en : true ,
265
+ ack_check_en : false ,
269
266
length : 1 + bytes. len ( ) as u8
270
267
} . into ( )
271
268
)
@@ -311,7 +308,7 @@ where
311
308
self . 0 . comd1 . write ( |w| unsafe {
312
309
w. command1 ( ) . bits ( Command :: Write {
313
310
ack_exp : Ack :: ACK ,
314
- ack_check_en : true ,
311
+ ack_check_en : false ,
315
312
length : 1 ,
316
313
} . into ( ) )
317
314
} ) ;
@@ -424,7 +421,7 @@ where
424
421
self . 0 . comd1 . write ( |w| unsafe {
425
422
w. command1 ( ) . bits ( Command :: Write {
426
423
ack_exp : Ack :: ACK ,
427
- ack_check_en : true ,
424
+ ack_check_en : false ,
428
425
length : 1 + bytes. len ( ) as u8 ,
429
426
} . into ( ) )
430
427
} ) ;
@@ -441,7 +438,7 @@ where
441
438
self . 0 . comd3 . write ( |w| unsafe {
442
439
w. command3 ( ) . bits ( Command :: Write {
443
440
ack_exp : Ack :: ACK ,
444
- ack_check_en : true ,
441
+ ack_check_en : false ,
445
442
length : 1 ,
446
443
} . into ( ) )
447
444
} ) ;
@@ -625,12 +622,11 @@ impl From<Command> for u16 {
625
622
626
623
let mut cmd: u16 = length. into ( ) ;
627
624
628
- // TODO: Disabling until we figure out how to get the ack checks to work properly
629
- // if ack_check_en {
630
- // cmd |= 1 << 8;
631
- // } else {
632
- // cmd &= !(1 << 8);
633
- // }
625
+ if ack_check_en {
626
+ cmd |= 1 << 8 ;
627
+ } else {
628
+ cmd &= !( 1 << 8 ) ;
629
+ }
634
630
635
631
if ack_exp == Ack :: NACK {
636
632
cmd |= 1 << 9 ;
You can’t perform that action at this time.
0 commit comments