Hi! I'm working with nRF52 development kit and SEGGER Embedded Studio. I was trying to modify the example given as ble_app_hids_mouse and take all the functions present in main.c to define them in another file .c along with its .h file. The thing is that the header file is recognised within the project but the functions called by the main and included in the .c file seem to be not defined.I found a Makefile inside the ble_app_hids_mouse/pca10040/s132/armgcc so I modified it (just in case SES uses it) to add the new the path to the new code file, and even though the file compiles correctly, the main is not able to find the functions.
I want to leave my main.c code like this:
#include "def.h"
int main(void)
{
bool erase_bonds;
// Initialize.
log_init();
timers_init();
buttons_leds_init(&erase_bonds);
power_management_init();
ble_stack_init();
scheduler_init();
gap_params_init();
gatt_init();
advertising_init();
services_init();
sensor_simulator_init();
conn_params_init();
peer_manager_init();
// Start execution.
NRF_LOG_INFO("HID Mouse example started.");
timers_start();
advertising_start(erase_bonds);
// Enter main loop.
for (;;) {
idle_state_handle();
}
}
So I created a new header file 'def.h' where are the '#include', '#define' and all the functions declarations, and other code file 'def.c' where the definitions of the functions called by the main.c. The thing is that def.h is recognised perfectly by the main but not the functions from .c
Any idea on how to make this works? Thanks in advanced!
Dolrairom