Exemple #1
0
/**@brief Function for application main entry.
 */
int main(void)
{
    uint32_t err_code;

    // Initialize
    timers_init();
    ble_stack_init();
    bsp_module_init();
    scheduler_init();
    gap_params_init();
    advertising_init();
    services_init();
    conn_params_init();
    sec_params_init();

    // Start execution
    timers_start();
    err_code = ble_advertising_start(BLE_ADV_MODE_FAST);
    APP_ERROR_CHECK(err_code);
    // Enter main loop
    for (;;)
    {
        app_sched_execute();
        power_manage();
    }
}
Exemple #2
0
/**@brief Function for application main entry.
 */
int main(void)
{
    // Initialize
    timers_init();
    gpiote_init();
    ble_stack_init();
    bsp_module_init();
    scheduler_init();
    gap_params_init();
    advertising_init();
    services_init();
    conn_params_init();
    sec_params_init();

    // Start execution
    timers_start();
    advertising_start();

    // Enter main loop
    for (;;)
    {
        app_sched_execute();
        power_manage();
    }
}
Exemple #3
0
/**@brief Function for application main entry.
 */
int main(void)
{
    uint32_t err_code;
    
    // Initialize
    timers_init();
    ble_stack_init();
    bsp_module_init();
    scheduler_init();
    gap_params_init();
    advertising_init();
    services_init();
    conn_params_init();
    sec_params_init();
    
    adc_init();

    // Start execution
    timers_start();
    err_code = ble_advertising_start(BLE_ADV_MODE_FAST);
    APP_ERROR_CHECK(err_code);
    // Enter main loop
    
    for (;;)
    {
        if(start_adc_sampling == true)
        {
            nrf_drv_saadc_sample_convert(0, &adc_value);
            ble_android_characteristic_update(&m_android, &adc_value);
            start_adc_sampling = false;
        }
        app_sched_execute();
//        power_manage();
    }
}