New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.0.x] Can't compile with BOARD_ULTIMAKER selected #11585

Closed
KlausHans opened this Issue Aug 18, 2018 · 4 comments

Comments

Projects
None yet
4 participants
@KlausHans

KlausHans commented Aug 18, 2018

Description

Hello, i use a GT2560 Board and the manufacturer (Geetech) used BOARD_ULTIMAKER as definition, so did i on 1.1.9. Now i wanted to go to 2.0 and unfortunately a compile error appears:

In file included from sketch/src/HAL/HAL_AVR/../../inc/../HAL/HAL_AVR/HAL.h:38:0,
                 from sketch/src/HAL/HAL_AVR/../../inc/MarlinConfig.h:28,
                 from sketch/src/HAL/HAL_AVR/MarlinSerial.cpp:38:
sketch/src/HAL/HAL_AVR/../../inc/../pins/pins_ULTIMAKER.h:112:33: error: pasting "/* PIN that has to be turned on right after start, to keep power flowing.*/" and "_DDR" does not give a valid preprocessing token
 #define SUICIDE_PIN        54   // PIN that has to be turned on right after start, to keep power flowing.
                                 ^
sketch/src/HAL/HAL_AVR/../../inc/../HAL/HAL_AVR/fastio_AVR.h:84:42: note: in definition of macro '_SET_OUTPUT'
 #define _SET_OUTPUT(IO)       SBI(DIO ## IO ## _DDR, DIO ## IO ## _PIN)
                                          ^
sketch/src/HAL/HAL_AVR/../../inc/../HAL/HAL_AVR/fastio_AVR.h:102:35: note: in expansion of macro 'SET_OUTPUT'
 #define OUT_WRITE(IO,V)       do{ SET_OUTPUT(IO); WRITE(IO,V); }while(0)
                                   ^
sketch/src/HAL/HAL_AVR/../../Marlin.h:224:27: note: in expansion of macro 'OUT_WRITE'
   inline void suicide() { OUT_WRITE(SUICIDE_PIN, LOW); }
                           ^
sketch/src/HAL/HAL_AVR/../../Marlin.h:224:37: note: in expansion of macro 'SUICIDE_PIN'
   inline void suicide() { OUT_WRITE(SUICIDE_PIN, LOW); }
                                     ^
sketch/src/HAL/HAL_AVR/../../inc/../pins/pins_ULTIMAKER.h:112:33: error: pasting "/* PIN that has to be turned on right after start, to keep power flowing.*/" and "_PIN" does not give a valid preprocessing token
 #define SUICIDE_PIN        54   // PIN that has to be turned on right after start, to keep power flowing.
                                 ^
sketch/src/HAL/HAL_AVR/../../inc/../HAL/HAL_AVR/fastio_AVR.h:84:61: note: in definition of macro '_SET_OUTPUT'
 #define _SET_OUTPUT(IO)       SBI(DIO ## IO ## _DDR, DIO ## IO ## _PIN)
                                                             ^
sketch/src/HAL/HAL_AVR/../../inc/../HAL/HAL_AVR/fastio_AVR.h:102:35: note: in expansion of macro 'SET_OUTPUT'
 #define OUT_WRITE(IO,V)       do{ SET_OUTPUT(IO); WRITE(IO,V); }while(0)
                                   ^
sketch/src/HAL/HAL_AVR/../../Marlin.h:224:27: note: in expansion of macro 'OUT_WRITE'
   inline void suicide() { OUT_WRITE(SUICIDE_PIN, LOW); }
                           ^
sketch/src/HAL/HAL_AVR/../../Marlin.h:224:37: note: in expansion of macro 'SUICIDE_PIN'
   inline void suicide() { OUT_WRITE(SUICIDE_PIN, LOW); }
                                     ^
In file included from sketch/src/HAL/HAL_AVR/../../inc/../HAL/HAL_AVR/HAL.h:38:0,
                 from sketch/src/HAL/HAL_AVR/../../inc/MarlinConfig.h:28,
                 from sketch/src/HAL/HAL_AVR/MarlinSerial.cpp:38:
sketch/src/HAL/HAL_AVR/../../inc/../pins/pins_ULTIMAKER.h:112:33: error: pasting "/* PIN that has to be turned on right after start, to keep power flowing.*/" and "_RPORT" does not give a valid preprocessing token
 #define SUICIDE_PIN        54   // PIN that has to be turned on right after start, to keep power flowing.
                                 ^
sketch/src/HAL/HAL_AVR/../../inc/../HAL/HAL_AVR/fastio_AVR.h:79:48: note: in definition of macro '_WRITE'
 #define _WRITE(IO,V)          do{ if (&(DIO ## IO ## _RPORT) < (uint8_t*)0x100) _WRITE_NC(IO,V); else _WRITE_C(IO,V); }while(0)
                                                ^
