Skip to content

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

Merged
merged 2 commits into from
Oct 12, 2016
Merged

MBED OS 3 to 5 changes added for SPI #2866

merged 2 commits into from
Oct 12, 2016

Conversation

pradeep-gr
Copy link
Contributor

Notes:

  • Pull requests will not be accepted until the submitter has agreed to the contributer agreement.
  • This is just a template, so feel free to use/remove the unnecessary things

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:

branch PR
other_pr_production link
other_pr_master link

Todos

  • Tests
  • Documentation

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.

Copy link
Contributor

@bridadan bridadan left a 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);
Copy link
Contributor

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

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

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

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

Copy link
Contributor Author

@pradeep-gr pradeep-gr Oct 3, 2016

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

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

if (condition) {
    do_sth;
}

} else {
}
else
{
Copy link
Contributor

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

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

@maclobdell
Copy link
Contributor

@bridadan the CI log doesn't give me much of a clue why it failed. Can you check?

@bridadan
Copy link
Contributor

bridadan commented Oct 4, 2016

@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?

@pradeep-gr
Copy link
Contributor Author

Rebased fork and pull request is updated. Please let me know everything is fine with rebase & PR.
Can you please let me know this PR can be merged.

@pradeep-gr
Copy link
Contributor Author

Any update on the PR?

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 7, 2016

@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 targets/TARGET_ONSEMI/TARGET_NCS36510/pmu_map.h.

Copy link
Contributor

@0xc0170 0xc0170 left a 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

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 7, 2016

/morph test

Copy link
Contributor

@bridadan bridadan left a 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!

@mbed-bot
Copy link

mbed-bot commented Oct 7, 2016

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 1076

All builds and test passed!

@sg-
Copy link
Contributor

sg- commented Oct 7, 2016

@pradeep-gr There was a consolidation of the cmsis files to make switching versions easier. This caused a conflict. Can you resolve?

@pradeep-gr pradeep-gr force-pushed the master branch 2 times, most recently from 798633c to 3bd8a5b Compare October 12, 2016 09:21
@pradeep-gr
Copy link
Contributor Author

Re-based to update folder name and location from cmsis to device.

@sg-
Copy link
Contributor

sg- commented Oct 12, 2016

/morph test

@mbed-bot
Copy link

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 0

All builds and test passed!

@pradeep-gr
Copy link
Contributor Author

pradeep-gr commented Oct 12, 2016

Commit 22c50d3 also contains OS 5 changes for low power timer.

@sg- sg- merged commit ffe05f7 into ARMmbed:master Oct 12, 2016
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