paparazzi-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Paparazzi-devel] modules with UART


From: Jimmy
Subject: Re: [Paparazzi-devel] modules with UART
Date: Sat, 19 Jul 2014 23:52:09 -0700 (PDT)

hi,
Thank you for your answer.
I've written a program for USART,just like the following:
//Data format: D_12345 ... F, the header is 'D', the end of the frame 'F'

void USART3_IRQHandler(void)
{
        char pt;
        if(USART_GetITStatus(USART3, USART_IT_RXNE) != RESET)
        {
                pt =  USART_ReceiveData(USART3);
                if((pt=='D')&&(Buffer3RevFlag==0))//Received header
                {
                        Buffer3RevFlag = 1;     
                }
                if(Buffer3RevFlag == 1)
                {
                        RxBuffer3[RxBuffer3Counter++] = pt;
                        if(RxBuffer3Counter>14)//Data Overflow
                        {
                                Buffer3RevFlag = 0;
                                RxBuffer3Counter = 0;
                        }
                        if(pt == 'F')//End of Frame
                        {
                                RxBuffer3[RxBuffer3Counter] = '\0';
                                Buffer3RevFlag = 0;
                                RxBuffer3Counter = 0;
                                strcpy(pAngle_BUF,RxBuffer3+2);/*String copy, 
the first two characters
from the beginning RxBuffer3*/
                        }                               
                }
                USART_ClearITPendingBit(USART3,USART_IT_RXNE);
        }       
}
Which I want to find is a example(a sensor),which use the UART for data
transmission.I want to add a module.Would you have done it before?



--
View this message in context: 
http://lists.paparazziuav.org/Re-modules-with-UART-tp15837p15840.html
Sent from the paparazzi-devel mailing list archive at Nabble.com.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]