Welcome! Log In Create A New Profile

Advanced

HardwareSerial.cpp vs arduino 1.0.3

Posted by uski 
HardwareSerial.cpp vs arduino 1.0.3
December 27, 2012 03:18PM
Hello,

This is my first experience with Repetier FW.

I installed a fresh copy of the latest arduino IDE for 64bits Linux. This is arduino 1.0.3

I copied the
repetier-firmware-0_71/boards/arduino 1.0+/HardwareSerial.cpp
file from the Repetier FW distribution to
arduino-1.0.3/hardware/arduino/cores/arduino/HardwareSeral.cpp
file from the arduino installation.

Then, I tried compiling, and I got many errors : (see below)

It looks like there are conflicting declaration in HardwareSerial.h in the arduino distribution.

So, shouldn't Repetier FW also come with a modified HardwareSerial.h alongside the modified HardwareSerial.cpp ?
Or am I missing something obvious ?

Thanks smiling smiley
uski

-------------------------------------------------------

Compilation errors below :

/home/me/arduino-1.0.3/hardware/arduino/cores/arduino/HardwareSerial.cpp:280: error: prototype for ‘HardwareSerial::HardwareSerial(ring_buffer*, ring_buffer*, volatile uint8_t*, volatile uint8_t*, volatile uint8_t*, volatile uint8_t*, volatile uint8_t*, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t)’ does not match any in class ‘HardwareSerial’
/home/me/arduino-1.0.3/hardware/arduino/cores/arduino/HardwareSerial.h:33: error: candidates are: HardwareSerial::HardwareSerial(const HardwareSerial&)
/home/me/arduino-1.0.3/hardware/arduino/cores/arduino/HardwareSerial.h:54: error: HardwareSerial::HardwareSerial(ring_buffer*, ring_buffer*, volatile uint8_t*, volatile uint8_t*, volatile uint8_t*, volatile uint8_t*, volatile uint8_t*, volatile uint8_t*, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t)
/home/me/arduino-1.0.3/hardware/arduino/cores/arduino/HardwareSerial.cpp:408: error: no matching function for call to ‘HardwareSerial::HardwareSerial(ring_buffer*, ring_buffer*, volatile uint8_t*, volatile uint8_t*, volatile uint8_t*, volatile uint8_t*, volatile uint8_t*, int, int, int, int, int)’
/home/me/arduino-1.0.3/hardware/arduino/cores/arduino/HardwareSerial.h:54: note: candidates are: HardwareSerial::HardwareSerial(ring_buffer*, ring_buffer*, volatile uint8_t*, volatile uint8_t*, volatile uint8_t*, volatile uint8_t*, volatile uint8_t*, volatile uint8_t*, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t)
/home/me/arduino-1.0.3/hardware/arduino/cores/arduino/HardwareSerial.h:33: note: HardwareSerial::HardwareSerial(const HardwareSerial&)
/home/me/arduino-1.0.3/hardware/arduino/cores/arduino/HardwareSerial.cpp:416: error: no matching function for call to ‘HardwareSerial::HardwareSerial(ring_buffer*, ring_buffer*, volatile uint8_t*, volatile uint8_t*, volatile uint8_t*, volatile uint8_t*, volatile uint8_t*, int, int, int, int, int)’
/home/me/arduino-1.0.3/hardware/arduino/cores/arduino/HardwareSerial.h:54: note: candidates are: HardwareSerial::HardwareSerial(ring_buffer*, ring_buffer*, volatile uint8_t*, volatile uint8_t*, volatile uint8_t*, volatile uint8_t*, volatile uint8_t*, volatile uint8_t*, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t)
/home/me/arduino-1.0.3/hardware/arduino/cores/arduino/HardwareSerial.h:33: note: HardwareSerial::HardwareSerial(const HardwareSerial&)
/home/me/arduino-1.0.3/hardware/arduino/cores/arduino/HardwareSerial.cpp:419: error: no matching function for call to ‘HardwareSerial::HardwareSerial(ring_buffer*, ring_buffer*, volatile uint8_t*, volatile uint8_t*, volatile uint8_t*, volatile uint8_t*, volatile uint8_t*, int, int, int, int, int)’
/home/me/arduino-1.0.3/hardware/arduino/cores/arduino/HardwareSerial.h:54: note: candidates are: HardwareSerial::HardwareSerial(ring_buffer*, ring_buffer*, volatile uint8_t*, volatile uint8_t*, volatile uint8_t*, volatile uint8_t*, volatile uint8_t*, volatile uint8_t*, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t)
/home/me/arduino-1.0.3/hardware/arduino/cores/arduino/HardwareSerial.h:33: note: HardwareSerial::HardwareSerial(const HardwareSerial&)
/home/me/arduino-1.0.3/hardware/arduino/cores/arduino/HardwareSerial.cpp:422: error: no matching function for call to ‘HardwareSerial::HardwareSerial(ring_buffer*, ring_buffer*, volatile uint8_t*, volatile uint8_t*, volatile uint8_t*, volatile uint8_t*, volatile uint8_t*, int, int, int, int, int)’
/home/me/arduino-1.0.3/hardware/arduino/cores/arduino/HardwareSerial.h:54: note: candidates are: HardwareSerial::HardwareSerial(ring_buffer*, ring_buffer*, volatile uint8_t*, volatile uint8_t*, volatile uint8_t*, volatile uint8_t*, volatile uint8_t*, volatile uint8_t*, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t)
/home/me/arduino-1.0.3/hardware/arduino/cores/arduino/HardwareSerial.h:33: note: HardwareSerial::HardwareSerial(const HardwareSerial&)
I have the exact same error over here. I had no such problems when I uploaded an earlier version of repetier on my other pc a few months ago.
Sry for double post. I'm really not good at this because I haven't done object oriented programming in C++ yet but I have looked in the files near the first error. I'm guessing the header file contains a constructer for HardwareSerial that you call on line 208 in the Cpp file.

If that is true, doesn't the constructor expect another one of those volatile variables , namely "volatile uint8_t *ucsrc" ?
Re: HardwareSerial.cpp vs arduino 1.0.3
December 27, 2012 08:18PM
Just tested it, and it does compile if you just remove volatile uint8_t *ucsrc from the "HardwareSerial.h" file, not sure if
we are supposed to do that though.

Gonna make a profile for this forum, guessing that I will be able to edit my posts then grinning smiley
Re: HardwareSerial.cpp vs arduino 1.0.3
December 28, 2012 05:15AM
New arduino version new problems :-)

When I wrote this we had Arduino 1.0. I have checked the files and with 1.0.3 they made a change in HardwareSerial to allow setting parity and databits. WIth that change you have 2 options:

1. Use simple the original files
2. Do what hors said and remove the volatile uint8_t *ucsrc from the "HardwareSerial.h"
2.b copy the old HardwareSerial.h from Arduin 1.0.0

Both variants should work and give the same results. The firmware uses the default 8 bit, no parity, 1 stop bit.


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Re: HardwareSerial.cpp vs arduino 1.0.3
December 28, 2012 05:25AM
Ok I uploaded a update to github which contains the original HardwerSerial.h now in the boards section.


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Sorry, only registered users may post in this forum.

Click here to login