How can one create debug/release configuration in Keil uVision 5.14? I have single target in my project and I want to easily switch compiler optimization, pin mappings on my MCU etc by switching between debug and release configuration.
The sky is the limit.
You can do object-oriented programming in C.
You most definitely can do it in C++.
You can encapsulate and work with methods as much as you like.
In the end, your skills and the amount of time and processing resources will be the limiting factors (assuming you have a full license, so the compiler isn't codesize-limited).
But the biggest question here is why you do not start your own thread and instead jump into a thread that debates how best to configure a project for supporting different builds for debug and release.