tessel/camera-vc0706 — pull request #29 by johnnyman727 (2014-08-12 00:24:44+00:00)
Title: Initializes SPI in slave mode just before receive and does not close SPI...

... afterward

This PR fixes Camera's functionality in conjunction with SDCard.

The main problem with using SDCard after SPI is that SDCard uses the Raw SPI API in conjunction with SPI Locks. That means that when the camera called `spi.close` after receiving the image, the sdcard was not aware that it needed to re-initialize. All of it's calls use `spi.rawTransfer` and `spi.rawReceive` which do not call the internal `spi._initialize`(to resets all of the SPI defaults for that particular SPI object).

In a similar vein, with my new changes, the SPI mode is reset to "master" once the camera is done but there is no way to preserve all the other SPI settings (for example, clockspeed gets switched from 200kHz to 100kHz after the camera transaction). Again, this is because the SPI.raw-APIs don't re-initialize SPI before taking further action.

It seems like both of those issues can be solved by calling `spi._initialize()` from within `spi.rawSend/Transfer` and `spi.rawReceive`. Are there any ramifications to that firmware change that I should consider?