mirror of
https://github.com/apache/nuttx.git
synced 2025-01-13 10:58:49 +08:00
[FlexCAN] Correct reset state for CTRL1 register
This commit is contained in:
parent
7758f3dcb1
commit
4dd457854d
2 changed files with 18 additions and 0 deletions
|
@ -1579,6 +1579,15 @@ static int kinetis_initialize(struct kinetis_driver_s *priv)
|
|||
return -1;
|
||||
}
|
||||
|
||||
/* Reset CTRL1 register to reset value */
|
||||
|
||||
regval = getreg32(priv->base + KINETIS_CAN_CTRL1_OFFSET);
|
||||
regval &= ~(CAN_CTRL1_LOM | CAN_CTRL1_LBUF | CAN_CTRL1_TSYN |
|
||||
CAN_CTRL1_BOFFREC | CAN_CTRL1_SMP | CAN_CTRL1_RWRNMSK |
|
||||
CAN_CTRL1_TWRNMSK | CAN_CTRL1_LPB | CAN_CTRL1_ERRMSK |
|
||||
CAN_CTRL1_BOFFMSK);
|
||||
putreg32(regval, priv->base + KINETIS_CAN_CTRL1_OFFSET);
|
||||
|
||||
#ifndef CONFIG_NET_CAN_CANFD
|
||||
regval = getreg32(priv->base + KINETIS_CAN_CTRL1_OFFSET);
|
||||
|
||||
|
|
|
@ -1582,6 +1582,15 @@ static int s32k1xx_initialize(struct s32k1xx_driver_s *priv)
|
|||
return -1;
|
||||
}
|
||||
|
||||
/* Reset CTRL1 register to reset value */
|
||||
|
||||
regval = getreg32(priv->base + S32K1XX_CAN_CTRL1_OFFSET);
|
||||
regval &= ~(CAN_CTRL1_LOM | CAN_CTRL1_LBUF | CAN_CTRL1_TSYN |
|
||||
CAN_CTRL1_BOFFREC | CAN_CTRL1_SMP | CAN_CTRL1_RWRNMSK |
|
||||
CAN_CTRL1_TWRNMSK | CAN_CTRL1_LPB | CAN_CTRL1_ERRMSK |
|
||||
CAN_CTRL1_BOFFMSK);
|
||||
putreg32(regval, priv->base + S32K1XX_CAN_CTRL1_OFFSET);
|
||||
|
||||
#ifndef CONFIG_NET_CAN_CANFD
|
||||
regval = getreg32(priv->base + S32K1XX_CAN_CTRL1_OFFSET);
|
||||
|
||||
|
|
Loading…
Reference in a new issue