HI,
i try to Run LINFLEXD_UART_DRV_InstallTxCallback function .
i run below code i put breakpoint in interrupt but its not hitting while send the data.so please tell the issue
/* User includes (#include below this line is not maintained by Processor Expert) */
#include <string.h>
/* Message sent through UART interface */
#define msg "\nHello!\n"
#define msg1 "\nHello World UART2!\n\r"
/* Length of the message to be received from the console */
#define RX_MSG_LEN 128U
uint8_t rxBuff[RX_MSG_LEN + 1];
void rx_handler(void *driverstate,uart_event_t event,void *userdata)
{
linflexd_uart_state_t *uart_state = (linflexd_uart_state_t*)(driverstate);
uint8_t *data = (uint8_t*)userdata;
}
int main(void)
{
rxBuff[RX_MSG_LEN] = 0;
/*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
#ifdef PEX_RTOS_INIT
PEX_RTOS_INIT(); /* Initialization of the selected RTOS. Macro is defined by the RTOS component. */
#endif
/*** End of Processor Expert internal initialization. ***/
/* Initialize and configure clocks
* - Setup system clocks, dividers
* - see clock manager component for more details
*/
CLOCK_SYS_Init(g_clockManConfigsArr, CLOCK_MANAGER_CONFIG_CNT,
g_clockManCallbacksArr, CLOCK_MANAGER_CALLBACK_CNT);
CLOCK_SYS_UpdateConfiguration(0U, CLOCK_MANAGER_POLICY_FORCIBLE);
/* Initialize pins */
PINS_DRV_Init(NUM_OF_CONFIGURED_PINS, g_pin_mux_InitConfigArr);
/* Initialize LINFlexD module for UART usage */
LINFLEXD_UART_DRV_Init(INST_LINFLEXD_UART1, &linflexd_uart1_State, &linflexd_uart1_InitConfig0);
/* Send the greeting message to console */
// LINFLEXD_UART_DRV_SendData(INST_LINFLEXD_UART1, (uint8_t*)msg, strlen(msg));
// LINFLEXD_UART_DRV_Init(INST_LINFLEXD_UART2, &linflexd_uart2_State, &linflexd_uart2_InitConfig0);
//// linflexd_uart_state_t * uartState;
// uartState = (linflexd_uart_state_t *)s_uartLINFlexDStatePtr[instance];
LINFLEXD_UART_DRV_InstallRxCallback(INST_LINFLEXD_UART1,rx_handler,NULL);
/* Infinite loop */
for( ;; )
{
// LINFLEXD_UART_DRV_SendData(INST_LINFLEXD_UART2,(uint8_t*)msg1, strlen(msg1));
// LINFLEXD_UART_DRV_SendData(INST_LINFLEXD_UART1, (uint8_t*)msg, strlen(msg));
/* Get the message sent by user from the console, using blocking method, each 300 ms */
//LINFLEXD_UART_DRV_ReceiveDataBlocking(INST_LINFLEXD_UART1, rxBuff, RX_MSG_LEN, 300U);
// LINFLEXD_UART_DRV_SendDataBlocking(INST_LINFLEXD_UART1, rxBuff, RX_MSG_LEN, 1000U);
/* If the user typed "Hello", reply with the "Hello world!" message again */
if(strcmp((char*)rxBuff, "Hello") == 0)
{
// LINFLEXD_UART_DRV_SendData(INST_LINFLEXD_UART1, "message right\n\r",15);
LINFLEXD_UART_DRV_SendDataBlocking(INST_LINFLEXD_UART1, (uint8_t*)msg1, strlen(msg1), 100U);
//LINFLEXD_UART_DRV_SendDataBlocking(INST_LINFLEXD_UART1, "message right\n\r", 15, 100U);
/* Clear the buffer */
memset(rxBuff, 0 , RX_MSG_LEN);
}
/* else
{
LINFLEXD_UART_DRV_SendDataBlocking(INST_LINFLEXD_UART1, "message wrong\n\r", 15, 100U);
//LINFLEXD_UART_DRV_SendData(INST_LINFLEXD_UART1, "message wrong\n\r", 15);
}*/
}
#ifdef PEX_RTOS_START
PEX_RTOS_START(); /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
#endif
/*** End of RTOS startup code. ***/
/*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
for(;;) {
if(exit_code != 0) {
break;
}
}
return exit_code;
/*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
/* END main */
/*!
** @}
thanks
kalai