I want to display the value of RX_BUFFER_SIZE of HardwareSerial.cpp in my program like that
void setup()
{
Serial.begin(9600); // For debugging only
Serial.print(F("\n\rRX_BUFFER_SIZE=")); //display value of RX_BUFFER_SIZE of HardwareSerial.cpp
Serial.println(RX_BUFFER_SIZE, DEC);
}
void loop()
{
}
But I have an error when I put that line
error: 'RX_BUFFER_SIZE' was not declared in this scope
Arduino IDE is v1.0.4
Can anyone please point me how to solve that problem?
Tom, thank for quick reply, but it does not work, same error as well, here is my sketch
#include <HardwareSerial.cpp>
//#include <HardwareSerial.h> //try but same error
void setup()
{
Serial.begin(9600); // For debugging only
Serial.print(F("\n\rRX_BUFFER_SIZE=")); //display value of RX_BUFFER_SIZE of HardwareSerial.cpp
Serial.println(RX_BUFFER_SIZE, DEC);
}
void loop()
{
}
Oh, you're right, it's SERIAL_BUFFER_SIZE. I apologize for that, now compile with no error. The reason to check the buffer size is I'm using both UNO and mega2560 together and to ensure the correct buffer size with related MCU.
You could have used the same calculation they do in HardwareSerial.cpp (based on the RAM size). It shouldn't be all that necessary to know the buffer size, and in any case both of those boards will be using 64 so I don't see what you have achieved here.