Hi,
I got the example http://github.com/NordicPlayground/nrf52-ble-multi-link-multi-role and the demo is OK.
We are doing a game project using nRF52840 base on nRF52 SDK v15.2.
We have a lot of caculation with FPU,so I add freeRTOS to my code(base on ble_aggregator example) refer to ble_app_hrs_freertos example in the nRF52 SDK.
One task for BLE and one task for data caculation.
static void ble_task(void *arg)
{
advertising_start();
scan_start();
}
static void AppTask_demo(void * pvParameter)
{
if (pdPASS != xTimerStart(m_test_timer, OSTIMER_WAIT_FOR_QUEUE))
{
APP_ERROR_HANDLER(NRF_ERROR_NO_MEM);
}
while(1)
{
process_ble_commands();
}
}
int main(void)
{
....
....
....
nrf_sdh_freertos_init(ble_task, NULL); // Create a FreeRTOS task for the BLE stack.
if (pdPASS != xTaskCreate(AppTask_demo, "123", 128, NULL, 1, &m_app_thread))
{
NRF_LOG_ERROR("Failed to create task.\n");
}
else
{
uart_printf("SPT FreeRTOS created.\n");
}
vTaskStartScheduler();
uart_printf("Multilink example Target_periph_name \"%s\"\r\n", m_target_periph_name);
for (;;)
{
APP_ERROR_HANDLER(NRF_ERROR_FORBIDDEN);
}
}
Now it runs good. But I'm afraid is this way good because Ihave not done data caculation now. Besides, is there anywhere I need to pay more attention?
Another question, how to do low power to save power?
BR
Bruse