Marlin customization; additional output after G0/G1 move
Which section handles G-code processing?


In Marlin Firmware, G-code is processed by procedure void process_parsed_command() in file Marlin_main.cpp


  I need to generate an additional digital output


A G-code that is able to set a port value is M42.

You could write a procedure that schedules  certain port after a G0 or G1 move, recompile and upload the firmware.