/* Auxiliary function for error processing. 
Function called when in current substate the event apears and it cannot be processed. It should be called also on ERROR event. If given  */
static void nrf_drv_twis_process_error(uint8_t instNr, nrf_drv_twis_evt_type_t ev, uint32_t error)
/* Auxiliary function for error processing. 
Function called when in current substate the event apears and it cannot be processed. It should be called also on ERROR event. If given  */
static void nrf_drv_twis_process_error(uint8_t instNr, nrf_drv_twis_evt_type_t ev, uint32_t error)
{
    if(0 == error)
        error = NRF_DRV_TWIS_ERROR_UNEXPECTED_EVENT;
    nrf_drv_twis_evt_t evdata;
    evdata.type = ev;
    evdata.data.error = error;
    m_var_inst[instNr].error |= error;
    nrf_drv_call_event_handler(instNr, &evdata);
}