Hi nice people, I am working on developing using visual studio and Make environment. I am trying to function UART tx/rx interrupt works but no luck. The TX and RX works perfect in blocking mode but it is not on interrupt mode. I am going to provide snippets of blocking and non blocking codes.
************************** Blocking mode *****************************************
************************** Non Blocking mode *****************************************
static void uart_callback (nrfx_uart_event_t const * p_event, void *p_context)
{
(void*) p_context;
switch (p_event->type)
{
case NRFX_UART_EVT_TX_DONE:
break;
case NRFX_UART_EVT_RX_DONE:
nrfx_uart_rx(&uartInstance, &txd, 1);
break;
case NRFX_UART_EVT_ERROR:
break;
default:
break;
}
}
void UART_run_non_blocking_test(void)
{
nrfx_uart_config_t uart_conf = {
.baudrate = UART_BAUDRATE_BAUDRATE_Baud9600,
.hwfc = NRF_UARTE_HWFC_DISABLED,
.parity = NRF_UARTE_PARITY_EXCLUDED,
.pseltxd = UART_TX_PIN,
.pselrxd = UART_RX_PIN,
.pselcts = NRF_UART_PSEL_DISCONNECTED,
.pselrts = NRF_UART_PSEL_DISCONNECTED,
.p_context = NULL,
.parity = NRF_UARTE_PARITY_EXCLUDED,
.interrupt_priority = NRFX_UART_DEFAULT_CONFIG_IRQ_PRIORITY,
};
nrfx_uart_init(&uartInstance, &uart_conf, uart_callback);
nrfx_uart_rx(&uartInstance, &txd, 1);
volatile uint32_t d;
while(1)
{
}
}