/**@brief Function for application main entry.
*/
int main(void)
{
bool erase_bonds;
// Initialize.
// log_init();
timers_init();
// buttons_leds_init(&erase_bonds);
power_management_init();
ble_stack_init();
gap_params_init();
gatt_init();
advertising_init();
services_init();
conn_params_init();
peer_manager_init();
// Start execution.
// NRF_LOG_INFO("Template example started.");
//application_timers_start();
// advertising_start(erase_bonds);
// Enter main loop.
for (;;)
{
idle_state_handle();
}
}
因为官方这个示例代码是跑有协议栈的,而你把协议栈相关的都去掉了,所以电流下不去,如果你不想用协议栈,把这个宏SOFTDEVICE_PRESENT改为xSOFTDEVICE_PRESENT