In Marlin, there should be a pin.h or wiring.h file or tab. You can make your changes there.