Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve the busheavy issue when the ESP32 chip revision >=2 #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/CAN.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
*
*/

#include "esp_system.h"
#include "CAN.h"

#include "freertos/FreeRTOS.h"
Expand Down Expand Up @@ -228,6 +229,14 @@ int CAN_init() {
// enable all interrupts
MODULE_CAN->IER.U = 0xff;

esp_chip_info_t chip_info;
esp_chip_info(&chip_info);
if(chip_info.revision >=2){
// disable wake-up interrupt
// refer to https://github.com/sandeepmistry/arduino-CAN/issues/75 for the original information
MODULE_CAN->IER.B.WUIE = 0x0;
}

// Set acceptance filter
MODULE_CAN->MOD.B.AFM = __filter.FM;
MODULE_CAN->MBX_CTRL.ACC.CODE[0] = __filter.ACR0;
Expand Down