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

Data after callback ?

Dear Members,

How can i keep the data no being cut ?

before using call back function ,

after using call back function :

function :

call back from main :

 case NRF_LIBUARTE_ASYNC_EVT_RX_DATA:
					   //nrf_libuarte_async_tx(&libuarte, text2, text_size2);
				    //nrf_libuarte_async_tx(&libuarte, p_evt->data.rxtx.p_data, p_evt->data.rxtx.length);
				    GPS_CallBack();

Call back and process function :

void	GPS_CallBack(void)
{
	
	GPS.LastTime=nrf_systick_val_get();
	
	

	if(GPS.rxIndex < sizeof(GPS.rxBuffer)-2)
	{
		GPS.rxBuffer[GPS.rxIndex] = GPS.rxTmp;
		GPS.rxIndex++;
		memcpy((void *)line_buffer_GPS, GPS.rxBuffer, GPS.rxIndex); 
	}
   nrf_libuarte_async_rx_free(&libuarte1, (uint8_t *)&GPS.rxTmp, 1);
	

}
//##################################################################################################################
void	GPS_Process(void)
{

	nrf_libuarte_async_tx(&libuarte, (uint8_t*)line_buffer_GPS, sizeof(line_buffer_GPS));
}	

What do I miss here ? a size of data ?

Thanks

I call GPS_process in main(void) :

while (true)
    {
			 
			 GPS_Process();
			 nrf_delay_ms(5000);
	}		 

Parents Reply Children
  • RixtronixLAB said:
    Is my call back function taking too much time ? thanks

    That is possible. You could try to move the processing outside of the lbUARTE event handler, by setting a flag in the handler and do the processing in main-loop. The processing inside the handler which runs in interrupt context will prevent other events with same/lower priority from being handled. This may cause issues in some cases.

    It may also be easier to help you out if you post the full code. It is not easy to see exactly what happens in the application from the small code snippets.

Related