From a8f1486e2c552858343ea55503901910eb9c2886 Mon Sep 17 00:00:00 2001 From: "quentin.perret" Date: Wed, 8 Jun 2022 12:29:34 +0200 Subject: [PATCH] add flag --- Code-C/simulateFlux | Bin 17280 -> 17352 bytes Code-C/simulateFlux.c | 16 ++++++++++++---- Code-C/simulateFlux.h | 2 ++ 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Code-C/simulateFlux b/Code-C/simulateFlux index 5f39085621b98c17cf57a1adc0f7639e8f35271d..646e120b9e994830bb37cbcc5bb2d02661db82d9 100755 GIT binary patch delta 1242 zcmYjReP|R%6rZ=r)|?-?5AVDSinp6elOX2O^Wx<+A$v)Q7ZeqfYf>fPl@e{KR%z7y z5il`oJVP+{mC}HMTA^v75Zsd{F={nPE`@#wDhLG?s+^6*22)5ex_z@di4M&C=KX$e z-g`T5*!C_+cR_C<#7-66w_TB$Ij*1+0ydvySw5^K>q}w%jvdhDY*Z|54lz%``xQ!fl-Ox8){V@&=*>?RiWcFPyY=$wX@Uo78g zN_O<8mT!8SM&o$L?XK=HME3E~=3=}5h#AA~*I2Y+V^77&LdK%+*Cy{q)QkrxZXxs;U=` zVnp>Pbc*&J?`SmFaZIXS^j6jdY2myawv4FLG|QhGMl<1@E+x2Z>LWxSCS7?`-)_o` zn#um4*^5K!dg#|7|Na8ZtSW<)t`;{)QYH%zl+@rBDO(>YsRu}*GZ=tIj0U|hK&waJ z6TArEMm2Ph=)O<^l;ib~pTviu2FPHfbSJdoxzcdNET2-j=wn@youxdyp4a0B@lKY< z1~iMKH)oD1oD6v(&DXrg>TT0ZdT!ZjX7#aF!Ov!G z6j}2{Rz;j>68wnUB=VWrN7{cPgqu#wbCWo*4-;W8bnjvB)w^RE4SeeN~mVe!+c>56MF-vpi-{tqx1& K>u_83JO2YA9V~bN delta 1113 zcmZWoZAcVR6n%HLtsOOYXKT?#Yj=gv&2&{<*GzF%3ze*_G@~*!jP##BHWDc^Ds2r( zy$}&W_9M_Bu!f*0%CZmrm4O&Rkp{(zRz?Ov+3U`S8g${!dH0+%_r8yr;dW?khprT0 z-QM@&2{Y5;1WMo&ZGxWJu#B=UBOAt3&@NTDb!`#RDcoN@qHIZ=ZSs%ZtZ(hTS!^}e zDtjI(5g{tp+p>(Y($1BuG$5R=;U7J;+ev zxZjTOQ2A=V18H~FzSHKrKrk{?RT};{9rZ}%B7c5yuBnlddCt!ch9X_)a>Va^#yLN4 zzL&~a_&GJ&5zUxxYgu?(ir{9c`sq>Ea$_7U4%`9N564CK{!On zXz_>UICm4CA(ROR32O=6c-@@}@%YN^gA@c$vU7kcTIkJ%NTkUD8l4#Qxa#gx{j2KL z1Y>P&Lh;JwrprRi3JX(RS7_vY=RApUQLj-|rs)p|^GVx(ub$T2IB23mf4IhH3pxLZ*p8G2V^5P;FG#0 za!*hpHRvPKLZ&J<=48#XK^RbOR3BTd6WYnrbf>}JHuxmNf6(BcNg9C{0wNs7TeOQ~ z>eJalx+KK^*XN?P(*ey%CzBfo?-XzD8$e55hjJ-z29$I8wI=AssY0K)aG)Xd$R)5H z8)cuk^xs~S17e?BUr(PhDYpZiU}I50Y|hZh4D2ro&|OUy6^gwE*MQ#QfN06p9kbY2 Q9Ekdvr)MhwZ{)B23qRuzDgXcg diff --git a/Code-C/simulateFlux.c b/Code-C/simulateFlux.c index 5f23070..1cbb294 100644 --- a/Code-C/simulateFlux.c +++ b/Code-C/simulateFlux.c @@ -41,6 +41,7 @@ int writeOneRawData(){ } fclose(f); cpt++; + sleep(0.004); //simul la freq ech return 0; } else { @@ -48,13 +49,20 @@ int writeOneRawData(){ } } -void simulateFlux(){ - while(writeOneRawData()==0){ - sleep(0.004); +int simulateFlux(){ + while(writeOneRawData()==0){ + if(cpt==nRows){ + tFlag = 1; + } + while(tFlag == 1){ + /*printf("max nRows"); + cpt = 0; + tFlag = 0; + break;*/ + } } } int main(int argc , char argv[]){ simulateFlux(); - printf("%d",cpt); } \ No newline at end of file diff --git a/Code-C/simulateFlux.h b/Code-C/simulateFlux.h index 4bce58c..82d8a35 100644 --- a/Code-C/simulateFlux.h +++ b/Code-C/simulateFlux.h @@ -6,6 +6,8 @@ #include int cpt = 0; +int tFlag = 0; +int nRows = 1000; typedef struct { uint8_t octet1;