Results 1 to 3 of 3
Thread: Adding a Second Gantry to Marlin
-
01-16-2016, 12:54 AM #1
- Join Date
- Jan 2016
- Posts
- 2
Adding a Second Gantry to Marlin
I am working on a project that requires an Azteeg x3 pro to run two separate gantries on a big 3D printer. Currently I am working on the marlin software and editing it to work with two gantries, this is posing a problem. Marlin has a nice dual_x_carriage option and I am basically duplicating all of the code for that but for the y and z axis as well. I have run in to a problem when trying to compile the stepper.cpp file after making some edits that has me confused, I am a programming novice.
The error I am getting is "a function-definition is not allowed here before '{' token" while highlighting line 849, all this line has is a {
If I remove the { I get a slew of more errors.
Any advice on figuring out the error would be nice or just advice on a way to add a second gantry to marlin would also be nice
I am also working to get two 3D printer controllers talking to one another, so any advice on that would also be nice.
stepper.cpp
-
01-16-2016, 09:44 AM #2
I think you have turned on (or off) #define's such that the function declaration structure is broken.
Functions need to look like:
Code:type name(parameters) { ... }
This is kind of a lame cop-out. But if you start with the unaltered stepper.cpp file and start deleting thing you know you don't need, it will simplify the code. For example, if you know you are not going to use
#ifdef CONFIG_STEPPERS_TOSHIBA
Then delete the #ifdef and everything up to and including the #endif. Go through the diffrerent #ifdef's and anything you know you don't need, manually edit it out. Probably the code will become much simpler and you will be able to re-use it easier.
-
01-16-2016, 01:53 PM #3
- Join Date
- Jan 2016
- Posts
- 2
Right now the function looks like:
Code:void st_init(){ ... }
There were only a few #ifdef that I could delete, mostly the dual_z_stepper.
After some more testing of the error I found that it wont happen if I comment out the
//void st_init()
but it would just occur at a later void function definition.
For instance it is now giving me the same error here:
Code:void finishAndDisableSteppers() { st_synchronize(); disable_x(); disable_y(); disable_z(); disable_e0(); disable_e1(); disable_e2(); }
stepper.cpp: In function 'void __vector_17()':
stepper.cpp:831: error: a function-definition is not allowed here before '{' token
{
^
stepper.cpp:1372: error: expected '}' at end of input
}
^
a function-definition is not allowed here before '{' token
Edit: After about an hour of checking everything I found the error.Last edited by WinstonPHz; 01-16-2016 at 08:33 PM.
My 3D Norn Emissary print
09-13-2024, 02:28 AM in 3D Printing Gallery