Skip to content

Commit

Permalink
periodic debug log for phase locked loop
Browse files Browse the repository at this point in the history
  • Loading branch information
m0dB authored and m0dB committed Dec 31, 2023
1 parent bfbeb71 commit 41ea0fd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/waveform/vsyncthread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ VSyncThread::VSyncThread(QObject* pParent)
m_displayFrameRate(60.0),
m_vSyncPerRendering(1),
m_pllPhaseOut(0.0),
m_pllDeltaOut(16666.6) { // 60 FPS
m_pllDeltaOut(16666.6), // 60 FPS initial delta
m_pllLogging(0.0) {
m_pllTimer.start();
}

Expand Down Expand Up @@ -241,5 +242,13 @@ void VSyncThread::updatePLL() {
m_pllPhaseOut += alpha * pllPhaseError; // adjust phase
m_pllDeltaOut += beta * pllPhaseError; // adjust delta

// qDebug() << "PLL delta" << m_pllDeltaOut;
if (pllPhaseIn > m_pllLogging) {
if (m_pllLogging == 0) {
m_pllLogging = pllPhaseIn;
} else {
qDebug() << "phase-locked-loop:" << m_pllPhaseOut << m_pllDeltaOut;
}
// log every 10 seconds
m_pllLogging += 10000000.0;
}
}
1 change: 1 addition & 0 deletions src/waveform/vsyncthread.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,5 @@ class VSyncThread : public QThread {
PerformanceTimer m_pllTimer;
double m_pllPhaseOut;
double m_pllDeltaOut;
double m_pllLogging;
};

0 comments on commit 41ea0fd

Please sign in to comment.