Skip to content
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

Merged
merged 3 commits into from
May 7, 2019
Merged

Conversation

petroborys
Copy link
Contributor

Description

Added support for CAN to SiLabs targets

Pull request type

[ ] Fix
[ ] Refactor
[x] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Release Notes

Tested on the EFM32GG11_STK3701

@ciarmcom ciarmcom requested a review from a team April 25, 2019 11:07
@ciarmcom
Copy link
Member

@petroborys, thank you for your changes.
@ARMmbed/mbed-os-maintainers please review.

Copy link
Contributor

@stevew817 stevew817 left a 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,
Copy link
Contributor

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)
Copy link
Contributor

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:
Copy link
Contributor

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:
Copy link
Contributor

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:
Copy link
Contributor

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:
Copy link
Contributor

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

@petroborys
Copy link
Contributor Author

Thank for your review. I have made all the changes.
In EmLib 5.3.3. do not read message ID (in CAN_ReadMessage).

@adbridge
Copy link
Contributor

CI started

@mbed-ci
Copy link

mbed-ci commented Apr 29, 2019

Test run: FAILED

Summary: 2 of 7 test jobs failed
Build number : 1
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_build-IAR
  • jenkins-ci/mbed-os-ci_mbed2-build-IAR

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 30, 2019

Please review build failures (build artifacts above)

@petroborys
Copy link
Contributor Author

Please review build failures (build artifacts above)

Thank. Done.

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 30, 2019

CI started

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 30, 2019

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.

@petroborys
Copy link
Contributor Author

petroborys commented Apr 30, 2019

I've noticed the commit messages (1-10) - what do the numbers mean?

Just numeration.

It would make sense to provide more meaningful commit messages instead.

Ok, sure

@mbed-ci
Copy link

mbed-ci commented Apr 30, 2019

Test run: FAILED

Summary: 1 of 11 test jobs failed
Build number : 2
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_exporter

@petroborys
Copy link
Contributor Author

Either to squash them or rewrite.

Done.

@petroborys
Copy link
Contributor Author

I didn't see any error in the logs.

@0xc0170
Copy link
Contributor

0xc0170 commented May 2, 2019

Will restart tests later today

@0xc0170 0xc0170 changed the title Added support for CAN to SiLabs targets Add support for CAN to SiLabs targets May 3, 2019
@0xc0170
Copy link
Contributor

0xc0170 commented May 3, 2019

CI started

@mbed-ci
Copy link

mbed-ci commented May 3, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 3
Build artifacts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants