chipKIT® Development Platform

Inspired by Arduino™

#include <SPI.h> Issues

Created Wed, 15 Jun 2011 01:14:48 +0000 by Jacob Christ


Jacob Christ

Wed, 15 Jun 2011 01:14:48 +0000

I've just added to the project I'm working on:

#include <SPI.h>

If it is the first include in the pde file, no problem. But if I include other user contributed files first I get the errors below.

In file included from board_test.cpp:12:0:
C:\Users\jacob\Downloads\mpide-0022-chipkit-win-20110530\.\hardware\pic32\libraries\SPI/SPI.h:70:17: error: expected unqualified-id before numeric constant
C:\Users\jacob\Downloads\mpide-0022-chipkit-win-20110530\.\hardware\pic32\libraries\SPI/SPI.h:80:27: error: expected identifier before numeric constant
C:\Users\jacob\Downloads\mpide-0022-chipkit-win-20110530\.\hardware\pic32\libraries\SPI/SPI.h:80:27: error: expected ',' or '...' before numeric constant
C:\Users\jacob\Downloads\mpide-0022-chipkit-win-20110530\.\hardware\pic32\libraries\SPI/SPI.h:82:31: error: expected identifier before numeric constant
C:\Users\jacob\Downloads\mpide-0022-chipkit-win-20110530\.\hardware\pic32\libraries\SPI/SPI.h:82:31: error: expected ',' or '...' before numeric constant
C:\Users\jacob\Downloads\mpide-0022-chipkit-win-20110530\.\hardware\pic32\libraries\SPI/SPI.h:87:1: error: expected unqualified-id before numeric constant

My only guess is that the SPI lib is written in C and putting this after the C++ libs flips something out.

I don't know if SPI works yet, haven't started probing hardware.

Jacob


jasonk

Wed, 15 Jun 2011 06:18:25 +0000

Hi Jacob,

My guess is that there is a '#define BYTE' in one of the other header files that is causing problems for the SPI.h file Can you check the other header files that you are including?