Why use const variables instead of preprocessor directives when programming embedded with C++
Using a const value lets the compiler do some type checking, but a value you assign with a #define is just used for text substitution so all sorts of unexpected problems can occur.
Regardless of how you define constants, a good compiler should never store them as static values in RAM. A good compiler will often optimize them to immediate values embedded in the instructions themselves or literal values in the literal pool. For an embedded system running out of flash memory the literal pool would also remain in flash and would not take space in RAM.
Similarly for macros vs. inline functions. A macro does text substitution in the preprocessor and can easily lead to unintended consequences if you are not careful. If you don't look at the preprocessor output directly it can be hard to find and debug problems with macros. An inline function, on the other hand, provides the same functional capability as a macro but is easier for the compiler to check and easier to debug if necessary.