Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HardwareSerial conflicting declaration #42

Open
josepmsa opened this issue Feb 1, 2017 · 2 comments
Open

HardwareSerial conflicting declaration #42

josepmsa opened this issue Feb 1, 2017 · 2 comments

Comments

@josepmsa
Copy link

josepmsa commented Feb 1, 2017

Hi!
I am trying to compile controlino for an Arduino Due board, but I am getting the following error messages:
controlino:97: error: conflicting declaration 'HardwareSerial Serial1' extern HardwareSerial Serial1; ^ In file included from /home/jsanchez/.arduino15/packages/arduino/hardware/sam/1.6.8/cores/arduino/Arduino.h:201:0, from /home/jsanchez/instrumentino-master/controlino/controlino/controlino.ino:70: /home/jsanchez/.arduino15/packages/arduino/hardware/sam/1.6.8/variants/arduino_due_x/variant.h:247:19: error: 'Serial1' has a previous declaration as 'USARTClass Serial1' extern USARTClass Serial1; ^ controlino:98: error: conflicting declaration 'HardwareSerial Serial2' extern HardwareSerial Serial2; ^ In file included from /home/jsanchez/.arduino15/packages/arduino/hardware/sam/1.6.8/cores/arduino/Arduino.h:201:0, from /home/jsanchez/instrumentino-master/controlino/controlino/controlino.ino:70: /home/jsanchez/.arduino15/packages/arduino/hardware/sam/1.6.8/variants/arduino_due_x/variant.h:248:19: error: 'Serial2' has a previous declaration as 'USARTClass Serial2' extern USARTClass Serial2; ^ controlino:99: error: conflicting declaration 'HardwareSerial Serial3' extern HardwareSerial Serial3; ^ In file included from /home/jsanchez/.arduino15/packages/arduino/hardware/sam/1.6.8/cores/arduino/Arduino.h:201:0, from /home/jsanchez/instrumentino-master/controlino/controlino/controlino.ino:70: /home/jsanchez/.arduino15/packages/arduino/hardware/sam/1.6.8/variants/arduino_due_x/variant.h:249:19: error: 'Serial3' has a previous declaration as 'USARTClass Serial3' extern USARTClass Serial3; ^ controlino:258: error: conflicting declaration 'HardwareSerial Serial' extern HardwareSerial Serial; ^ In file included from /home/jsanchez/.arduino15/packages/arduino/hardware/sam/1.6.8/cores/arduino/Arduino.h:201:0, from /home/jsanchez/instrumentino-master/controlino/controlino/controlino.ino:70: /home/jsanchez/.arduino15/packages/arduino/hardware/sam/1.6.8/variants/arduino_due_x/variant.h:246:18: error: 'Serial' has a previous declaration as 'UARTClass Serial' extern UARTClass Serial; ^ exit status 1 conflicting declaration 'HardwareSerial Serial1'

However, for an Arduino Uno it just works fine and it compiles correctly. Googling the problem I found this github thread. In the last comment they mention that those device specific flags may be the origin of the problem, but I don't know if that is applicable to your code.

Have you ever had this issue before?

Thank you in advanced!
JosepM

@yoelk
Copy link
Owner

yoelk commented Feb 1, 2017 via email

@pescadoranton
Copy link

Hello,

I have also used instrumentino with the arduino due and I had to make some changes.
I have replaced these commands on Controlino:

extern HardwareSerial Serial;
by
extern UARTClass Serial;

and

extern HardwareSerial Serial1;
extern HardwareSerial Serial2;
extern HardwareSerial Serial3;
by
extern USARTClass Serial1;
extern USARTClass Serial2;
extern USARTClass Serial3;

On the other hand in order to use SPI comunication. I have replaced:

SPI.transfer(strtol(argV[i], NULL, 10));
by
SPI.transfer(cs_pin, strtol(argV[i], NULL, 10));

Best regards,
pescadoranton

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants