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