How to use custom board revisions in application code?

Hi,

I use Nordic connect SDK and have to create a new revision for a custom board, because there are some hardware changes. I managed to create an overlay for the new revision where I could add some pins, which were added in the new revision. I also can use these pins in my application if I compile it for the new revision. My question is now, how do I exclude these pins in the old revision with minimal impact on the source code. I tried setting CONFIG variables in a defconfig file, but that didn't work. What is the best practice and how should the revision files be used so that the application can work with all revisions?

Best regards,

Christian 

Related