6 Replies Latest reply on Aug 12, 2014 10:04 AM by EddyH

    Digital Pot example won't compile with Galileo Gen2?

    EddyH

      Compile output...

      In file included from DigitalPotControl.ino:31:0:

      /home/eddy.higgins/Arduino/libraries/Robot_Control/SPI.h: In static member function 'static byte SPIClass::transfer(byte)':

      /home/eddy.higgins/Arduino/libraries/Robot_Control/SPI.h:56:3: error: 'SPDR' was not declared in this scope

      /home/eddy.higgins/Arduino/libraries/Robot_Control/SPI.h:57:12: error: 'SPSR' was not declared in this scope

      /home/eddy.higgins/Arduino/libraries/Robot_Control/SPI.h:57:23: error: 'SPIF' was not declared in this scope

      /home/eddy.higgins/Arduino/libraries/Robot_Control/SPI.h:57:27: error: '_BV' was not declared in this scope

      /home/eddy.higgins/Arduino/libraries/Robot_Control/SPI.h: In static member function 'static void SPIClass::attachInterrupt()':

      /home/eddy.higgins/Arduino/libraries/Robot_Control/SPI.h:63:3: error: 'SPCR' was not declared in this scope

      /home/eddy.higgins/Arduino/libraries/Robot_Control/SPI.h:63:15: error: 'SPIE' was not declared in this scope

      /home/eddy.higgins/Arduino/libraries/Robot_Control/SPI.h:63:19: error: '_BV' was not declared in this scope

      /home/eddy.higgins/Arduino/libraries/Robot_Control/SPI.h: In static member function 'static void SPIClass::detachInterrupt()':

      /home/eddy.higgins/Arduino/libraries/Robot_Control/SPI.h:67:3: error: 'SPCR' was not declared in this scope

      /home/eddy.higgins/Arduino/libraries/Robot_Control/SPI.h:67:16: error: 'SPIE' was not declared in this scope

      /home/eddy.higgins/Arduino/libraries/Robot_Control/SPI.h:67:20: error: '_BV' was not declared in this scope

        • 1. Re: Digital Pot example won't compile with Galileo Gen2?
          EddyH

          Should have mentioned - Arduino V1.5.3

          • 2. Re: Digital Pot example won't compile with Galileo Gen2?
            mhahn

            _BV stems from an AVR hw specific header file (see e.g. _BV()) - you may put the macro definition in your code

            I haven't checked on the other #defines - maybe you can also add them similarly

            • 3. Re: Digital Pot example won't compile with Galileo Gen2?
              EddyH

              Thanks,

                but I guess the real question is whether or not there is a working SPI library for Galileo (specifically gen2)?  Am I incorrect in assuming that all of the examples bundles with the Intel IDE should work (at least compile) without modification - I see the SPI library still contains avr specific references.

              I'm just looking to get access to SPI so I can interface my current SPI components (LCD displays, digital pots, memory etc). I would have thought that it would be straightforward.

              I'm familiar with atmel based arduino, and am now in the process of trying to use Galileo. SPCR SPDR and SPSR are atmel spi registers, I was assuming that there would be equivalents for Galileo with a mapping to the legacy naming (or some equivalent mechanism).

               

              I'd welcome any advice on how best to proceed.

              • 4. Re: Digital Pot example won't compile with Galileo Gen2?
                jjaken

                The SPI library has been rewritten and works on Gen 2.  I am not sure if the examples have been rewritten or checked to make sure they still work as well.  I don't remember seeing any AVR in the SPI library, but it's been a little while since I looked at it.  Still, make sure you are looking at the correct SPI library inside the Galileo IDE.

                • 5. Re: Digital Pot example won't compile with Galileo Gen2?
                  Intel_Jesus

                  Hi EddyH,

                   

                  Can you attach the code you are trying to compile?

                  Using the sample code in Arduino - DigitalPotentiometer compiles with no issues.

                   

                  Regards,

                  Intel_Jesus

                  • 6. Re: Digital Pot example won't compile with Galileo Gen2?
                    EddyH

                    Again thanks Guys.

                      As you've suggested, it's looking like the IDE is picking up the wrong SPI library -

                    It's picking up a version of SPI from  'Robot_Control'  - I'm not sure why, it must have something to do with the way I've installed the IDE & libraries.

                    I then looked to see what versions I seem to have ...

                    /opt/intel$ find . -iname 'spi.h'

                    ./galileo/arduino-1.5.3/hardware/arduino/x86/libraries/SPI/SPI.h

                    ./galileo/arduino-1.5.3/libraries/SPI/src/SPI.h

                    ./galileo/arduino-1.5.3/libraries/WiFi/extras/wifi_dnld/src/SOFTWARE_FRAMEWORK/DRIVERS/SPI/spi.h

                    ./galileo/arduino-1.5.3/libraries/WiFi/extras/wifiHD/src/SOFTWARE_FRAMEWORK/DRIVERS/SPI/spi.h

                    ./galileo/arduino-1.5.3/libraries/Robot_Control/SPI.h

                     

                    The top one looks correct; the one in Robot_Control is definitely incorrect - at a glance it's just the old one (with avr refs etc.) ; hence the errors.

                     

                    When I get a chance I'll see how to make sure it's picking up the correct one, and then give it a go.

                     

                    Regards,

                    Eddy.