Modified library for ESP32 native TWAI driver#11
Closed
BWV999-MTL wants to merge 10 commits intoodriverobotics:masterfrom
Closed
Modified library for ESP32 native TWAI driver#11BWV999-MTL wants to merge 10 commits intoodriverobotics:masterfrom
BWV999-MTL wants to merge 10 commits intoodriverobotics:masterfrom
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.
Wetmelon
reviewed
Feb 14, 2025
Wetmelon
reviewed
Feb 14, 2025
Wetmelon
reviewed
Feb 14, 2025
Wetmelon
reviewed
Feb 14, 2025
Wetmelon
reviewed
Feb 14, 2025
Wetmelon
requested changes
Feb 14, 2025
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);
|
|
samuelsadok
reviewed
Apr 24, 2025
Member
samuelsadok
left a comment
There was a problem hiding this comment.
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 examplesendMsgcan 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.
Member
|
Superseded by #20. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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