Commit Graph

10 Commits

Author SHA1 Message Date
Cristian Maglie 008903d881 Corrected some email contacts. 2015-02-05 16:47:22 +01:00
Cristian Maglie 4c096dc6a9 Fix atomicity issues in SPI::beginTransaction and SPI::endTransaction (Andrew Kroll)
Previously, it could happen that SPI::beginTransaction was
interrupted by an ISR, while it is changing the SPI_AVR_EIMSK
register or interruptSave variable (it seems that there is
a small window after changing SPI_AVR_EIMSK where an interrupt
might still occur). If this happens, interruptSave is overwritten
with an invalid value, permanently disabling the pin interrupts.

To prevent this, disable interrupts globally while changing
these values.
2014-11-25 15:56:11 +01:00
Cristian Maglie b0eac9bd05 [avr] Added SPI.notUsingInterrupt() (Andrew Kroll) 2014-11-25 15:56:11 +01:00
Cristian Maglie 3e155441b5 [avr] Made SPI.begin() and SPI.end() synchronized (Andrew Kroll) 2014-11-25 15:49:17 +01:00
Cristian Maglie cd9ea1a371 [avr] Improved SPI speed on 16bit transfer.
From https://github.com/arduino/Arduino/pull/2376#issuecomment-59671152

Quoting Andrew Kroll:

   [..this commit..] introduces a small delay that can prevent the wait
   loop form iterating when running at the maximum speed. This gives
   you a little more speed, even if it seems counter-intuitive. At
   lower speeds, it is unnoticed. Watch the output on an oscilloscope
   when running full SPI speed, and you should see closer back-to-back
   writes.

Quoting Paul Stoffregen:

   I did quite a bit of experimenting with the NOP addition. The one
   that's in my copy gives about a 10% speedup on AVR.
2014-11-25 15:49:17 +01:00
Cristian Maglie 396dcd66c8 [avr] Small comments and headers fixes in SPI 2014-11-14 00:23:11 +01:00
PaulStoffregen 3791e4f260 SPI Transactions for AVR 2014-08-01 05:38:27 -07:00
Cristian Maglie 15c793a0e5 Revert "SPI library to new format" 2013-11-21 15:05:36 +01:00
Fede85 490bddc43a SPI library to the new format and moved Robot_Motor and Robot_Control libraries 2013-07-03 22:00:02 +02:00
Cristian Maglie 6fa8a84983 Moved libraries folder inside platform folder. Now libraries and examples are searched per board/platform 2012-01-04 15:14:51 +01:00