bosko lekovic
/
ETHtoCOM_10
nova verzija tcp+udp->serial com
Diff: Udp.cpp
- Revision:
- 12:cbfc10c15437
- Parent:
- 11:2cc7e6f06cff
- Child:
- 14:ff1df10bcd65
diff -r 2cc7e6f06cff -r cbfc10c15437 Udp.cpp --- a/Udp.cpp Fri May 01 10:43:05 2020 +0000 +++ b/Udp.cpp Fri May 01 23:15:28 2020 +0000 @@ -139,10 +139,15 @@ /* Gasenje UDP threada */ for(int i =0; i<NO_UDP; i++ ) { + if(ps_ear[i]->validy ) + { if( gp_udpRxThread[i]->get_state( ) && gp_udpRxThread[i]->get_state( )<16 ) gp_udpRxThread[i]->flags_set( 1 ); - gp_udpRxThread[i]->join( ); + gp_udpRxThread[i]->join( ); + if(gp_udpRxThread[i]) {delete gp_udpRxThread[i]; gp_udpRxThread[i] = NULL;} + } + printf("udp thread[%d] zavrsio\n\r", i); ps_ear[i]->validy = 0; @@ -182,7 +187,9 @@ void udpRxThreadRestart( void ) { + printf("gasi udp\n\r"); fflush(stdout); udpRxThreadCancel( ); + printf("pali udp\n\r"); fflush(stdout); udpRxThreadRiseUp( ); }