/*
 * Copyright (c) 2018 Nordic Semiconductor ASA
 *
 * SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic
 */

#include <zephyr.h>
#include <stdio.h>
#include <drivers/uart.h>
#include <string.h>

/**@brief Recoverable BSD library error. */
void bsd_recoverable_error_handler(uint32_t err)
{
	printk("bsdlib recoverable error: %u\n", err);
}

void disable_uart0(){
	NRF_UARTE0->TASKS_STOPTX = 1;
	while(NRF_UARTE0->EVENTS_TXSTOPPED == 0);
	NRF_UARTE0->EVENTS_TXSTOPPED = 0;
	
	NRF_UARTE0->TASKS_STOPRX = 1;
	while(NRF_UARTE0->EVENTS_RXTO == 0);
	NRF_UARTE0->EVENTS_RXTO = 0;
	
	NRF_UARTE0->ENABLE = 0;
}

void main(void)
{
    disable_uart0();
    k_cpu_idle();
    // k_sleep(K_SECONDS(60));

}
