sweet-peas / sp3000 Goto Github PK
View Code? Open in Web Editor NEWAn Arduino library for controlling Sweet Pea products with the CC3000 module on board
An Arduino library for controlling Sweet Pea products with the CC3000 module on board
Below is the (verbose) compiler output in Arduino 1.5.8 when compiling pretty much any of the example sketches. It seems to compile fine in Arduino 1.0.6. I changed "arduino.h" to "Arduino.h" and that gets one line farther and complains about not being able to find "wiring.h." But I couldn't find such a file anywhere in the arduino installation folder under 1.0.6, and only found it in the sam (not avr) core for Arduino 1.5.8.
Build options changed, rebuilding all
Using library SP3000 in folder: /home/vic/sketchbook/libraries/SP3000 (legacy)
Using library SPI in folder: /home/vic/arduino-1.5.8/hardware/arduino/avr/libraries/SPI
/home/vic/arduino-1.5.8/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=158 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/home/vic/arduino-1.5.8/hardware/arduino/avr/cores/arduino -I/home/vic/arduino-1.5.8/hardware/arduino/avr/variants/standard -I/home/vic/sketchbook/libraries/SP3000 -I/home/vic/arduino-1.5.8/hardware/arduino/avr/libraries/SPI /tmp/build7010946793466951514.tmp/SP3000_Web_Server.cpp -o /tmp/build7010946793466951514.tmp/SP3000_Web_Server.cpp.o
In file included from /home/vic/sketchbook/libraries/SP3000/core.hpp:26:0,
from /home/vic/sketchbook/libraries/SP3000/sp3000.h:12,
from SP3000_Web_Server.ino:10:
/home/vic/sketchbook/libraries/SP3000/digitalWriteFast.hpp:1:21: fatal error: arduino.h: No such file or directory
#include <arduino.h>
^
compilation terminated.
Error compiling.
Code should be updated to check for SPI_HAS_TRANSACTION define and in that case use the new SPI Transaction API
Here is the relevant code from the Adafruit_CC3000_Library.
#if defined(SPI2X) && defined(__AVR__) // most likely AVR8
uint8_t ccspi_mySPCR, ccspi_mySPSR, ccspi_oldSPSR, ccspi_oldSPCR;
#define SpiConfigStoreOld() { \
ccspi_oldSPCR = SPCR; \
ccspi_oldSPSR = SPSR & _BV(SPI2X); }
#define SpiConfigStoreMy() { \
ccspi_mySPCR = SPCR; \
ccspi_mySPSR = SPSR & _BV(SPI2X); }
#define SpiConfigPush() { \
ccspi_oldSPCR = SPCR; \
ccspi_oldSPSR = SPSR & _BV(SPI2X); \
SPCR = ccspi_mySPCR; \
if(ccspi_mySPSR) SPSR |= _BV(SPI2X); \
else SPSR &= ~_BV(SPI2X); }
#define SpiConfigPop() { \
SPCR = ccspi_oldSPCR; \
if(ccspi_oldSPSR) SPSR |= _BV(SPI2X); \
else SPSR &= ~_BV(SPI2X); }
#elif defined(__AVR_XMEGA__) // most likely XMEGA
uint8_t ccspi_mySPICTRL, ccspi_oldSPICTRL;
#define SpiConfigStoreOld() do { ccspi_oldSPICTRL = SPCR; } while (0)
#define SpiConfigStoreMy() do { ccspi_mySPICTRL = SPCR; } while (0)
#define SpiConfigPush() do { ccspi_oldSPICTRL = SPCR; SPCR = ccspi_mySPICTRL; } while (0)
#define SpiConfigPop() do { SPCR = ccspi_oldSPICTRL; } while (0)
#else
// TODO: ARM (Due, Teensy 3.0, etc)
// #error platform not yet supported by Adafruit_CC3000
#define SpiConfigStoreOld() do { } while (0)
#define SpiConfigStoreMy() do { } while (0)
#define SpiConfigPush() do { } while (0)
#define SpiConfigPop() do { } while (0)
#endif
#ifdef SPI_HAS_TRANSACTION
// CC3000 SPI config + begin SPI usage + chip select
#define CC3000_ASSERT_CS { \
SpiConfigPush(); \
SPI.beginTransaction(SPISettings(16000000, MSBFIRST, SPI_MODE1)); \
digitalWrite(g_csPin, LOW); }
// CC3000 chip deselect + end SPI usage + SPI restore
#define CC3000_DEASSERT_CS { \
digitalWrite(g_csPin, HIGH); \
SPI.endTransaction(); \
SpiConfigPop(); }
#else
// CC3000 chip select + SPI config
#define CC3000_ASSERT_CS { \
digitalWrite(g_csPin, LOW); \
SpiConfigPush(); }
// CC3000 chip deselect + SPI restore
#define CC3000_DEASSERT_CS { \
digitalWrite(g_csPin, HIGH); \
SpiConfigPop(); }
#endif
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.