If I just comment-out battery_measurement_init() in main():
/**@brief Function for application main entry.
*/
int main(void)
{
bool erase_bonds;
core_init();
buttons_leds_init(&erase_bonds);
ble_init();
flashlog_init();
//battery_measurement_init(); <<<< COMMENTED-OUT!
APP_ERROR_CHECK(nrf_cli_ble_uart_service_init());
NRF_LOG_INFO("BLE NUS CLI example started.");
task_manager_start(idle_task, (void *)erase_bonds);
}
Advertising does not start, I see nothing on the UART CLI, and the RTT log just shows:
rtt_cli:~$ [11D[J[00:00:00.000,000] <info> stack_guard: Stack Guard (128 bytes): 0x2000E000-0x2000E07F (total stack size: 8192 bytes, usable stack area: 8064 bytes) [11D[J[00:00:00.000,000] <info> pwr_mgmt: Init [11D[J[00:00:00.000,000] <info> task_manager: Task 0 created (name: 'rtt_cli:~$ ', stack: 0x20003F00-0x200042FF).
With battery_measurement_init() enabled, it all works fine; and the RTT log shows:
rtt_cli:~$ [11D[J[00:00:00.000,000] <info> stack_guard: Stack Guard (128 bytes): 0x2000E000-0x2000E07F (total stack size: 8192 bytes, usable stack area: 8064 bytes) rtt_cli:~$ [11D[J[00:00:00.000,000] <info> pwr_mgmt: Init rtt_cli:~$ [11D[J[00:00:00.000,000] <info> task_manager: Task 0 created (name: 'rtt_cli:~$ ', stack: 0x20003F00-0x200042FF). rtt_cli:~$ [11D[J[00:00:00.000,000] <info> task_manager: Task 1 created (name: 'uart_cli:~$ ', stack: 0x20004400-0x200047FF). rtt_cli:~$ [11D[J[00:00:00.000,000] <info> app: BLE NUS CLI example started. rtt_cli:~$ [11D[J[00:00:00.000,000] <info> task_manager: Task 3 created (name: 'Idle Task', stack: 0x20004E00-0x200051FF). rtt_cli:~$ [11D[J[00:00:00.007,415] <info> app: Fast advertising. rtt_cli:~$
So why does removing battery_measurement_init() break everything else?
I don't want the battery measurement (it's only a simulation, anyhow) - so what do I need to keep from battery_measurement_init() to make the rest of it work?