-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add support for CAN to SiLabs targets #10468
Conversation
@petroborys, thank you for your changes. |
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.
A minor change request for getting peripheral usage in line & forwards compatible with products that potentially only have one CAN interface. Otherwise, looking good!
I'll open a PR for updating emlib to latest, since the rest of emlib now looks pretty out-of-date.
@@ -136,6 +136,13 @@ typedef enum { | |||
} UARTName; | |||
#endif | |||
|
|||
#if DEVICE_CAN | |||
typedef enum { | |||
CAN_0 = (int)CAN0_BASE, |
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.
Please guard each enum entry with the respective base address define, in line with the other definitions in this file
} | ||
} | ||
|
||
void CAN0_IRQHandler(void) |
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.
Please wrap in respective peripheral base definition, as this shouldn't be there if there is no (for example) CAN1.
} | ||
|
||
switch ((CANName)obj->instance) { | ||
case CAN_0: |
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.
Usage of enum values should be wrapped and compiled in/out based on whether the base peripheral is present or not.
CAN_MessageIntClear(obj->instance, 0xFFFFFFFF); | ||
|
||
switch ((CANName)obj->instance) { | ||
case CAN_0: |
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.
Same here, please wrap in presence of the base peripheral
int index = 0; | ||
|
||
switch ((CANName)obj->instance) { | ||
case CAN_0: |
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.
Same here, please wrap in presence of base peripheral
|
||
CMU_Clock_TypeDef cmuClock_number; | ||
switch ((CANName)obj->instance) { | ||
case CAN_0: |
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.
Should be wrapped based on presence of base peripheral
Thank for your review. I have made all the changes. |
CI started |
Test run: FAILEDSummary: 2 of 7 test jobs failed Failed test jobs:
|
Please review build failures (build artifacts above) |
Thank. Done. |
CI started |
I've noticed the commit messages (1-10) - what do the numbers mean? It would make sense to provide more meaningful commit messages instead. Either to squash them or rewrite. |
Just numeration.
Ok, sure |
Test run: FAILEDSummary: 1 of 11 test jobs failed Failed test jobs:
|
Done. |
I didn't see any error in the logs. |
Will restart tests later today |
CI started |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
Description
Added support for CAN to SiLabs targets
Pull request type
Release Notes
Tested on the EFM32GG11_STK3701