Adjust tolerance for gen1/gen2 detection
@@ -54,9 +54,12 @@ bool handle_lightcap(SurviveObject *so, const LightcapElement *_le) {
// would have a hard time generating this signature.
bool isOOTXPulseLength = _le->length >= 3000 && _le->length < 6500;
if (isOOTXPulseLength) {
+ bool firstPulse = dv->last_pulse_times[_le->sensor_id] == 0;
+
uint32_t pulse_dist = _le->timestamp - dv->last_pulse_times[_le->sensor_id];
dv->last_pulse_times[_le->sensor_id] = _le->timestamp;
+ if (!firstPulse) {
uint32_t dist_at_120hz = 400000;
uint32_t dist_at_60hz = 2 * dist_at_120hz;
bool matches_60hz_lh1 = (pulse_dist > dist_at_60hz * .95 && pulse_dist < dist_at_60hz * 1.05);
@@ -69,8 +72,9 @@ bool handle_lightcap(SurviveObject *so, const LightcapElement *_le) {
}
}
}
+ }
- if (dv->total_count > 100) {
+ if (dv->total_count > 500) {
remove_all_disambiguate_version(ctx);
survive_notify_gen2(so, "no OOTX pulses detected");
}
