-
Notifications
You must be signed in to change notification settings - Fork 3k
MBED OS 3 to 5 changes added for SPI #2866
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
Conversation
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.
Thanks for the PR @pradeep-gr!
I made a few comments about the styling, would you mind taking a look? Here's our style guide that I usually refer to:
https://github.com/ARMmbed/mbed-os/blob/master/docs/COMMITTERS.md#c-coding-rules--coding-guidelines
Thanks!
@@ -75,29 +75,40 @@ void fSpiInit(spi_t *obj, PinName mosi, PinName miso, PinName sclk, PinName ssel | |||
CLOCK_ENABLE(CLOCK_SPI2); /* Enable clock */ | |||
} | |||
|
|||
CLOCK_ENABLE(CLOCK_CROSSB); |
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.
Could you please fix the indent here?
padRegOffset->PADIO2.BITS.POWER = 1; /* miso: Drive strength */ | ||
CLOCK_DISABLE(CLOCK_PAD); | ||
/* Pad settings */ | ||
CLOCK_ENABLE(CLOCK_PAD); |
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.
Could you please fix the indent here?
} | ||
CLOCK_DISABLE(CLOCK_PAD); | ||
CLOCK_DISABLE(CLOCK_GPIO); | ||
CLOCK_DISABLE(CLOCK_CROSSB); |
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.
Could you please fix the indent here?
@@ -59,24 +59,28 @@ void spi_free(spi_t *obj) | |||
|
|||
void spi_format(spi_t *obj, int bits, int mode, int slave) | |||
{ | |||
if(slave) { | |||
if(slave) | |||
{ |
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.
Could you please revert this change to the bracket? It does not fit with our style guide: https://github.com/ARMmbed/mbed-os/blob/master/docs/COMMITTERS.md#c-coding-rules--coding-guidelines
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.
Brian,
As per your comment
"if(slave){"
should be changed to
"if(slave)
{"
Can you confirm this. Because as per coding guidelines
"if(slave){" is correct
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
if (condition) {
do_sth;
}
} else { | ||
} | ||
else | ||
{ |
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.
Could you please revert this change to the bracket? It does not fit with our style guide: https://github.com/ARMmbed/mbed-os/blob/master/docs/COMMITTERS.md#c-coding-rules--coding-guidelines
} | ||
|
||
void spi_frequency(spi_t *obj, int hz) | ||
{ | ||
/* If the frequency is outside the allowable range, set it to the max */ | ||
if(hz > SPI_FREQ_MAX) { | ||
if(hz > SPI_FREQ_MAX) | ||
{ |
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.
Could you please revert this change to the bracket? It does not fit with our style guide: https://github.com/ARMmbed/mbed-os/blob/master/docs/COMMITTERS.md#c-coding-rules--coding-guidelines
@bridadan the CI log doesn't give me much of a clue why it failed. Can you check? |
@maclobdell I think the CI that's currently complaining is due to issues in Oulu at the moment from the restructure PR that went in. @pradeep-gr The restructure PR also affected this PR. Could you please rebase? |
Rebased fork and pull request is updated. Please let me know everything is fine with rebase & PR. |
Any update on the PR? |
@bridadan Requested changes were done. @pradeep-gr Thanks for running astyle. Be aware that running it on the files that come outside of mbed, like drivers. It's not recommended to run astyle on those, as it makes difficult future integration (diff noise whitespaces, indentation, etc). I have noticed this on the files like |
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.
Besides changing some external files (probably it was an intention and all is good as it is), LGTM
/morph test |
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.
Thanks for the changes!
Result: SUCCESSYour command has finished executing! Here's what you wrote!
Outputmbed Build Number: 1076 All builds and test passed! |
@pradeep-gr There was a consolidation of the cmsis files to make switching versions easier. This caused a conflict. Can you resolve? |
798633c
to
3bd8a5b
Compare
Re-based to update folder name and location from cmsis to device. |
/morph test |
Result: SUCCESSYour command has finished executing! Here's what you wrote!
Outputmbed Build Number: 0 All builds and test passed! |
Commit 22c50d3 also contains OS 5 changes for low power timer. |
Notes:
Description
A few sentences describing the overall goals of the pull request's commits.
Status
READY/IN DEVELOPMENT/HOLD
Migrations
If this PR changes any APIs or behaviors, give a short description of what API users should do when this PR is merged.
YES | NO
Related PRs
List related PRs against other branches:
Todos
Deploy notes
Notes regarding the deployment of this PR. These should note any
required changes in the build environment, tools, compilers, etc.
Steps to test or reproduce
Outline the steps to test or reproduce the PR here.