HardwareSerial vs Serial_ in 1.5x

I'm trying to switch from 1.0x to 1.5x and some of my code no longer works.

This works great in 1.0x on my mega with




char HS_Console::getSerialByte(HardwareSerial * ThisSerial, bool ignore_EOL){
    char read_byte = 0;
    do {
        if ( ThisSerial->available() ) {
            read_byte = ThisSerial->read();
            if  ( ignore_EOL && ( read_byte == 13 || read_byte == 10 )) read_byte = 0;
        else delay(100);
    } while ( !read_byte );
    return read_byte;

In 1.5.x I get:

HS_Console.h:no known conversion for argument 1 from 'Serial_*' to 'HardwareSerial*'
HS_Console.cpp:In member function 'void HS_Console::HSconsoleUtilities()'
HS_Console.cpp:514:37: error: no matching function for call to 'HS_Console::getSerialByte(Serial_*, bool)'
:switch (getSerialByte(&Serial,true)) {
HS_Console.cpp:candidate is
HS_Console.cpp:getSerialByte(HardwareSerial*, bool)
 char HS_Console*:getSerialByte(HardwareSerial * ThisSerial, bool ignore_EOL){

but if I add a second method, identical except is starts:

char getSerialByte(Serial_ *ThisSerial, bool ignore_EOL)

I get

HS_Console.cpp:In file included from
HS_Console.h:22:23: error: 'Serial_' has not been declared
:char  getSerialByte(Serial_ *ThisSerial, bool ignore_EOL);

I've read the release notes and I can tell that HardwareSerial was changed, but I haven't found anything on how to implement this. Anyone point me in the right direction?

According to the compiler the problem is in HSconsoleUtilities. Which you did not include. So, the answer to your question is "no".

I've done some poking around and I think some of my confusion came from this post: Unable to use pass HardwareSerial to classes in due but I see now that UARTClass and USARTClass are specific to the Due and not 1.5.x.

My error now when I try to compile is:

/arduino-1.5.8/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr6/libc.a(isspace.o): In function `isspace':
(.text.avr-libc+0x2): relocation truncated to fit: R_AVR_13_PCREL against symbol `__ctype_isfalse' defined in .text.avr-libc section in /arduino-1.5.8/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr6/libc.a(cty_isfalse.o)
collect2: error: ld returned 1 exit status
Error compiling.

My error now when I try to compile code I haven't posted is

You left a few words out...