My project starts to grow and I would like to separate different parts of code into modules. Each module will present one .c file together with its .h file. In some .c files, I have to have the instance of the timer_id or struct which is defined in .h file such as
#define BLE_MASS_DEF(_name) \
static ble_mass_t _name; \
NRF_SDH_BLE_OBSERVER(_name ## _obs, \
BLE_MASS_BLE_OBSERVER_PRIO, \
ble_mass_on_ble_evt, &_name)
The problem is that these are defined via Macros such as:
APP_TIMER_DEF(m_mass_battery_timer_id);
BLE_MASS_DEF(m_mass);
which means that these instances are only visible in main. c. How can I get these instances from Macros and transfer them to other .c files? I have in mind to define .h file which will have all these variables as external and then I will include them in other .c files. But the problem is that I can not get instances from Macros. I will appreciate for help.