I need to pass the signal from an end stop (limit switch) to an MCU and I'd like to make it flexible (to make it possible to work with both types of limit switch: normally-open and normally-closed) as cheap and easy as possible.
I could use two inverters one after another, but it looks too bulky. I hope there is a better solution.
I'd like to avoid using firmware configuration. A jumper looks very convenient for production and configuration.
I made the following simulation, which is working as expected:
Does this solution look OK?