Trigger count thresh no longer has bad offset

This commit is contained in:
Chris Esposito 2018-11-06 14:04:53 +11:00
parent 086c6634fc
commit 76154a6f7f
2 changed files with 3 additions and 2 deletions

View File

@ -2,6 +2,7 @@
#define DESKTOP_SETTINGS_H
#include <QMutex>
#include <algorithm>
//Just a whole lot of variables not directly related to xmega.
@ -16,7 +17,7 @@ extern int TIMER_PERIOD;
extern int ISO_RECOVERY_TIME;
extern int MAX_WINDOW_SIZE;
extern int TICK_SEPARATION;
#define TRIGGER_COUNT_THRESH (7 + log10(window)) //Is this the right number?
#define TRIGGER_COUNT_THRESH (7 + std::max<int>(0, log10(window))) //Is this the right number?
//Multimeter settings
extern int MULTIMETER_PERIOD;

View File

@ -778,7 +778,7 @@ void isoDriver::frameActionGeneric(char CH1_mode, char CH2_mode) //0 for off, 1
if((!paused_CH1) && triggerEnabled && (triggerWaiting == 0)){
triggerDelay = backLength - offset;
triggerDelay /= (CH1_mode == -1) ? (VALID_DATA_PER_750 * 1000) : (VALID_DATA_PER_375*1000);
triggerDelay += delay;
//triggerDelay += delay;
triggerWaiting = (triggerDelay<(window/2)) * 2;
}