diff --git a/Code-C/fileGestion.c b/Code-C/fileGestion.c index 78d17e1..5b9eeee 100644 --- a/Code-C/fileGestion.c +++ b/Code-C/fileGestion.c @@ -26,4 +26,16 @@ void writePowerData(double a[], int N){ } } fclose(f); +} + +void threadCalcul(){ + while(stopFlag == false){ + if(rawDataWriteFlag){ + pthread_mutex_lock(&mutex); + while(power(nRow,nCol,period,timeBandwidth) == false){} + pthread_mutex_unlock(&mutex); + rawDataWriteFlag = true; + delay(10); + } + } } \ No newline at end of file diff --git a/Code-C/fileGestion.h b/Code-C/fileGestion.h index de62a28..4df4dcf 100644 --- a/Code-C/fileGestion.h +++ b/Code-C/fileGestion.h @@ -3,5 +3,7 @@ #include #include +bool writeFlag = 0; + void clearRawData(int N); void writePowerData(double a[], int N); \ No newline at end of file diff --git a/Code-C/initialParameters.h b/Code-C/initialParameters.h index 3007f21..708bc2b 100644 --- a/Code-C/initialParameters.h +++ b/Code-C/initialParameters.h @@ -2,5 +2,4 @@ const int nRow = 100000; const int nCol = 9; const double freqEch = 250; -const double period = 1.0/freqEch; -const double timeBandwidth = 1.0 /(nRow * period); +extern bool rawDataWriteFlag , stopFlag; \ No newline at end of file diff --git a/Code-C/main.c b/Code-C/main.c index 3e55a33..70402cf 100644 --- a/Code-C/main.c +++ b/Code-C/main.c @@ -4,6 +4,8 @@ #include "power.h" #include "initialParameters.h" +bool rawDataWriteFlag = 0, stopFlag = 0; + int main(int argc , char** argv){ while(power(nRow,nCol,period,timeBandwidth)==0){} } \ No newline at end of file