Skip to content

cpu/board: updated spi driver for arduino-due#1584

Merged
LudwigKnuepfer merged 2 commits intoRIOT-OS:masterfrom
PeterKietzmann:add_sam3x_spi
Oct 8, 2014
Merged

cpu/board: updated spi driver for arduino-due#1584
LudwigKnuepfer merged 2 commits intoRIOT-OS:masterfrom
PeterKietzmann:add_sam3x_spi

Conversation

@PeterKietzmann
Copy link
Copy Markdown
Member

This PR should replace PR #1544 from @blanloem because his internship ended. It contains an updated and adapted version of the SPI low-level driver for arduino-due boards.

@mehlis
Copy link
Copy Markdown
Contributor

mehlis commented Sep 13, 2014

@PeterKietzmann please rebase your code

@PeterKietzmann PeterKietzmann force-pushed the add_sam3x_spi branch 2 times, most recently from f93bfbd to 711a967 Compare September 15, 2014 07:15
@PeterKietzmann PeterKietzmann removed the State: WIP State: The PR is still work-in-progress and its code is not in its final presentable form yet label Sep 24, 2014
@mehlis
Copy link
Copy Markdown
Contributor

mehlis commented Oct 3, 2014

I think this PR should be spitted in two, that the spi_test is independent... and then the test can more in RIOT separately. @haukepetersen what do you think?

@mehlis
Copy link
Copy Markdown
Contributor

mehlis commented Oct 3, 2014

@PeterKietzmann this drivers does not implement

spi_transfer_reg
spi_transfer_regs

which are necessary for your nrf24l01 driver: #1704

you can probably copy https://github.com/RIOT-OS/RIOT/blob/master/cpu/stm32f1/periph/spi.c#L185

or am I wrong with that?

@mehlis
Copy link
Copy Markdown
Contributor

mehlis commented Oct 3, 2014

just for the record

@PeterKietzmann
Copy link
Copy Markdown
Member Author

Implemented spi_transfer_reg and spi_transfer_regs. Deleted tests/test_spi (cause there is tests/periph_spi in master now). Rebased.

@PeterKietzmann
Copy link
Copy Markdown
Member Author

Would like to see this in the master soon, especially because PR #1704 needs it. For me it is fine! Someone check, ACK?

@LudwigKnuepfer
Copy link
Copy Markdown
Member

ACK for functionality

@LudwigKnuepfer LudwigKnuepfer added the CI: needs squashing Commits in this PR need to be squashed; If set, CI systems will mark this PR as unmergable label Oct 6, 2014
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove this (and possibly other prefixing) blank line(s)

@PeterKietzmann PeterKietzmann force-pushed the add_sam3x_spi branch 4 times, most recently from 26feedb to e02d13e Compare October 6, 2014 15:05
@PeterKietzmann
Copy link
Copy Markdown
Member Author

addressed some style fixes, travis warnings and squashed

@LudwigKnuepfer
Copy link
Copy Markdown
Member

Please change the commit message. As far as I see, the commit does not complete, but rather implement SPI for the sam.. right?

@LudwigKnuepfer
Copy link
Copy Markdown
Member

Kicked Travis

@LudwigKnuepfer LudwigKnuepfer removed the CI: needs squashing Commits in this PR need to be squashed; If set, CI systems will mark this PR as unmergable label Oct 6, 2014
@LudwigKnuepfer
Copy link
Copy Markdown
Member

Travis is having a bad day.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

divider

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing default: ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW: I think a lot of these switch statements miss a default case.

@LudwigKnuepfer
Copy link
Copy Markdown
Member

Please check the periph API for all functions to make sure the return values and parameters match the specification.

@PeterKietzmann
Copy link
Copy Markdown
Member Author

Travis is happy now. And you @LudwigOrtmann, @haukepetersen ?

@LudwigKnuepfer
Copy link
Copy Markdown
Member

My happiness would be easier to determine if you had not squashed immediately (as suggested by the development procedures) ;-)

@LudwigKnuepfer
Copy link
Copy Markdown
Member

#1584 (comment) has not been addressed yet.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trailing whitespace

@PeterKietzmann
Copy link
Copy Markdown
Member Author

To be honest I do not really know what you mean with "arduino-changes".
Do you mean changes in boards/arduino-due/periph_conf.h and
cpu/sam3x8e/periph/spi.c?

@LudwigKnuepfer
Copy link
Copy Markdown
Member

I mean the changes in boards/arduino-due/periph_conf.h.

@LudwigKnuepfer
Copy link
Copy Markdown
Member

I'm happy otherwise.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think casting is the right approach here.
I mean - if length really exceeds int, the result is off now, and this is lost.
IFF this should be handled at all, I'd length = (length > INT_MAX) INT_MAX : length; (if INT_MAX is the right macro, this is off the top of my head).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then I would suggest to leave it like before without a cast and change it if we found a good solution in PR #1769.

@PeterKietzmann
Copy link
Copy Markdown
Member Author

Everyone happy? @LudwigOrtmann, @haukepetersen ?

@LudwigKnuepfer
Copy link
Copy Markdown
Member

Happy Happy!

ACK

LudwigKnuepfer pushed a commit that referenced this pull request Oct 8, 2014
cpu/board: updated  spi driver for arduino-due
@LudwigKnuepfer LudwigKnuepfer merged commit b879f78 into RIOT-OS:master Oct 8, 2014
@PeterKietzmann PeterKietzmann deleted the add_sam3x_spi branch March 26, 2015 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Platform: ARM Platform: This PR/issue effects ARM-based platforms Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants