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

How to determine the context of a callback

Hi,


I am encountering some difficulties to undertand the context in which my sdk modules call back are called.
I am using the uart part of ble uart nus example, and thus the app_uart module. I was wondering if uart_event_handle was called from one interrupt, or is stacked in the app_scheduler event queue at some point ? In a more general way, how do I know if my app is using interruptions or the app events scheduler ?

All the best,

#include <nrf_uart.h>
#include <nrf_uarte.h>
#include <app_uart.h>

void uart_event_handle(app_uart_evt_t * p_event)
{
      uint32_t       err_code;
      
    NRF_LOG_INFO("uart_event_handle \r\n");

    switch (p_event->evt_type)
    {
        case APP_UART_DATA_READY:
            // do something with received data
            break;

        case APP_UART_COMMUNICATION_ERROR:
            APP_ERROR_HANDLER(p_event->data.error_communication);
            break;

        case APP_UART_FIFO_ERROR:
            APP_ERROR_HANDLER(p_event->data.error_code);
            break;

        default:
            break;
    }
}
Related