mirror of https://github.com/EspoTek/Labrador.git
Doesn't halt in while() loop
This commit is contained in:
parent
8bd771f02d
commit
a1075b97fd
Binary file not shown.
|
@ -228,9 +228,14 @@ void isoBuffer::serialDecode(double baudRate)
|
|||
qDebug() << bitPeriod_seconds;
|
||||
qDebug() << dist_seconds;
|
||||
|
||||
return;
|
||||
|
||||
while(dist_seconds > (bitPeriod_seconds + SERIAL_DELAY)){
|
||||
//Read next uart bit
|
||||
|
||||
//Process it
|
||||
//Update the pointer, accounting for jitter
|
||||
updateSerialPtr(baudRate);
|
||||
//Calculate stopping condition
|
||||
dist_seconds = (double)serialDistance()/sampleRate_bit;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -242,3 +247,9 @@ int isoBuffer::serialDistance()
|
|||
return back_bit - serialPtr_bit;
|
||||
}else return bufferEnd_bit - serialPtr_bit + back_bit;
|
||||
}
|
||||
|
||||
void isoBuffer::updateSerialPtr(double baudRate)
|
||||
{
|
||||
int distance_between_bits = sampleRate_bit/baudRate;
|
||||
serialPtr_bit += distance_between_bits;
|
||||
}
|
||||
|
|
|
@ -61,6 +61,7 @@ private:
|
|||
bool uartTransmitting = false;
|
||||
isoBufferBuffer *serialBuffer;
|
||||
bool symbolUpdated = false;
|
||||
void updateSerialPtr(double baudRate);
|
||||
//Generic Functions
|
||||
double sampleConvert(short sample, int TOP, bool AC);
|
||||
public slots:
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue