/**
******************************************************************************
* @file main.c
* @author kevin_guo
* @version V1.0.0
* @date 12-15-2017
* @brief This file provides functions to main
******************************************************************************
* @attention
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include "stm32f10x.h"
#include <stm32f10x_conf.h>
#include "delay.h"
#include "usart.h"
/* extern variables ----------------------------------------------------------*/
extern unsigned short int length_val;
extern unsigned char rxbuf[16],rxempty, rxcnt,rxflag,waitflag;
extern unsigned int timeout;
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* Private function ----------------------------------------------------------*/
//void BuzzerInit(voi
/
// GPIO_InitTypeDef GPIO_InitStructur
//
//
//
//
// RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO, ENABLE);
// GPIO_PinRemapConfig(GPIO_Remap_SWJ_JTAGDisable,ENABLE
//// GPIO_PinRemapConfig(GPIO_Remap_SWJ_Disable,ENAB
// GPIO_PinRemapConfig(GPIO_Remap_PD01,ENABLE
// DBGMCU_Config(DBGMCU_CR_TRACE_IOEN,DISABLE
//
// /* Enable the GPIO Clock */
// RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE
// /* Configure the GPIO pin */
// GPIO_InitStructure.GPIO_Pin = GPIO_Pin_
// GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_P
// GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MH
// GPIO_Init(GPIOB, &GPIO_InitStructure);
//
// GPIO_ResetBits(GPIOB, GPIO_Pin_4
//// GPIO_SetBits(GPIOB, GPIO_Pin
/
/*******************************************************************************
* Function Name : main
* Description : main program body
* Input : None
* Output : None
* Return : None
*******************************************************************************/
int main(void)
{
unsigned char i;
// BuzzerInit(
Delay_Init();
Uart_Init(9600);
Send_Data_To_UART1('s');
Send_Data_To_UART1('5');
Send_Data_To_UART1('-');
Send_Data_To_UART1('1');
Send_Data_To_UART1('#');
Delay_mS(10);
waitflag=1;
while(waitflag==1);
waitflag=0;
Delay_mS(1000);
rxcnt=0;
while(1)
{
Send_Data_To_UART1('r');
Send_Data_To_UART1('6');
Send_Data_To_UART1('#');
timeout=10000;
while((rxflag==0)&&(timeout--));
if(rxflag)
{
for(i=0; i<rxcnt; i++)
{
if(rxbuf=='m') { if(rxbuf[i+1]=='m')
/************************END OF FILE*************************/
|