#include "pbdata.h"
uint8_t TxBuffer1[] = "USART Interrupt Example: This isUSART1 DEMO";
uint8_t RxBuffer1[],rec_f,tx_flag;
vola tile uint8_t TxCounter1 = 0x00;
volatile uint8_t RxCounter1 = 0x00;
uint32_t Rec_Len;
int main(void)
{
u8 a=0;
RCC_Configuration();
NVIC_Configuration();
GPIO_Configuration();
USART_Config(USART1);
while(1)
{
if(rec_f==1)
{
rec_f=0;
USART_OUT(USART1,&TxBuffer1[0]);
if(a==0){GPIO_SetBits(GPIOA, GPIO_Pin_2); a=1;}
else{GPIO_ResetBits(GPIOA, GPIO_Pin_2);a=0; }
}
}
}
|