This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

how to run main loop parallel with nrf_ble_scan event

Hi Nordic Team,

I have one doubt which I can not able to understand.

Actually in my code I'm scanning some ble devices also in main infinite loop I'm reading some sensor data, my problem is when nrf device scan the other devices it goes to main loop after so long, I also run app_timer_start before main loop as I also counting the ticks, so in my code when there is no device to scan it goes to loop immediately and get the sensor data, but when I switch on the other devices and my devices scans these devices then it goes to main loop randomly like some time systick count is 30 sometimes it is beyond 200 so why it is happening like that. Is there any way so that it scan the devices as well as it also goes to the main loop.

Thanks in advance.

Any help will be highly appreciated.

Parents Reply
  • I've debug it several times and it's not delay it's timer interrupt through which I'm getting systick. 

    Here I'm uploading my main.c file for your refernece please let me know where I'm doing wrong. as I told I'm reading rtc data from main loop, when there is no other ble device ON it goes to loop and gives the RTC data but when any nrf52840 device is on then serving loop is happening randomly or even after so long it only goes to scan the device.1738.main.c

Children
Related