-
Notifications
You must be signed in to change notification settings - Fork 22
Modified library for ESP32 native TWAI driver #11
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
base: master
Are you sure you want to change the base?
Conversation
created two new files to go with the OdriveArduino library. TWAI_CAN_Class.h and ODriveESP32TWAI.hpp. They enable the use of the native TWAI drivers of the Arduino core for the ESP32. It enables the use of a simple transceiver like an SN65HVD230 instead of requiring an SPI interface. Also the sine wave sketch is updated to add the corresponding board-specific include and setting sections.
As per suggestions in pull-request comments
Updated as per suggestions from pull request review
as per suggestions
updated as per suggestions
default node ID for default sketch
standard formatting
added this line back wich was deleted by accident in previous commit : twai_general_config_t g_config = TWAI_GENERAL_CONFIG_DEFAULT((gpio_num_t)TX_PIN, (gpio_num_t)RX_PIN, TWAI_MODE_NORMAL);
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some additional clean-up is needed for this.
- Please assimilate TWAI_CAN_Class.h into ODriveESP32TWAI.hpp. This looks like a glue layer on top of a glue layer, which adds unnecessary complexity. There should be no intermediate
TWAIClass
, instead for examplesendMsg
can assemble the packet and calltwai_transmit()
directly. - If possible, please add a PlatformIO compile target for an ESP32 board, so that this is tested in CI.
- Please remove changes in SineWaveCAN.ino that are not directly related to ESP32 support. If you think there are some important unrelated changes in there, please put them into a separate PR.
- Once finished, please rebase into 1-3 commits with a short descriptive commit message.
For a concise example, you can have a look at #12.
created two new files to go with the OdriveArduino library. TWAI_CAN_Class.h and ODriveESP32TWAI.hpp. They enable the use of the native TWAI drivers of the Arduino core for the ESP32. It enables the use of a simple transceiver like an SN65HVD230 instead of requiring an SPI interface.
The main sketch is updated to add the corresponding board-specific include and setting sections.
The indentation of the board specific settings was also modified to enable code folding in Arduino IDE 2.
Changed the Serial Begin to wait for communication to open but allow execution after a certain amount of time