properly reset module

danielkucera "It looks like the module is much more stable when reset bit is first set and then cleared."
This commit is contained in:
Sam Perry 2022-09-09 08:04:55 -04:00 committed by GitHub
parent c2d6b13103
commit 5415ff65c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -171,6 +171,7 @@ int CAN_init() {
// enable module
DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_CAN_CLK_EN);
DPORT_SET_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_CAN_RST);
DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_CAN_RST);
// configure TX pin