{"action":"created","issue":{"url":"https://api.github.com/repos/Sweet-Peas/SP3000/issues/2","labels_url":"https://api.github.com/repos/Sweet-Peas/SP3000/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/Sweet-Peas/SP3000/issues/2/comments","events_url":"https://api.github.com/repos/Sweet-Peas/SP3000/issues/2/events","html_url":"https://github.com/Sweet-Peas/SP3000/issues/2","id":53998857,"number":2,"title":"Should use new SPI Transaction API","user":{"login":"vicatcu","id":1018382,"avatar_url":"https://avatars.githubusercontent.com/u/1018382?v=3","gravatar_id":"","url":"https://api.github.com/users/vicatcu","html_url":"https://github.com/vicatcu","followers_url":"https://api.github.com/users/vicatcu/followers","following_url":"https://api.github.com/users/vicatcu/following{/other_user}","gists_url":"https://api.github.com/users/vicatcu/gists{/gist_id}","starred_url":"https://api.github.com/users/vicatcu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vicatcu/subscriptions","organizations_url":"https://api.github.com/users/vicatcu/orgs","repos_url":"https://api.github.com/users/vicatcu/repos","events_url":"https://api.github.com/users/vicatcu/events{/privacy}","received_events_url":"https://api.github.com/users/vicatcu/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-11T17:54:52Z","updated_at":"2015-01-12T10:14:19Z","closed_at":"2015-01-12T10:14:19Z","body":"Code should be updated to check for SPI_HAS_TRANSACTION define and in that case use the new SPI Transaction API\r\n\r\nHere is the relevant code from the Adafruit_CC3000_Library.\r\n\r\n```\r\n#if defined(SPI2X) && defined(__AVR__) // most likely AVR8\r\nuint8_t ccspi_mySPCR, ccspi_mySPSR, ccspi_oldSPSR, ccspi_oldSPCR;\r\n#define SpiConfigStoreOld() {             \\\r\n  ccspi_oldSPCR = SPCR;                   \\\r\n  ccspi_oldSPSR = SPSR & _BV(SPI2X); }\r\n#define SpiConfigStoreMy() {              \\\r\n  ccspi_mySPCR  = SPCR;                   \\\r\n  ccspi_mySPSR  = SPSR & _BV(SPI2X); }\r\n#define SpiConfigPush()\t{                 \\\r\n  ccspi_oldSPCR = SPCR;                   \\\r\n  ccspi_oldSPSR = SPSR & _BV(SPI2X);      \\\r\n  SPCR          = ccspi_mySPCR;           \\\r\n  if(ccspi_mySPSR)  SPSR |=  _BV(SPI2X);  \\\r\n  else              SPSR &= ~_BV(SPI2X); }\r\n#define SpiConfigPop() {                  \\\r\n  SPCR = ccspi_oldSPCR;                   \\\r\n  if(ccspi_oldSPSR) SPSR |=  _BV(SPI2X);  \\\r\n  else              SPSR &= ~_BV(SPI2X); }\r\n\r\n#elif defined(__AVR_XMEGA__) // most likely XMEGA\r\nuint8_t ccspi_mySPICTRL, ccspi_oldSPICTRL;\r\n#define SpiConfigStoreOld()\t\tdo { ccspi_oldSPICTRL = SPCR; } while (0)\r\n#define SpiConfigStoreMy()\t\tdo { ccspi_mySPICTRL = SPCR; } while (0)\r\n#define SpiConfigPush()\t\t\tdo { ccspi_oldSPICTRL = SPCR; SPCR = ccspi_mySPICTRL; } while (0)\r\n#define SpiConfigPop()\t\t\tdo { SPCR = ccspi_oldSPICTRL; } while (0)\r\n#else\r\n// TODO: ARM (Due, Teensy 3.0, etc)\r\n// #error platform not yet supported by Adafruit_CC3000\r\n#define SpiConfigStoreOld()\t\tdo {  } while (0)\r\n#define SpiConfigStoreMy()\t\tdo {  } while (0)\r\n#define SpiConfigPush()\t\t\tdo {  } while (0)\r\n#define SpiConfigPop()\t\t\tdo {  } while (0)\r\n#endif\r\n\r\n#ifdef SPI_HAS_TRANSACTION\r\n// CC3000 SPI config + begin SPI usage + chip select\r\n  #define CC3000_ASSERT_CS {     \\\r\n    SpiConfigPush();             \\\r\n    SPI.beginTransaction(SPISettings(16000000, MSBFIRST, SPI_MODE1)); \\\r\n    digitalWrite(g_csPin, LOW); }\r\n  // CC3000 chip deselect + end SPI usage + SPI restore\r\n  #define CC3000_DEASSERT_CS {   \\\r\n    digitalWrite(g_csPin, HIGH); \\\r\n    SPI.endTransaction();        \\\r\n    SpiConfigPop(); }\r\n#else\r\n// CC3000 chip select + SPI config\r\n  #define CC3000_ASSERT_CS {     \\\r\n    digitalWrite(g_csPin, LOW);  \\\r\n    SpiConfigPush(); }\r\n  // CC3000 chip deselect + SPI restore\r\n  #define CC3000_DEASSERT_CS {   \\\r\n    digitalWrite(g_csPin, HIGH); \\\r\n    SpiConfigPop(); }\r\n#endif\r\n```"},"comment":{"url":"https://api.github.com/repos/Sweet-Peas/SP3000/issues/comments/69549847","html_url":"https://github.com/Sweet-Peas/SP3000/issues/2#issuecomment-69549847","issue_url":"https://api.github.com/repos/Sweet-Peas/SP3000/issues/2","id":69549847,"user":{"login":"Sweet-Peas","id":4019594,"avatar_url":"https://avatars.githubusercontent.com/u/4019594?v=3","gravatar_id":"","url":"https://api.github.com/users/Sweet-Peas","html_url":"https://github.com/Sweet-Peas","followers_url":"https://api.github.com/users/Sweet-Peas/followers","following_url":"https://api.github.com/users/Sweet-Peas/following{/other_user}","gists_url":"https://api.github.com/users/Sweet-Peas/gists{/gist_id}","starred_url":"https://api.github.com/users/Sweet-Peas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sweet-Peas/subscriptions","organizations_url":"https://api.github.com/users/Sweet-Peas/orgs","repos_url":"https://api.github.com/users/Sweet-Peas/repos","events_url":"https://api.github.com/users/Sweet-Peas/events{/privacy}","received_events_url":"https://api.github.com/users/Sweet-Peas/received_events","type":"User","site_admin":false},"created_at":"2015-01-12T10:14:19Z","updated_at":"2015-01-12T10:14:19Z","body":"I will look into this to determine the impact on the code. Currently I am focusing my efforts on the smaller and more robust tinyhci it is not likely to be implemented."}}