Skip to content
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

[BUG] With MAGNETIC_SWITCHING_TOOLHEAD, compilation error #19270

Closed
yopla31 opened this issue Sep 5, 2020 · 5 comments
Closed

[BUG] With MAGNETIC_SWITCHING_TOOLHEAD, compilation error #19270

yopla31 opened this issue Sep 5, 2020 · 5 comments

Comments

@yopla31
Copy link

yopla31 commented Sep 5, 2020

Marlin.zip

Printer : Ender 5 Pro modified !
Board : MKS SGEN-L
I use 2 hotends with magnetic attachment (#define MAGNETIC_SWITCHING_TOOLHEAD)
See at https://www.youtube.com/watch?v=mZzq3hM-eWg
If I set #define MAGNETIC_SWITCHING_TOOLHEAD in Configuration.h , I get a compilation error :

In file included from Marlin\src\HAL\LPC1768../../core/../inc/MarlinConfig.h:41,
from Marlin\src\HAL\LPC1768../../core/serial.h:24,
from Marlin\src\HAL\LPC1768\DebugMonitor.cpp:25:
Marlin\src\HAL\LPC1768../../core/../inc/SanityCheck.h:1085:6: error: #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_Z_HOP."
1085 | #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_Z_HOP."
| ^~~~~
In file included from Marlin\src\HAL\LPC1768../../inc/MarlinConfig.h:41,
from Marlin\src\HAL\LPC1768\HAL.cpp:24:
Marlin\src\HAL\LPC1768../../inc/SanityCheck.h:1085:6: error: #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_Z_HOP."
1085 | #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_Z_HOP."
| ^~~~~
In file included from Marlin\src\HAL\LPC1768../../inc/MarlinConfig.h:41,
from Marlin\src\HAL\LPC1768\HAL_SPI.cpp:51:
Marlin\src\HAL\LPC1768../../inc/SanityCheck.h:1085:6: error: #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_Z_HOP."
1085 | #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_Z_HOP."
| ^~~~~
In file included from Marlin\src\HAL\LPC1768../../inc/MarlinConfig.h:41,
from Marlin\src\HAL\LPC1768\eeprom_flash.cpp:39:
MCompiling .pio\build\LPC1768\src\src\HAL\LPC1768\include\digipot_mcp4451_I2C_routines.c.o
arlin\src\HAL\LPC1768../../inc/SanityCheck.h:1085:6: error: #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_Z_HOP."
1085 | #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_Z_HOP."
| ^~~~~
In file included from Marlin\src\HAL\LPC1768../../inc/MarlinConfig.h:41,
from Marlin\src\HAL\LPC1768\eeprom_sdcard.cpp:25:
Marlin\src\HAL\LPC1768../../inc/SanityCheck.h:1085:6: error: #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_Z_HOP."
1085 | #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_Z_HOP."
| ^~~~~
In file included from Marlin\src\HAL\LPC1768../../inc/MarlinConfig.h:41,
from Marlin\src\HAL\LPC1768\eeprom_wired.cpp:24:
Marlin\src\HAL\LPC1768../../inc/SanityCheck.h:1085:6: error: #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_Z_HOP."
1085 | #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_Z_HOP."
| ^~~~~
Compiling .pio\build\LPC1768\src\src\HAL\LPC1768\include\i2c_util.c.o
*** [.pio\build\LPC1768\src\src\HAL\LPC1768\DebugMonitor.cpp.o] Error 1
*** [.pio\build\LPC1768\src\src\HAL\LPC1768\HAL.cpp.o] Error 1
*** [.pio\build\LPC1768\src\src\HAL\LPC1768\HAL_SPI.cpp.o] Error 1
*** [.pio\build\LPC1768\src\src\HAL\LPC1768\eeprom_flash.cpp.o] Error 1
*** [.pio\build\LPC1768\src\src\HAL\LPC1768\eeprom_wired.cpp.o] Error 1
*** [.pio\build\LPC1768\src\src\HAL\LPC1768\eeprom_sdcard.cpp.o] Error 1

My SOLUTION :
I added the line :
#define SWITCHING_TOOLHEAD_Z_HOP 10
just after :
#elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD)
#define SWITCHING_TOOLHEAD_Y_RELEASE -10 // (mm) Security distance Y axis
#define SWITCHING_TOOLHEAD_X_SECURITY { 58, 183 } // (mm) Security distance X axis (T0,T1)
#define SWITCHING_TOOLHEAD_Z_HOP 10 // (mm) Z raise for switching

and the compilation is OK, and the changetool is ok.

@boelle boelle added the Fix Included A fix is included in the description label Sep 5, 2020
@boelle
Copy link
Contributor

boelle commented Sep 5, 2020

SWITCHING_TOOLHEAD_Z_HOP is allready there in configuration.h at line 291 so closing this one as not a bug

@boelle boelle closed this as completed Sep 5, 2020
@boelle boelle removed the Fix Included A fix is included in the description label Sep 5, 2020
@boelle
Copy link
Contributor

boelle commented Sep 5, 2020

image

@yopla31
Copy link
Author

yopla31 commented Sep 5, 2020 via email

@yopla31
Copy link
Author

yopla31 commented Sep 7, 2020

Any comment ??
I define MAGNETIC_SWITCHING_TOOLHEAD and no ELECTROMAGNETIC_SWITCHING_TOOLHEAD.
So the error message is explicite :
#error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_Z_HOP."
but for MAGNETIC_SWITCHING_TOOLHEAD, SWITCHING_TOOLHEAD_Z_HOP is never define !

@github-actions
Copy link

github-actions bot commented Nov 6, 2020

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Nov 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants