-
Notifications
You must be signed in to change notification settings - Fork 2k
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
tests/drivers/candev: minor cleanup #21175
base: master
Are you sure you want to change the base?
Conversation
Murdock results❌ FAILED 8d0ac30 tests/drivers/candev: minor cleanup
Build failures (1)
Artifacts |
- Do not hard code the number of the CAN interface to use. (This also allows specifying it via make command line / environment variable.) - Make less use of preprocessor and rely on compiler to eliminate dead branches and unused variables.
99715d7
to
8d0ac30
Compare
#else | ||
/* add includes for other candev drivers here */ | ||
#ifdef BOARD_SAME54_XPRO | ||
# include "periph/gpio.h" |
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.
Why only for this board?
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.
That is annoying, isn't it?
I'll add a __attribute__((weak)) board_enable_can_transceiver(can_t *dev);
and a __attribute__((weak)) board_disable_can_transceiver(can_t *dev);
into the periph_can
driver, so that we do not need to have magic stuff at application level, but rather let the board hook into can_init()
.
But that is not independent of this PR and will be a follow up.
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.
We already have a CAN transceiver interface, it's just not integrated with candev 😩
Contribution description
Testing procedure
The test should behave as before. (Unless one would pass e.g.
CAN_DEV=1
, in which case the 2nd CAN interface would be used instead of the first.)Issues/PRs references
None