Hello LVD,
I'm not an C++ programmer and there is a lot I don't understand so this question is for you.
Please, i hope to use my FLSun in the coming days but now the firmware is not working as wanted
After download and compiling your version, my first compilation went well, but after putting my active serial port it went wrong???
* Select which serial port on the board will be used for communication with the host.
* This allows the connection of wireless adapters (for instance) to non-default port pins.
* Serial port 0 is always used by the Arduino bootloader regardless of this setting.
*
* :[0, 1, 2, 3, 4, 5, 6, 7]
*/
#define SERIAL_PORT 5
The error report is as down;
Arduino: 1.8.3 (Windows 10), Board:"Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"
sketch\MarlinSerial.cpp: In function 'void store_char(unsigned char)':
MarlinSerial.cpp:52: error: 'rx_buffer' was not declared in this scope
uint8_t h = rx_buffer.head;
^
In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:30:0,
from sketch\MarlinConfig.h:37,
from sketch\MarlinSerial.h:35,
from sketch\MarlinSerial.cpp:31:
sketch\MarlinSerial.cpp: In function 'void USART5_RX_vect()':
sketch\MarlinSerial.h:69:41: warning: 'USART5_RX_vect' appears to be a misspelled signal handler, missing __vector prefix [-Wmisspelled-isr]
#define M_USARTx_RX_vect SERIAL_REGNAME(USART,SERIAL_PORT,_RX_vect)
^
sketch\MarlinSerial.h:48:52: note: in expansion of macro 'SERIAL_REGNAME_INTERNAL'
#define SERIAL_REGNAME(registerbase,number,suffix) SERIAL_REGNAME_INTERNAL(registerbase,number,suffix)
^
sketch\MarlinSerial.h:69:26: note: in expansion of macro 'SERIAL_REGNAME'
#define M_USARTx_RX_vect SERIAL_REGNAME(USART,SERIAL_PORT,_RX_vect)
^
sketch\MarlinSerial.cpp:101:7: note: in expansion of macro 'M_USARTx_RX_vect'
ISR(M_USARTx_RX_vect) {
^
In file included from sketch\MarlinSerial.cpp:31:0:
MarlinSerial.h:65: error: 'UDR5' was not declared in this scope
#define M_UDRx SERIAL_REGNAME(UDR,SERIAL_PORT,)
^
sketch\MarlinSerial.h:52:63: note: in definition of macro 'SERIAL_REGNAME_INTERNAL'
#define SERIAL_REGNAME_INTERNAL(registerbase,number,suffix) registerbase##number##suffix
^
sketch\MarlinSerial.h:65:16: note: in expansion of macro 'SERIAL_REGNAME'
#define M_UDRx SERIAL_REGNAME(UDR,SERIAL_PORT,)
^
sketch\MarlinSerial.cpp:102:25: note: in expansion of macro 'M_UDRx'
unsigned char c = M_UDRx;
^
sketch\MarlinSerial.cpp: In static member function 'static void MarlinSerial::begin(long int)':
MarlinSerial.h:57: error: 'UCSR5A' was not declared in this scope
#define M_UCSRxA SERIAL_REGNAME(UCSR,SERIAL_PORT,A) // defines M_UCSRxA to be UCSRnA where n is the serial port number
^
sketch\MarlinSerial.h:52:63: note: in definition of macro 'SERIAL_REGNAME_INTERNAL'
#define SERIAL_REGNAME_INTERNAL(registerbase,number,suffix) registerbase##number##suffix
^
sketch\MarlinSerial.h:57:18: note: in expansion of macro 'SERIAL_REGNAME'
#define M_UCSRxA SERIAL_REGNAME(UCSR,SERIAL_PORT,A) // defines M_UCSRxA to be UCSRnA where n is the serial port number
^
sketch\MarlinSerial.cpp:127:5: note: in expansion of macro 'M_UCSRxA'
M_UCSRxA = _BV(M_U2Xx);
^
In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,
from sketch\fastio.h:31,
from sketch\MarlinConfig.h:26,
from sketch\MarlinSerial.h:35,
from sketch\MarlinSerial.cpp:31:
MarlinSerial.h:70: error: 'U2X5' was not declared in this scope
#define M_U2Xx SERIAL_REGNAME(U2X,SERIAL_PORT,)
^
sketch\MarlinSerial.h:48:52: note: in expansion of macro 'SERIAL_REGNAME_INTERNAL'
#define SERIAL_REGNAME(registerbase,number,suffix) SERIAL_REGNAME_INTERNAL(registerbase,number,suffix)
^
sketch\MarlinSerial.h:70:16: note: in expansion of macro 'SERIAL_REGNAME'
#define M_U2Xx SERIAL_REGNAME(U2X,SERIAL_PORT,)
^
sketch\MarlinSerial.cpp:127:20: note: in expansion of macro 'M_U2Xx'
M_UCSRxA = _BV(M_U2Xx);
^
In file included from sketch\MarlinSerial.cpp:31:0:
MarlinSerial.h:57: error: 'UCSR5A' was not declared in this scope
#define M_UCSRxA SERIAL_REGNAME(UCSR,SERIAL_PORT,A) // defines M_UCSRxA to be UCSRnA where n is the serial port number
^
sketch\MarlinSerial.h:52:63: note: in definition of macro 'SERIAL_REGNAME_INTERNAL'
#define SERIAL_REGNAME_INTERNAL(registerbase,number,suffix) registerbase##number##suffix
^
sketch\MarlinSerial.h:57:18: note: in expansion of macro 'SERIAL_REGNAME'
#define M_UCSRxA SERIAL_REGNAME(UCSR,SERIAL_PORT,A) // defines M_UCSRxA to be UCSRnA where n is the serial port number
^
sketch\MarlinSerial.cpp:131:5: note: in expansion of macro 'M_UCSRxA'
M_UCSRxA = 0;
^
MarlinSerial.h:66: error: 'UBRR5H' was not declared in this scope
#define M_UBRRxH SERIAL_REGNAME(UBRR,SERIAL_PORT,H)
^
sketch\MarlinSerial.h:52:63: note: in definition of macro 'SERIAL_REGNAME_INTERNAL'
#define SERIAL_REGNAME_INTERNAL(registerbase,number,suffix) registerbase##number##suffix
^
sketch\MarlinSerial.h:66:18: note: in expansion of macro 'SERIAL_REGNAME'
#define M_UBRRxH SERIAL_REGNAME(UBRR,SERIAL_PORT,H)
^
sketch\MarlinSerial.cpp:136:3: note: in expansion of macro 'M_UBRRxH'
M_UBRRxH = baud_setting >> 8;
^
MarlinSerial.h:67: error: 'UBRR5L' was not declared in this scope
#define M_UBRRxL SERIAL_REGNAME(UBRR,SERIAL_PORT,L)
^
sketch\MarlinSerial.h:52:63: note: in definition of macro 'SERIAL_REGNAME_INTERNAL'
#define SERIAL_REGNAME_INTERNAL(registerbase,number,suffix) registerbase##number##suffix
^
sketch\MarlinSerial.h:67:18: note: in expansion of macro 'SERIAL_REGNAME'
#define M_UBRRxL SERIAL_REGNAME(UBRR,SERIAL_PORT,L)
^
sketch\MarlinSerial.cpp:137:3: note: in expansion of macro 'M_UBRRxL'
M_UBRRxL = baud_setting;
^
In file included from sketch\MarlinConfig.h:27:0,
from sketch\MarlinSerial.h:35,
from sketch\MarlinSerial.cpp:31:
MarlinSerial.h:58: error: 'UCSR5B' was not declared in this scope
#define M_UCSRxB SERIAL_REGNAME(UCSR,SERIAL_PORT,
^
sketch\macros.h:51:19: note: in definition of macro 'SBI'
#define SBI(n,b) (n |= _BV(b))
^
sketch\MarlinSerial.h:48:52: note: in expansion of macro 'SERIAL_REGNAME_INTERNAL'
#define SERIAL_REGNAME(registerbase,number,suffix) SERIAL_REGNAME_INTERNAL(registerbase,number,suffix)
^
sketch\MarlinSerial.h:58:18: note: in expansion of macro 'SERIAL_REGNAME'
#define M_UCSRxB SERIAL_REGNAME(UCSR,SERIAL_PORT,
^
sketch\MarlinSerial.cpp:139:7: note: in expansion of macro 'M_UCSRxB'
SBI(M_UCSRxB, M_RXENx);
^
In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,
from sketch\fastio.h:31,
from sketch\MarlinConfig.h:26,
from sketch\MarlinSerial.h:35,
from sketch\MarlinSerial.cpp:31:
MarlinSerial.h:59: error: 'RXEN5' was not declared in this scope
#define M_RXENx SERIAL_REGNAME(RXEN,SERIAL_PORT,)
^
sketch\MarlinSerial.cpp:139:3: note: in expansion of macro 'SBI'
SBI(M_UCSRxB, M_RXENx);
^
sketch\MarlinSerial.h:48:52: note: in expansion of macro 'SERIAL_REGNAME_INTERNAL'
#define SERIAL_REGNAME(registerbase,number,suffix) SERIAL_REGNAME_INTERNAL(registerbase,number,suffix)
^
sketch\MarlinSerial.h:59:17: note: in expansion of macro 'SERIAL_REGNAME'
#define M_RXENx SERIAL_REGNAME(RXEN,SERIAL_PORT,)
^
sketch\MarlinSerial.cpp:139:17: note: in expansion of macro 'M_RXENx'
SBI(M_UCSRxB, M_RXENx);
^
MarlinSerial.h:60: error: 'TXEN5' was not declared in this scope
#define M_TXENx SERIAL_REGNAME(TXEN,SERIAL_PORT,)
^
sketch\MarlinSerial.cpp:140:3: note: in expansion of macro 'SBI'
SBI(M_UCSRxB, M_TXENx);
^
sketch\MarlinSerial.h:48:52: note: in expansion of macro 'SERIAL_REGNAME_INTERNAL'
#define SERIAL_REGNAME(registerbase,number,suffix) SERIAL_REGNAME_INTERNAL(registerbase,number,suffix)
^
sketch\MarlinSerial.h:60:17: note: in expansion of macro 'SERIAL_REGNAME'
#define M_TXENx SERIAL_REGNAME(TXEN,SERIAL_PORT,)
^
sketch\MarlinSerial.cpp:140:17: note: in expansion of macro 'M_TXENx'
SBI(M_UCSRxB, M_TXENx);
^
MarlinSerial.h:62: error: 'RXCIE5' was not declared in this scope
#define M_RXCIEx SERIAL_REGNAME(RXCIE,SERIAL_PORT,)
^
sketch\MarlinSerial.cpp:141:3: note: in expansion of macro 'SBI'
SBI(M_UCSRxB, M_RXCIEx);
^
sketch\MarlinSerial.h:48:52: note: in expansion of macro 'SERIAL_REGNAME_INTERNAL'
#define SERIAL_REGNAME(registerbase,number,suffix) SERIAL_REGNAME_INTERNAL(registerbase,number,suffix)
^
sketch\MarlinSerial.h:62:18: note: in expansion of macro 'SERIAL_REGNAME'
#define M_RXCIEx SERIAL_REGNAME(RXCIE,SERIAL_PORT,)
^
sketch\MarlinSerial.cpp:141:17: note: in expansion of macro 'M_RXCIEx'
SBI(M_UCSRxB, M_RXCIEx);
^
In file included from sketch\MarlinConfig.h:27:0,
from sketch\MarlinSerial.h:35,
from sketch\MarlinSerial.cpp:31:
sketch\MarlinSerial.cpp: In static member function 'static void MarlinSerial::end()':
MarlinSerial.h:58: error: 'UCSR5B' was not declared in this scope
#define M_UCSRxB SERIAL_REGNAME(UCSR,SERIAL_PORT,
^
sketch\macros.h:52:19: note: in definition of macro 'CBI'
#define CBI(n,b) (n &= ~_BV(b))
^
sketch\MarlinSerial.h:48:52: note: in expansion of macro 'SERIAL_REGNAME_INTERNAL'
#define SERIAL_REGNAME(registerbase,number,suffix) SERIAL_REGNAME_INTERNAL(registerbase,number,suffix)
^
sketch\MarlinSerial.h:58:18: note: in expansion of macro 'SERIAL_REGNAME'
#define M_UCSRxB SERIAL_REGNAME(UCSR,SERIAL_PORT,
^
sketch\MarlinSerial.cpp:149:7: note: in expansion of macro 'M_UCSRxB'
CBI(M_UCSRxB, M_RXENx);
^
In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,
from sketch\fastio.h:31,
from sketch\MarlinConfig.h:26,
from sketch\MarlinSerial.h:35,
from sketch\MarlinSerial.cpp:31:
MarlinSerial.h:59: error: 'RXEN5' was not declared in this scope
#define M_RXENx SERIAL_REGNAME(RXEN,SERIAL_PORT,)
^
sketch\MarlinSerial.cpp:149:3: note: in expansion of macro 'CBI'
CBI(M_UCSRxB, M_RXENx);
^
sketch\MarlinSerial.h:48:52: note: in expansion of macro 'SERIAL_REGNAME_INTERNAL'
#define SERIAL_REGNAME(registerbase,number,suffix) SERIAL_REGNAME_INTERNAL(registerbase,number,suffix)
^
sketch\MarlinSerial.h:59:17: note: in expansion of macro 'SERIAL_REGNAME'
#define M_RXENx SERIAL_REGNAME(RXEN,SERIAL_PORT,)
^
sketch\MarlinSerial.cpp:149:17: note: in expansion of macro 'M_RXENx'
CBI(M_UCSRxB, M_RXENx);
^
MarlinSerial.h:60: error: 'TXEN5' was not declared in this scope
#define M_TXENx SERIAL_REGNAME(TXEN,SERIAL_PORT,)
^
sketch\MarlinSerial.cpp:150:3: note: in expansion of macro 'CBI'
CBI(M_UCSRxB, M_TXENx);
^
sketch\MarlinSerial.h:48:52: note: in expansion of macro 'SERIAL_REGNAME_INTERNAL'
#define SERIAL_REGNAME(registerbase,number,suffix) SERIAL_REGNAME_INTERNAL(registerbase,number,suffix)
^
sketch\MarlinSerial.h:60:17: note: in expansion of macro 'SERIAL_REGNAME'
#define M_TXENx SERIAL_REGNAME(TXEN,SERIAL_PORT,)
^
sketch\MarlinSerial.cpp:150:17: note: in expansion of macro 'M_TXENx'
CBI(M_UCSRxB, M_TXENx);
^
MarlinSerial.h:62: error: 'RXCIE5' was not declared in this scope
#define M_RXCIEx SERIAL_REGNAME(RXCIE,SERIAL_PORT,)
^
sketch\MarlinSerial.cpp:151:3: note: in expansion of macro 'CBI'
CBI(M_UCSRxB, M_RXCIEx);
^
sketch\MarlinSerial.h:48:52: note: in expansion of macro 'SERIAL_REGNAME_INTERNAL'
#define SERIAL_REGNAME(registerbase,number,suffix) SERIAL_REGNAME_INTERNAL(registerbase,number,suffix)
^
sketch\MarlinSerial.h:62:18: note: in expansion of macro 'SERIAL_REGNAME'
#define M_RXCIEx SERIAL_REGNAME(RXCIE,SERIAL_PORT,)
^
sketch\MarlinSerial.cpp:151:17: note: in expansion of macro 'M_RXCIEx'
CBI(M_UCSRxB, M_RXCIEx);
^
MarlinSerial.h:64: error: 'UDRIE5' was not declared in this scope
#define M_UDRIEx SERIAL_REGNAME(UDRIE,SERIAL_PORT,)
^
sketch\MarlinSerial.cpp:152:3: note: in expansion of macro 'CBI'
CBI(M_UCSRxB, M_UDRIEx);
^
sketch\MarlinSerial.h:48:52: note: in expansion of macro 'SERIAL_REGNAME_INTERNAL'
#define SERIAL_REGNAME(registerbase,number,suffix) SERIAL_REGNAME_INTERNAL(registerbase,number,suffix)
^
sketch\MarlinSerial.h:64:18: note: in expansion of macro 'SERIAL_REGNAME'
#define M_UDRIEx SERIAL_REGNAME(UDRIE,SERIAL_PORT,)
^
sketch\MarlinSerial.cpp:152:17: note: in expansion of macro 'M_UDRIEx'
CBI(M_UCSRxB, M_UDRIEx);
^
In file included from sketch\MarlinConfig.h:27:0,
from sketch\MarlinSerial.h:35,
from sketch\MarlinSerial.cpp:31:
sketch\MarlinSerial.cpp: In static member function 'static void MarlinSerial::checkRx()':
MarlinSerial.h:57: error: 'UCSR5A' was not declared in this scope
#define M_UCSRxA SERIAL_REGNAME(UCSR,SERIAL_PORT,A) // defines M_UCSRxA to be UCSRnA where n is the serial port number
^
sketch\macros.h:50:22: note: in definition of macro 'TEST'
#define TEST(n,b) (((n)&_BV(b))!=0)
^
sketch\MarlinSerial.h:48:52: note: in expansion of macro 'SERIAL_REGNAME_INTERNAL'
#define SERIAL_REGNAME(registerbase,number,suffix) SERIAL_REGNAME_INTERNAL(registerbase,number,suffix)
^
sketch\MarlinSerial.h:57:18: note: in expansion of macro 'SERIAL_REGNAME'
#define M_UCSRxA SERIAL_REGNAME(UCSR,SERIAL_PORT,A) // defines M_UCSRxA to be UCSRnA where n is the serial port number
^
sketch\MarlinSerial.cpp:156:12: note: in expansion of macro 'M_UCSRxA'
if (TEST(M_UCSRxA, M_RXCx)) {
^
In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,
from sketch\fastio.h:31,
from sketch\MarlinConfig.h:26,
from sketch\MarlinSerial.h:35,
from sketch\MarlinSerial.cpp:31:
MarlinSerial.h:68: error: 'RXC5' was not declared in this scope
#define M_RXCx SERIAL_REGNAME(RXC,SERIAL_PORT,)
^
sketch\MarlinSerial.cpp:156:7: note: in expansion of macro 'TEST'
if (TEST(M_UCSRxA, M_RXCx)) {
^
sketch\MarlinSerial.h:48:52: note: in expansion of macro 'SERIAL_REGNAME_INTERNAL'
#define SERIAL_REGNAME(registerbase,number,suffix) SERIAL_REGNAME_INTERNAL(registerbase,number,suffix)
^
sketch\MarlinSerial.h:68:16: note: in expansion of macro 'SERIAL_REGNAME'
#define M_RXCx SERIAL_REGNAME(RXC,SERIAL_PORT,)
^
sketch\MarlinSerial.cpp:156:22: note: in expansion of macro 'M_RXCx'
if (TEST(M_UCSRxA, M_RXCx)) {
^
In file included from sketch\MarlinSerial.cpp:31:0:
MarlinSerial.h:65: error: 'UDR5' was not declared in this scope
#define M_UDRx SERIAL_REGNAME(UDR,SERIAL_PORT,)
^
sketch\MarlinSerial.h:52:63: note: in definition of macro 'SERIAL_REGNAME_INTERNAL'
#define SERIAL_REGNAME_INTERNAL(registerbase,number,suffix) registerbase##number##suffix
^
sketch\MarlinSerial.h:65:16: note: in expansion of macro 'SERIAL_REGNAME'
#define M_UDRx SERIAL_REGNAME(UDR,SERIAL_PORT,)
^
sketch\MarlinSerial.cpp:157:19: note: in expansion of macro 'M_UDRx'
uint8_t c = M_UDRx;
^
sketch\MarlinSerial.cpp: In static member function 'static int MarlinSerial::peek()':
MarlinSerial.cpp:164: error: 'rx_buffer' was not declared in this scope
int v = rx_buffer.head == rx_buffer.tail ? -1 : rx_buffer.buffer[rx_buffer.tail];
^
sketch\MarlinSerial.cpp: In static member function 'static int MarlinSerial::read()':
MarlinSerial.cpp:172: error: 'rx_buffer' was not declared in this scope
uint8_t t = rx_buffer.tail;
^
sketch\MarlinSerial.cpp: In static member function 'static uint8_t MarlinSerial::available()':
MarlinSerial.cpp:186: error: 'rx_buffer' was not declared in this scope
uint8_t h = rx_buffer.head,
^
MarlinSerial.cpp:189: error: 't' was not declared in this scope
return (uint8_t)(RX_BUFFER_SIZE + h - t) & (RX_BUFFER_SIZE - 1);
^
sketch\MarlinSerial.cpp: In static member function 'static void MarlinSerial::flush()':
MarlinSerial.cpp:200: error: 'rx_buffer' was not declared in this scope
rx_buffer.head = rx_buffer.tail;
^
In file included from sketch\MarlinConfig.h:27:0,
from sketch\MarlinSerial.h:35,
from sketch\MarlinSerial.cpp:31:
sketch\MarlinSerial.cpp: In static member function 'static void MarlinSerial::write(uint8_t)':
MarlinSerial.h:57: error: 'UCSR5A' was not declared in this scope
#define M_UCSRxA SERIAL_REGNAME(UCSR,SERIAL_PORT,A) // defines M_UCSRxA to be UCSRnA where n is the serial port number
^
sketch\macros.h:50:22: note: in definition of macro 'TEST'
#define TEST(n,b) (((n)&_BV(b))!=0)
^
sketch\MarlinSerial.h:48:52: note: in expansion of macro 'SERIAL_REGNAME_INTERNAL'
#define SERIAL_REGNAME(registerbase,number,suffix) SERIAL_REGNAME_INTERNAL(registerbase,number,suffix)
^
sketch\MarlinSerial.h:57:18: note: in expansion of macro 'SERIAL_REGNAME'
#define M_UCSRxA SERIAL_REGNAME(UCSR,SERIAL_PORT,A) // defines M_UCSRxA to be UCSRnA where n is the serial port number
^
sketch\MarlinSerial.cpp:277:18: note: in expansion of macro 'M_UCSRxA'
while (!TEST(M_UCSRxA, M_UDREx))
^
In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,
from sketch\fastio.h:31,
from sketch\MarlinConfig.h:26,
from sketch\MarlinSerial.h:35,
from sketch\MarlinSerial.cpp:31:
MarlinSerial.h:63: error: 'UDRE5' was not declared in this scope
#define M_UDREx SERIAL_REGNAME(UDRE,SERIAL_PORT,)
^
sketch\MarlinSerial.cpp:277:13: note: in expansion of macro 'TEST'
while (!TEST(M_UCSRxA, M_UDREx))
^
sketch\MarlinSerial.h:48:52: note: in expansion of macro 'SERIAL_REGNAME_INTERNAL'
#define SERIAL_REGNAME(registerbase,number,suffix) SERIAL_REGNAME_INTERNAL(registerbase,number,suffix)
^
sketch\MarlinSerial.h:63:17: note: in expansion of macro 'SERIAL_REGNAME'
#define M_UDREx SERIAL_REGNAME(UDRE,SERIAL_PORT,)
^
sketch\MarlinSerial.cpp:277:28: note: in expansion of macro 'M_UDREx'
while (!TEST(M_UCSRxA, M_UDREx))
^
In file included from sketch\MarlinSerial.cpp:31:0:
MarlinSerial.h:65: error: 'UDR5' was not declared in this scope
#define M_UDRx SERIAL_REGNAME(UDR,SERIAL_PORT,)
^
sketch\MarlinSerial.h:52:63: note: in definition of macro 'SERIAL_REGNAME_INTERNAL'
#define SERIAL_REGNAME_INTERNAL(registerbase,number,suffix) registerbase##number##suffix
^
sketch\MarlinSerial.h:65:16: note: in expansion of macro 'SERIAL_REGNAME'
#define M_UDRx SERIAL_REGNAME(UDR,SERIAL_PORT,)
^
sketch\MarlinSerial.cpp:279:5: note: in expansion of macro 'M_UDRx'
M_UDRx = c;
^
exit status 1
'rx_buffer' was not declared in this scope
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.