File tree Expand file tree Collapse file tree
libs/cramium-hal/src/udma Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -303,10 +303,6 @@ impl<'a> I2c<'a> {
303303 }
304304
305305 pub fn reset ( & mut self ) {
306- // reset the block
307- self . udma_reset ( Bank :: Custom ) ;
308- self . udma_reset ( Bank :: Tx ) ;
309- self . udma_reset ( Bank :: Rx ) ;
310306 // reset the block, if MPW. If NTO, this needs to be handled by the upper level code with a
311307 // reset to udma_global
312308 #[ cfg( feature = "mpw" ) ]
@@ -323,6 +319,19 @@ impl<'a> I2c<'a> {
323319 I2cChannel :: Channel3 => PeriphId :: I2c3 ,
324320 } ) ;
325321 }
322+ for _i in 0 ..20 {
323+ // dummy read
324+ let _ = self . csr . rf ( utra:: udma_i2c_0:: REG_STATUS_R_BUSY ) ;
325+ }
326+ // reset the block
327+ self . udma_reset ( Bank :: Custom ) ;
328+ self . udma_reset ( Bank :: Tx ) ;
329+ self . udma_reset ( Bank :: Rx ) ;
330+
331+ for _i in 0 ..20 {
332+ // dummy read
333+ let _ = self . csr . rf ( utra:: udma_i2c_0:: REG_STATUS_R_BUSY ) ;
334+ }
326335
327336 self . send_cmd_list ( & [ I2cCmd :: Config ( self . divider ) ] ) ;
328337 self . pending . take ( ) ;
You can’t perform that action at this time.
0 commit comments