vasko ozo
/
TxRxService
20190816
Diff: main.cpp
- Revision:
- 19:09c21f5f0625
- Parent:
- 18:bef650cab156
- Child:
- 20:b60d2a5cd128
--- a/main.cpp Mon Aug 05 18:17:35 2019 +0000 +++ b/main.cpp Wed Aug 07 17:53:12 2019 +0000 @@ -2,8 +2,21 @@ DigitalOut myled(LED1); +Serial dpc(USBTX,USBRX); + +Ticker tickTx; + +void tickIntrFunc(void){ + MsgType _msg; + _msg.cmd=0x41; + _msg.pars.i32=0; + if(StartTx(&_msg.cmd)==StartOK) dpc.printf("Packet sending OK\n\r"); + else dpc.printf("Sending service not ready\n\r"); + }//tickIntrFunc + int main() { TxRxServiceInit(); + tickTx.attach(&tickIntrFunc, 1); //Exige Monumentum //Я дебил,потому что хотел выполнить действия,которые @@ -16,8 +29,7 @@ while(1) { if ( RxBuffFull == 1 ) { RxBuffFull = 0; -// if(GetCheckSum(&RxBuff.cmd) == RxBuff.cs){} - if( StartTx(&RxBuff.cmd) == StartOK)myled = 0 ;else myled = 1; + if(GetCheckSum(&RxBuff.cmd) == RxBuff.cs) myled = 0; else myled = 1; } }//while(1) }//main