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

Hi, I want to reduce current my module

Hi, I want to reduce current my module.

I used SDK15.0.0ver, nRF52832

I have 2 questions.

1. I used app_uart_close(); 

But My module was reset again.

2. I want to advertising again.

Can I use sleep_mode_enter?

or I should use idle_state_handle?

or Different mode?

 

Please recommend

int main(void)
{
    bool erase_bonds;
  nrfx_gpiote_uninit();
 lfclk_config();
  nrf_gpio_cfg_output(13);
  nrf_gpio_cfg_output(15);
   nrf_gpio_pin_set(13);
  nrf_gpio_pin_set(15);
   nrf_delay_ms(500);  //
  nrf_gpio_pin_clear(13);
    nrf_gpio_pin_clear(15);
    // Initialize.
    uart_init();
   // log_init();
    timers_init();
    //buttons_leds_init(&erase_bonds);
    power_management_init();
    ble_stack_init();
    gap_params_init();
    //gatt_init();
    services_init();
  conn_params_init();
 ////////////////////////////////////
  nrf_gpio_cfg_output(13);
  nrf_gpio_cfg_output(15);
   nrf_gpio_pin_set(13);
  nrf_gpio_pin_set(15);
 uint32_t err_code;
  ble_gap_addr_t p_addr;
  p_addr.addr_id_peer = 1;
  //sd_ble_gap_addr_get(&p_addr);
  p_addr.addr_type = BLE_GAP_ADDR_TYPE_PUBLIC;
  p_addr.addr[0]=0x06;
  p_addr.addr[1]=0x05;
  p_addr.addr[2]=0x04;
  p_addr.addr[3]=0x03;
  p_addr.addr[4]=0x02;
  p_addr.addr[5]=0x01;
  
  err_code=sd_ble_gap_addr_set( &p_addr);
  nrf_delay_ms(500);  //Wait Doorlock Initializing
  nrf_delay_ms(500);  //
  nrf_delay_ms(500);  //
  nrf_gpio_pin_clear(13);
    nrf_gpio_pin_clear(15);
 //////////////////////////////////////
 
    advertising_init();
  
  
    // Start execution.
   // printf("\r\nUART started.\r\n");
   // NRF_LOG_INFO("Debug logging for UART over RTT started.");
  err_code = sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_ADV, m_advertising.adv_handle, -40);
    APP_ERROR_CHECK(err_code);
    advertising_start();
    app_uart_close();
   //nrf_pwr_mgmt_shutdown(NRF_PWR_MGMT_SHUTDOWN_GOTO_SYSOFF);
    // Enter main loop.
    for (;;)
    {
        idle_state_handle();
   //sleep_mode_enter();
    }
}
Parents Reply Children
No Data
Related