-
Notifications
You must be signed in to change notification settings - Fork 3
Add cy_can module implementing Cyphal/CAN #48
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
Merged
Merged
Changes from 16 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
6546f6a
Initial implementation of cy_can, WIP, first stab
pavel-kirienko 4c49d97
cleanup
pavel-kirienko aa80c4b
add clarification comments to cy_udp_posix regarding tombstoning
pavel-kirienko 87925c3
advance CAN
pavel-kirienko 780f114
scaffolding tests for cy_can
pavel-kirienko a6fa7cb
simplify cycan
pavel-kirienko 5969812
CAN filtering
pavel-kirienko d2d93e3
restructure platform glue libraries and examples
pavel-kirienko 83f5219
README
pavel-kirienko e172091
Add independent cy_can API test suite
pavel-kirienko a67e98f
remove is_tombstoned()
pavel-kirienko 987213d
update libcanard
pavel-kirienko 65ad5ea
Cy UDP POSIX tests
pavel-kirienko 58b86f3
Add CAN tombstone revival tests
pavel-kirienko 5737193
examples: support runtime transport selection
pavel-kirienko f18c8f8
examples: free config arrays on early exit
pavel-kirienko 1da0538
Guard SocketCAN behind Linux check #yolo
pavel-kirienko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # Copyright (c) Pavel Kirienko | ||
|
|
||
| cmake_minimum_required(VERSION 3.24) | ||
| project(cy_can C) | ||
|
|
||
| include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/lib") | ||
|
|
||
| # Libcanard static library. | ||
| add_library(canard STATIC "${CMAKE_SOURCE_DIR}/lib/libcanard/libcanard/canard.c") | ||
| target_compile_options(canard PRIVATE -Wno-cast-align) | ||
| target_include_directories(canard SYSTEM INTERFACE ${CMAKE_SOURCE_DIR}/lib/libcanard/libcanard) | ||
| set_target_properties( | ||
| canard | ||
| PROPERTIES | ||
| COMPILE_WARNING_AS_ERROR OFF | ||
| C_STANDARD_REQUIRED ON | ||
| C_EXTENSIONS OFF | ||
| C_CLANG_TIDY "" | ||
| CXX_CLANG_TIDY "" | ||
| C_CPPCHECK "" | ||
| CXX_CPPCHECK "" | ||
| ) | ||
|
|
||
| # Platform-agnostic CAN transport glue static library. | ||
| # Consumers link cy/cy.c themselves; this target only contains the transport/platform layer. | ||
| add_library(cy_can STATIC cy_can.c) | ||
| target_link_libraries(cy_can PUBLIC canard) | ||
| target_include_directories(cy_can PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/cy) | ||
| set_target_properties(cy_can PROPERTIES COMPILE_WARNING_AS_ERROR ON C_STANDARD_REQUIRED ON C_EXTENSIONS OFF) | ||
|
|
||
| # Linux SocketCAN backend for cy_can. Includes cy_can and canard, making it self-contained except for cy.c. | ||
| add_library(cy_can_socketcan STATIC cy_can_socketcan.c) | ||
| target_link_libraries(cy_can_socketcan PUBLIC cy_can) | ||
| set_target_properties(cy_can_socketcan PROPERTIES COMPILE_WARNING_AS_ERROR ON C_STANDARD_REQUIRED ON C_EXTENSIONS OFF) | ||
|
|
||
| add_subdirectory(tests) | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.