The pin assignment works by loading pins_MKS_GEN_L.h
which defines almost nothing, and then loading pins_RAMPS.h
. The latter checks if pins are defined, and if so it does not redefine them, but instead uses the ones already defined. So if you define pins within pins_MKS_GEN_L.h
, it will take precedence over the pins_RAMPS.h
values.
Specifically, pins_MKS_GEN_L.h
contains:

And the relevant portion of pins_RAMPS.h
is:
(Note that on line 209, RAMPS_D9_PIN is only assigned if it hasn’t already been assigned, meaning pins_MKS_GEN_L.h
can override it.)
According to my reading, what “should” be happening is since pins_MKS_GEN_L.h
defines MOSFET_D_PIN
, you should not be getting RAMPS EFB, EEF, EEB, EFF, or SF, so the clause in line 227 should take effect, and with more than one hotend, it should define HEATER_1_PIN
to MOSFET_D_PIN
, which is pin 7 like you are wanting.
I can’t say why it wouldn’t work, and I haven’t configured MKS Gen L 1.0 for dual extruders, but if you wanted to try swapping D7 and D9 you could do that within pins_MKS_GEN_L.h
by setting
#define MOSFET_D_PIN 9
#define RAMPS_D9_PIN 7
Then within pins_RAMPS.h
, since RAMPS_D9_PIN is already defined, it won’t redefine it and it will be 7 instead of 9 (and confusing to your future self when you review it a year from now).
You can see if that fixes it, and if not, then it could be something else related to the mixing extruder configuration.