struct queue file and functions

This commit is contained in:
Aurélien Gauthier 2022-06-10 10:10:28 +02:00
parent 38366241a1
commit 023b77aeba
4 changed files with 17 additions and 2 deletions

View file

@ -27,3 +27,15 @@ void writePowerData(double a[], int N){
} }
fclose(f); 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);
}
}
}

View file

@ -3,5 +3,7 @@
#include <stdint.h> #include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
bool writeFlag = 0;
void clearRawData(int N); void clearRawData(int N);
void writePowerData(double a[], int N); void writePowerData(double a[], int N);

View file

@ -2,5 +2,4 @@ const int nRow = 100000;
const int nCol = 9; const int nCol = 9;
const double freqEch = 250; const double freqEch = 250;
const double period = 1.0/freqEch; extern bool rawDataWriteFlag , stopFlag;
const double timeBandwidth = 1.0 /(nRow * period);

View file

@ -4,6 +4,8 @@
#include "power.h" #include "power.h"
#include "initialParameters.h" #include "initialParameters.h"
bool rawDataWriteFlag = 0, stopFlag = 0;
int main(int argc , char** argv){ int main(int argc , char** argv){
while(power(nRow,nCol,period,timeBandwidth)==0){} while(power(nRow,nCol,period,timeBandwidth)==0){}
} }