I have a working Eclipse project that's using softwareserial to talk to a wifi chip. To conserve memory I want to get rid of the softwareserial library and use Serial1 as a hardware serial port (TX1 in my 2560 board).
I added #include "HardwareSerial.h" and try to use Serial1 directly in the code, but the compiler is throwing this error:
Symbol 'Serial1' could not be resolved
I understand that HardwareSerial.h declares Serial1 only if UBRR1H is defined.
Juraj:
does it compile for Mega variant? because standard variant (for 328p) doesn't have Serial1
It's compiling for the Mega variant. These are the parameters for the Eclipse Arduino target:
Target Name: Arduino 2560
Serial Port: /dev/ttyACM0
Board Type: Arduino/Genuino Mega or Mega 2560
Processor: ATmega2560 (Mega 2560)
Programmer: AVR ISP
One would think Eclipse would set the appropriate #define statements when setting up a target with multiple hardware serial ports but only a single Serial is defined.
preferences->C/C++->indexer->index unused headers.
preferences->C/C++->indexer->index source and header files opened in the editor.
preferences->C/C++->indexer->Index all variants of specific headers. Add arduino.h and WProgram.h separated by commas.
Do next four in this sequence
Right click the project->index->Search for unresolved includes.
Right click the project->index->Freshen all Files.
Right click the project->index->Update with modified files.
Right click the project->index->Rebuild.