acan-esp32 icon indicating copy to clipboard operation
acan-esp32 copied to clipboard

Problems with the library ACAN-ESP32.cpp for ESP32-S3

Open Kether180 opened this issue 11 months ago • 1 comments

I' having some issues trying to use the CAN library with my ESP32-S3. When I run the ino file it gives me these errors .

new bugs : C:\Users\gag_a\Documents\Arduino\libraries\ACAN_ESP32\src\ACAN_ESP32.cpp: In member function 'uint32_t ACAN_ESP32::begin(const ACAN_ESP32_Settings&, const ACAN_ESP32_Filter&)': C:\Users\gag_a\Documents\Arduino\libraries\ACAN_ESP32\src\ACAN_ESP32.cpp:149:25: error: 'PERIPH_TWAI_MODULE' was not declared in this scope periph_module_enable (PERIPH_TWAI_MODULE) ; ^~~~~~~~~~~~~~~~~~ C:\Users\gag_a\Documents\Arduino\libraries\ACAN_ESP32\src\ACAN_ESP32.cpp:149:3: error: 'periph_module_enable' was not declared in this scope periph_module_enable (PERIPH_TWAI_MODULE) ; ^~~~~~~~~~~~~~~~~~~~ C:\Users\gag_a\Documents\Arduino\libraries\ACAN_ESP32\src\ACAN_ESP32.cpp:149:3: note: suggested alternative: 'dhcps_router_enabled' periph_module_enable (PERIPH_TWAI_MODULE) ; ^~~~~~~~~~~~~~~~~~~~ dhcps_router_enabled C:\Users\gag_a\Documents\Arduino\libraries\ACAN_ESP32\src\ACAN_ESP32.cpp:205:19: error: 'ETS_TWAI_INTR_SOURCE' was not declared in this scope esp_intr_alloc (ETS_TWAI_INTR_SOURCE, 0, isr, this, & mInterruptHandler) ; ^~~~~~~~~~~~~~~~~~~~ C:\Users\gag_a\Documents\Arduino\libraries\ACAN_ESP32\src\ACAN_ESP32.cpp:205:19: note: suggested alternative: 'ETS_INTERNAL_SW0_INTR_SOURCE' esp_intr_alloc (ETS_TWAI_INTR_SOURCE, 0, isr, this, & mInterruptHandler) ; ^~~~~~~~~~~~~~~~~~~~ ETS_INTERNAL_SW0_INTR_SOURCE exit status 1 Compilation error: exit status 1

I tried to edit the downloaded library as a momentary fix but I was wondering if you have a long term fix solution . These are the lines I had to commented so that the library could work ACAN-ESP32.cpp .

**// periph_module_enable(PERIPH_TWAI_MODULE);

// esp_intr_alloc(ETS_TWAI_INTR_SOURCE, 0, isr, this, &mInterruptHandler);**

Let me know if you have an updated solution that I can use.

Thanks

Kether180 avatar Mar 12 '24 00:03 Kether180