Hello mark
I trie to generate an interupt on a received data but they don't work.
I configure the handler :
extern QUEUE_HANDLE fnSetRS485(unsigned char ucDriverMode, uint8 Baud_rate ,uint8 ER )
{
TTYTABLE tInterfaceParametersRS485; // table for passing information to driver
tInterfaceParametersRS485.Channel = RS485_UART; // set UART channel for serial use
tInterfaceParametersRS485.ucSpeed = Baud_rate; // baud rate
if(ER == RECEPTION)
{
tInterfaceParametersRS485.Task_to_wake = TASK_MODBUS;
}
tInterfaceParametersRS485.Rx_tx_sizes.RxQueueSize = MODBUS_RX_BUFFER; // input buffer size
tInterfaceParametersRS485.Rx_tx_sizes.TxQueueSize = MODBUS_TX_BUFFER; // output buffer size // wake self when messages have been received
tInterfaceParametersRS485.usConfig = (CHAR_8 | NO_PARITY | ONE_STOP | NO_HANDSHAKE);
tInterfaceParametersRS485.ucMessageTerminator = '\r';
if ((SerialPortID = fnOpen( TYPE_TTY, ucDriverMode, &tInterfaceParametersRS485)) != 0) // open or change the channel with defined configurations (initially inactive)
{
if(ER == RECEPTION)
{
fnDriver( SerialPortID, ( TX_OFF | RX_ON ), 0 );
}
if(ER == EMISSION)
{
fnDriver( SerialPortID, ( TX_ON | RX_OFF ), 0 );
}
if(ER == (EMISSION|RECEPTION ))
{
fnDriver( SerialPortID, ( TX_ON | RX_ON ), 0 );
}
}
return SerialPortID;
}
And in the "TASK_MODBUS" i handle the interupt :
void fnTacheModbus(TTASKTABLE *ptrTaskTable)
{
QUEUE_HANDLE PortIDInternal = ptrTaskTable->TaskID; // queue ID for task input
unsigned char ucInputMessage[RX_BUFFER_SIZE]; // reserve space for receiving messages
while ( fnRead( PortIDInternal, ucInputMessage, HEADER_LENGTH )) // check input queue
{
switch ( ucInputMessage[MSG_SOURCE_TASK] ) // switch depending on message source
{
case TIMER_EVENT:
fnRead( PortIDInternal, ucInputMessage, ucInputMessage[MSG_CONTENT_LENGTH]); // read the complete message
if ((TIME_OUT_FIN_TRAME == ucInputMessage[0]) || (TIME_OUT_NON_REPONSE == ucInputMessage[0]))
{
C_Sys_MaitreModbusSci1_Timeout(); // Lancement de la fonction utiliser pour la gestion des 2 TimeOut
}
break;
case INTERRUPT_EVENT:
C_Sys_ModbusSci1Reception(); // Lancement de la fonction de reception a chaque fois qu'un octet et recu
break;
default :
break;
}
}
}
But the case INTERRUPT_EVENT is not activate when a data is received on the UART.
Did i forgot something ?
Thank's