Given two projects, one using UART, the other using SPI.
80% of the C programming for these projects is identical, the remaining code is dependent on the communication means.
What is best practice for maintaining the common code in one place and sharing it between the projects?
When you are able to structure your common code into modules, you can set them up as components and use them in your two projects. Or you put them into one directory and use hard links (with junction.exe) to link into your projects.