drivers/periph/spi: Implement thread safety for all SPI devices#2317
drivers/periph/spi: Implement thread safety for all SPI devices#2317PeterKietzmann merged 12 commits intoRIOT-OS:masterfrom
Conversation
drivers/nrf24l01p/nrf24l01p.c
Outdated
There was a problem hiding this comment.
Are these delays needed, or are they accidental left-overs from a previous refactoring?
There was a problem hiding this comment.
@gebart yes these delays are superfluous. Would be nice if you could remove them.
|
@haukepetersen I added you as author on the affected |
|
BTW: thanks for doing all this task requiring great diligence! |
|
Updated according to #2290 (comment) |
560a9ac to
6b0fda6
Compare
drivers/nrf24l01p/nrf24l01p.c
Outdated
There was a problem hiding this comment.
it must be spi_release(dev->spi);
|
@gebart: except from the small changes in |
|
@PeterKietzmann Fixed the typo according to your comment, squash and go? (once Travis is done) Should I leave each individual component as a separate commit as now and only squash the small comment fixes or squash it all into one big commit? |
|
@gebart I would propose to squash the nrf24l01p-, cc110x- and at86rf231-commits but I'm not sure if it's necessary to keep all the other ones separately. Maybe @LudwigOrtmann ha an idea about that? |
4518a51 to
b7baf85
Compare
|
I'd prefer to leave it at one commit per cpu, just for history clarity. |
|
Yep that's what was in my mind too. I was just to stupid to phrase. But still, I think you can squash nrf24l01p-, cc110x- and at86rf231-commits. Would like to hear another opinion, maybe from Ludwig? |
|
I completely agree with the atomicity of the commits not prefixed 'squash' ;) |
|
@LudwigOrtmann Require was probably just a typo on my side. I will rewrite the message during squashing. |
b7baf85 to
365e5b9
Compare
Signed-off-by: Joakim Gebart <[email protected]>
Signed-off-by: Joakim Gebart <[email protected]>
Signed-off-by: Joakim Gebart <[email protected]>
Signed-off-by: Joakim Gebart <[email protected]>
Signed-off-by: Joakim Gebart <[email protected]>
Signed-off-by: Joakim Gebart <[email protected]>
Signed-off-by: Joakim Gebart <[email protected]>
Signed-off-by: Joakim Gebart <[email protected]>
This change removes extra gpio_clear(dev->cs) before calling
nrf24l01p_read_reg(), nrf24l01p_write_reg(). The GPIO handling is not
necessary since nrf24l01p_{read,write}_reg() handle the CS pin
internally.
Signed-off-by: Joakim Gebart <[email protected]>
The delays were introduced in an attempt to fix "inexplicable timing errors", although the errors were in the SPI bus driver rather than the nrf24l01p driver. See also: - RIOT-OS#1704 - RIOT-OS#2315 Signed-off-by: Joakim Gebart <[email protected]>
Signed-off-by: Joakim Gebart <[email protected]>
365e5b9 to
dfb0d58
Compare
|
I think the removing of the extra delays in nrf24l01p shall remain as a stand alone commit for easier bisection in any future regressions. @PeterKietzmann ACK if you are fine with the current commit line |
|
I'm happy. ACK&go |
drivers/periph/spi: Implement thread safety for all SPI devices
This implements #2314 for the SPI drivers. (edit: Except for STM32F4 which is implemented in #2290)
I added the generic implementation of SPI thread safety as proposed by @haukepetersen in #2290 to all CPU
periph/spiimplementations and made all drivers which are currently usingperiph/spito acquire/release the bus when necessary.I also found a mistake in the nrf24l01p driver, the CS line was cleared/set twice when turning on/off the device.