struct queue file and functions
This commit is contained in:
parent
38366241a1
commit
023b77aeba
|
@ -26,4 +26,16 @@ 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -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);
|
|
@ -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);
|
|
|
@ -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){}
|
||||||
}
|
}
|
Loading…
Reference in a new issue