MP3DP v2 - Filament runout sensor

Thanks to Ryan I built the MP3DP v2 which works very well.
Now I would like to add the filament runour sensor. I have a simple microswitch based device to be connected to “s” and “-” on the SKR 1.2 Pro board, but I need help with the Firmware and where to connect on the board. Has anyone already had the same need as me and can help me?
Thank you

Did you download the firmware from Github? I think you could fork the repo and add in a few lines that will activate the runout sensor, I’d have to go back in and check on which ones need to be on to handle filament runout, there are usually a few because I think you need activate Advanced Parking.

@jeffeb3 is probably your guy to be honest

The source code is with the binary in MarlinBuilder releases. Start by recompiling it without changes in platformio, just to make sure your tools are set up correctly. Then change the lines in the configuration.h file to make the filament sensor work.

I haven’t used a filament runout sensor. IDK how to configure it. I am guessing you could just pick an open endstop pin, or a spare one on the board somewhere.

Thank you, I will try and report success / failure …

I would like to add a BTT filament runout sensor to my MP3DP v2.
I tried to modify the FW according to the suggestions received but I’m a terrible programmer so I messed everything up and went back to the original version of Marlin (V1 3DP 513P).
Has anyone already solved the problem and can share the updated firmware?
My setup is with SKR pro and MK8 extruder