sketch/src/HAL/HAL_AVR/../../inc/../HAL/HAL_AVR/fastio_AVR.h:102:51: note: in expansion of macro 'WRITE'
 #define OUT_WRITE(IO,V)       do{ SET_OUTPUT(IO); WRITE(IO,V); }while(0)
                                                   ^
sketch/src/HAL/HAL_AVR/../../Marlin.h:224:27: note: in expansion of macro 'OUT_WRITE'
   inline void suicide() { OUT_WRITE(SUICIDE_PIN, LOW); }
                           ^
sketch/src/HAL/HAL_AVR/../../Marlin.h:224:37: note: in expansion of macro 'SUICIDE_PIN'
   inline void suicide() { OUT_WRITE(SUICIDE_PIN, LOW); }
                                     ^
sketch/src/HAL/HAL_AVR/../../inc/../pins/pins_ULTIMAKER.h:112:33: error: pasting "/* PIN that has to be turned on right after start, to keep power flowing.*/" and "_WPORT" does not give a valid preprocessing token
 #define SUICIDE_PIN        54   // PIN that has to be turned on right after start, to keep power flowing.
                                 ^
sketch/src/HAL/HAL_AVR/../../inc/../HAL/HAL_AVR/fastio_AVR.h:69:21: note: in definition of macro '_WRITE_NC'
   if (V) SBI(DIO ## IO ## _WPORT, DIO ## IO ## _PIN); \
                     ^
sketch/src/HAL/HAL_AVR/../../inc/../HAL/HAL_AVR/fastio_AVR.h:91:31: note: in expansion of macro '_WRITE'
 #define WRITE(IO,V)           _WRITE(IO,V)
                               ^
sketch/src/HAL/HAL_AVR/../../inc/../HAL/HAL_AVR/fastio_AVR.h:102:51: note: in expansion of macro 'WRITE'
 #define OUT_WRITE(IO,V)       do{ SET_OUTPUT(IO); WRITE(IO,V); }while(0)
                                                   ^
sketch/src/HAL/HAL_AVR/../../Marlin.h:224:27: note: in expansion of macro 'OUT_WRITE'
   inline void suicide() { OUT_WRITE(SUICIDE_PIN, LOW); }
                           ^
sketch/src/HAL/HAL_AVR/../../Marlin.h:224:37: note: in expansion of macro 'SUICIDE_PIN'
   inline void suicide() { OUT_WRITE(SUICIDE_PIN, LOW); }
                                     ^
sketch/src/HAL/HAL_AVR/../../inc/../pins/pins_ULTIMAKER.h:112:33: error: pasting "/* PIN that has to be turned on right after start, to keep power flowing.*/" and "_PIN" does not give a valid preprocessing token
 #define SUICIDE_PIN        54   // PIN that has to be turned on right after start, to keep power flowing.
                                 ^
sketch/src/HAL/HAL_AVR/../../inc/../HAL/HAL_AVR/fastio_AVR.h:69:42: note: in definition of macro '_WRITE_NC'
   if (V) SBI(DIO ## IO ## _WPORT, DIO ## IO ## _PIN); \
                                          ^
sketch/src/HAL/HAL_AVR/../../inc/../HAL/HAL_AVR/fastio_AVR.h:91:31: note: in expansion of macro '_WRITE'
 #define WRITE(IO,V)           _WRITE(IO,V)
                               ^
sketch/src/HAL/HAL_AVR/../../inc/../HAL/HAL_AVR/fastio_AVR.h:102:51: note: in expansion of macro 'WRITE'
 #define OUT_WRITE(IO,V)       do{ SET_OUTPUT(IO); WRITE(IO,V); }while(0)
                                                   ^
sketch/src/HAL/HAL_AVR/../../Marlin.h:224:27: note: in expansion of macro 'OUT_WRITE'
   inline void suicide() { OUT_WRITE(SUICIDE_PIN, LOW); }
                           ^
sketch/src/HAL/HAL_AVR/../../Marlin.h:224:37: note: in expansion of macro 'SUICIDE_PIN'
   inline void suicide() { OUT_WRITE(SUICIDE_PIN, LOW); }
                                     ^
sketch/src/HAL/HAL_AVR/../../inc/../pins/pins_ULTIMAKER.h:112:33: error: pasting "/* PIN that has to be turned on right after start, to keep power flowing.*/" and "_WPORT" does not give a valid preprocessing token
 #define SUICIDE_PIN        54   // PIN that has to be turned on right after start, to keep power flowing.
                                 ^
sketch/src/HAL/HAL_AVR/../../inc/../HAL/HAL_AVR/fastio_AVR.h:70:21: note: in definition of macro '_WRITE_NC'
   else   CBI(DIO ## IO ## _WPORT, DIO ## IO ## _PIN); \
                     ^
sketch/src/HAL/HAL_AVR/../../inc/../HAL/HAL_AVR/fastio_AVR.h:91:31: note: in expansion of macro '_WRITE'
 #define WRITE(IO,V)           _WRITE(IO,V)
                               ^
sketch/src/HAL/HAL_AVR/../../inc/../HAL/HAL_AVR/fastio_AVR.h:102:51: note: in expansion of macro 'WRITE'
 #define OUT_WRITE(IO,V)       do{ SET_OUTPUT(IO); WRITE(IO,V); }while(0)
                                                   ^
sketch/src/HAL/HAL_AVR/../../Marlin.h:224:27: note: in expansion of macro 'OUT_WRITE'
   inline void suicide() { OUT_WRITE(SUICIDE_PIN, LOW); }
                           ^
sketch/src/HAL/HAL_AVR/../../Marlin.h:224:37: note: in expansion of macro 'SUICIDE_PIN'
   inline void suicide() { OUT_WRITE(SUICIDE_PIN, LOW); }
                                     ^
sketch/src/HAL/HAL_AVR/../../inc/../pins/pins_ULTIMAKER.h:112:33: error: pasting "/* PIN that has to be turned on right after start, to keep power flowing.*/" and "_PIN" does not give a valid preprocessing token
 #define SUICIDE_PIN        54   // PIN that has to be turned on right after start, to keep power flowing.
                                 ^
sketch/src/HAL/HAL_AVR/../../inc/../HAL/HAL_AVR/fastio_AVR.h:70:42: note: in definition of macro '_WRITE_NC'
   else   CBI(DIO ## IO ## _WPORT, DIO ## IO ## _PIN); \
                                          ^
sketch/src/HAL/HAL_AVR/../../inc/../HAL/HAL_AVR/fastio_AVR.h:91:31: note: in expansion of macro '_WRITE'
 #define WRITE(IO,V)           _WRITE(IO,V)
                               ^
sketch/src/HAL/HAL_AVR/../../inc/../HAL/HAL_AVR/fastio_AVR.h:102:51: note: in expansion of macro 'WRITE'
 #define OUT_WRITE(IO,V)       do{ SET_OUTPUT(IO); WRITE(IO,V); }while(0)
                                                   ^
sketch/src/HAL/HAL_AVR/../../Marlin.h:224:27: note: in expansion of macro 'OUT_WRITE'
   inline void suicide() { OUT_WRITE(SUICIDE_PIN, LOW); }
                           ^
sketch/src/HAL/HAL_AVR/../../Marlin.h:224:37: note: in expansion of macro 'SUICIDE_PIN'
   inline void suicide() { OUT_WRITE(SUICIDE_PIN, LOW); }
                                     ^
sketch/src/HAL/HAL_AVR/../../inc/../pins/pins_ULTIMAKER.h:112:33: error: pasting "/* PIN that has to be turned on right after start, to keep power flowing.*/" and "_WPORT" does not give a valid preprocessing token
 #define SUICIDE_PIN        54   // PIN that has to be turned on right after start, to keep power flowing.
                                 ^
sketch/src/HAL/HAL_AVR/../../inc/../HAL/HAL_AVR/fastio_AVR.h:74:30: note: in definition of macro '_WRITE_C'
   uint8_t port_bits = DIO ## IO ## _WPORT;                  /* Get a mask from the current port bits */ \
                              ^
sketch/src/HAL/HAL_AVR/../../inc/../HAL/HAL_AVR/fastio_AVR.h:91:31: note: in expansion of macro '_WRITE'
 #define WRITE(IO,V)           _WRITE(IO,V)
                               ^
sketch/src/HAL/HAL_AVR/../../inc/../HAL/HAL_AVR/fastio_AVR.h:102:51: note: in expansion of macro 'WRITE'
 #define OUT_WRITE(IO,V)       do{ SET_OUTPUT(IO); WRITE(IO,V); }while(0)
                                                   ^
sketch/src/HAL/HAL_AVR/../../Marlin.h:224:27: note: in expansion of macro 'OUT_WRITE'
   inline void suicide() { OUT_WRITE(SUICIDE_PIN, LOW); }
                           ^
sketch/src/HAL/HAL_AVR/../../Marlin.h:224:37: note: in expansion of macro 'SUICIDE_PIN'
   inline void suicide() { OUT_WRITE(SUICIDE_PIN, LOW); }
                                     ^
sketch/src/HAL/HAL_AVR/../../inc/../pins/pins_ULTIMAKER.h:112:33: error: pasting "/* PIN that has to be turned on right after start, to keep power flowing.*/" and "_RPORT" does not give a valid preprocessing token
 #define SUICIDE_PIN        54   // PIN that has to be turned on right after start, to keep power flowing.
                                 ^
sketch/src/HAL/HAL_AVR/../../inc/../HAL/HAL_AVR/fastio_AVR.h:76:10: note: in definition of macro '_WRITE_C'
   DIO ## IO ## _RPORT = port_bits & _BV(DIO ## IO ## _PIN); /* Atomically toggle the output port bits */ \
          ^
sketch/src/HAL/HAL_AVR/../../inc/../HAL/HAL_AVR/fastio_AVR.h:91:31: note: in expansion of macro '_WRITE'
 #define WRITE(IO,V)           _WRITE(IO,V)
                               ^
sketch/src/HAL/HAL_AVR/../../inc/../HAL/HAL_AVR/fastio_AVR.h:102:51: note: in expansion of macro 'WRITE'
 #define OUT_WRITE(IO,V)       do{ SET_OUTPUT(IO); WRITE(IO,V); }while(0)
                                                   ^
sketch/src/HAL/HAL_AVR/../../Marlin.h:224:27: note: in expansion of macro 'OUT_WRITE'
   inline void suicide() { OUT_WRITE(SUICIDE_PIN, LOW); }
                           ^
sketch/src/HAL/HAL_AVR/../../Marlin.h:224:37: note: in expansion of macro 'SUICIDE_PIN'
   inline void suicide() { OUT_WRITE(SUICIDE_PIN, LOW); }
                                     ^
sketch/src/HAL/HAL_AVR/../../inc/../pins/pins_ULTIMAKER.h:112:33: error: pasting "/* PIN that has to be turned on right after start, to keep power flowing.*/" and "_PIN" does not give a valid preprocessing token
 #define SUICIDE_PIN        54   // PIN that has to be turned on right after start, to keep power flowing.
                                 ^
sketch/src/HAL/HAL_AVR/../../inc/../HAL/HAL_AVR/fastio_AVR.h:76:48: note: in definition of macro '_WRITE_C'
   DIO ## IO ## _RPORT = port_bits & _BV(DIO ## IO ## _PIN); /* Atomically toggle the output port bits */ \
                                                ^
sketch/src/HAL/HAL_AVR/../../inc/../HAL/HAL_AVR/fastio_AVR.h:91:31: note: in expansion of macro '_WRITE'
 #define WRITE(IO,V)           _WRITE(IO,V)
                               ^
sketch/src/HAL/HAL_AVR/../../inc/../HAL/HAL_AVR/fastio_AVR.h:102:51: note: in expansion of macro 'WRITE'
 #define OUT_WRITE(IO,V)       do{ SET_OUTPUT(IO); WRITE(IO,V); }while(0)
                                                   ^
sketch/src/HAL/HAL_AVR/../../Marlin.h:224:27: note: in expansion of macro 'OUT_WRITE'
   inline void suicide() { OUT_WRITE(SUICIDE_PIN, LOW); }
                           ^
sketch/src/HAL/HAL_AVR/../../Marlin.h:224:37: note: in expansion of macro 'SUICIDE_PIN'
   inline void suicide() { OUT_WRITE(SUICIDE_PIN, LOW); }
                                     ^
exit status 1
Fehler beim Kompilieren für das Board Arduino/Genuino Mega or Mega 2560.

Steps to Reproduce

  1. Download Marlin Bugfix 2.0 Branch
  2. Download and install Arduino 1.9 Beta
  3. In configuration.h set BOARD_ULTIMAKER in line 136
  4. Try to compile

Expected behavior: It compiles.

Actual behavior: It gives the compile error, see above.

Additional Information

I don't know if it matters, but i use Ubuntu 18.04.

@p3p

This comment has been minimized.

Member

p3p commented Aug 18, 2018

This is a bug in the Arduino (possibly avr_gcc) preprocessor, the macro expansion is including comments that are on the same line, you could create an issue on their repository. To work around the problem you would need to remove the comments from the pin definition lines in pins_ULTIMAKER.h.

@KlausHans

This comment has been minimized.

KlausHans commented Aug 18, 2018

You are right, i deleted some comments and it worked. Strange thought,
#define TEMP_0_PIN 8 // Analog Input
(and other analog input comments) made no problem.

Thank you!

@per1234

This comment has been minimized.

Contributor

per1234 commented Aug 24, 2018

I believe this is the relevant bug report on the Arduino side:
arduino/arduino-preprocessor#6

@per1234

This comment has been minimized.

Contributor

per1234 commented Aug 26, 2018

It looks like I was wrong about this being arduino/arduino-preprocessor#6. See arduino/Arduino#7930 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment