Giter Club home page Giter Club logo

sp3000's People

Contributors

per1234 avatar pontuso avatar sweet-peas avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

wickeddevice

sp3000's Issues

Doesn't Compile in Arduino 1.5.8

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.

Should use new SPI Transaction API

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.