I suggest to collect all global variables in a single file, for example global.cpp,
with the corresponding extern definitions in global.h.
definition of a variable in global.cpp:
uint8_t ui8_g_global_variable = 0;
extern declaration in global.h:
extern uint8_t ui8_g_global_variable;
To goal is to keep the number of global variables at a minimum.
All the remaining variables should be static variables (if possible static function variables).
I suggest to collect all global variables in a single file, for example global.cpp, with the corresponding extern definitions in global.h.
definition of a variable in global.cpp:
uint8_t ui8_g_global_variable = 0;
extern declaration in global.h:
extern uint8_t ui8_g_global_variable;
To goal is to keep the number of global variables at a minimum. All the remaining variables should be static variables (if possible static function variables).