overriding Serial Driver interrupt
Posted: Tue Apr 24, 2012 3:43 pm
I'm trying to port modbus realization using CMSIS to Ch.
I have to redefine UART2 irq to serve incoming data like this:
Is it possible to redefine IRQ Vector assigned to USART2 and using SerialDriver or I had to switch of ch driver and work with hardware without OS layer?
I have to redefine UART2 irq to serve incoming data like this:
Code: Select all
void USART3_IRQHandler(void)
{
//Receive Data register not empty interrupt
if(USART_GetITStatus(USART3, USART_IT_RXNE) != RESET)
{
USART_ClearITPendingBit(USART3, USART_IT_RXNE);
uart3.rxtimer=0;
if(uart3.rxcnt>(BUF_SZ-2))
uart3.rxcnt=0;
uart3.buffer[uart3.rxcnt++]=USART_ReceiveData (USART3);
}
//Transmission complete interrupt
if(USART_GetITStatus(USART3, USART_IT_TC) != RESET)
{
USART_ClearITPendingBit(USART3, USART_IT_TC);
if(uart3.txcnt<uart3.txlen)
{
USART_SendData(USART3,uart3.buffer[uart3.txcnt++]);
}
else
{
uart3.txlen=0;
//rs485 tx disable
GPIO_WriteBit(GPIOB,GPIO_Pin_2,Bit_RESET);
USART_ITConfig(USART3, USART_IT_RXNE, ENABLE);
USART_ITConfig(USART3, USART_IT_TC, DISABLE);
}
}
}
Is it possible to redefine IRQ Vector assigned to USART2 and using SerialDriver or I had to switch of ch driver and work with hardware without OS layer?