1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- #include "tq.h"
- #include "ALL_Includes.h"
- #include "stm32f0xx_iwdg.h"
- extern uint8_t MyType;
- uint8_t sendbuf[10];
- void sendstr(void)
- {
- int k=0; int l=0;
- int i;
- for (i=0;i<5;i++)
- {
- if (sendbuf[i]!=0x20) l++;
- if ((sendbuf[i]>=0x30 && sendbuf[i]<=0x39) || sendbuf[i]==0x2D||sendbuf[i]<=0x20)
- k=1;
- else if (sendbuf[i]<0x30 || sendbuf[i]>0x39) { k=2; break;}
- }
-
- if (k<2 && l>0)
- {
- LED_On();
- if (MyType==1 ||MyType==3)
- {
- for (i=5;i>=0;i--) USART_SendData(USART1, sendbuf[i]);
- //for (i=0;i<6;i++) USART_SendData(USART1, sendbuf[i]);
- }
- else if (MyType==4)
- {
- for (i=0;i<6;i++) USART_SendData(USART1, sendbuf[i]);
- }
- else if (MyType==5)
- {
- for (i=0;i<6;i++) USART_SendData(USART1, sendbuf[i]);
- }
- else if (MyType==6 || MyType==7)
- {
- for (i=0;i<6;i++) USART_SendData(USART1, sendbuf[i]);
- }
- else if (MyType==2) //ez3400
- {
- for (i=6;i>0;i--)
- {
- if ((sendbuf[i])==0x20)
- {
- sendbuf[i]=sendbuf[1];
- break;
- }
- }
- for (i=2;i<8;i++) USART_SendData(USART1, sendbuf[i]);
- }
- WatchDog_Feed();
- LED_Off();
- }
- }
|