Infineon / XMC-for-Arduino

Integration of Infineon's XMC microcontrollers into the Arduino IDE.
Other
107 stars 69 forks source link

CAN: Loopback() #286

Closed LinjingZhang closed 4 months ago

LinjingZhang commented 4 months ago

By creating this pull request you agree to the terms in CONTRIBUTING.md. https://github.com/Infineon/.github/blob/master/CONTRIBUTING.md --- DO NOT DELETE ANYTHING ABOVE THIS LINE ---

CONTRIBUTING.md also tells you what to expect in the PR process.

Description Add loopback functionalities for CAN lib.

Related Issue NA

Context Add loopback() function. Basically writing application code instead of a library... but no idea how to do better using XMCLib.

ederjc commented 4 months ago

Thanks LJ! I can't review a lot here. I could test it of course, if you describe the test setup. For me it's fine to have this WiP on the feature branch. Can you create follow-up tickets for the open todos? In the example there is still the namespace ifx. Please refer to this comment.

LinjingZhang commented 4 months ago

Thanks LJ! I can't review a lot here. I could test it of course, if you describe the test setup. For me it's fine to have this WiP on the feature branch. Can you create follow-up tickets for the open todos? In the example there is still the namespace ifx. Please refer to this comment.

Hi Julian, for loopback you need no extra hardware setup. You could test it with a single XMC1400 2Go. I did not test it on XMC4000 series, maybe you can do that.

For The namespace, I talked once with Jens (related ticket: https://jirard.intra.infineon.com/browse/DESMAKERS-3828), namespace offers several benefits, for example avoiding naming conflicts with third-party libraries. I also referenced this post: https://luckyresistor.me/2014/10/31/how-and-why-to-use-namespaces/ From a user's point of view, one line of using namespace wouldn't give me much trouble. Would you consider keeping it?

ederjc commented 4 months ago

If you tested it on the 2Go it's fine for the feature branch.

Regarding the namespace it's a matter of hw abstraction which should not be handled in the application code. I would like to allow our device to work also with third party code and vice versa. But I can check with Jens next week :)

For me it's fine to merge this to the feature branch if Juan and Olaf agree.

LinjingZhang commented 4 months ago

I will first close this ticket and move ifx namespace in next PR.