Skip to content
Snippets Groups Projects
Commit 1fa95af8 authored by Ezekiel Dohmen's avatar Ezekiel Dohmen
Browse files

Check on 2nd to last cycle for signal down

parent aba525e1
No related branches found
No related tags found
1 merge request!653Adding sync code, to re-sync ADCs on startup.
......@@ -178,16 +178,17 @@ int sync21pps_check( one_pps_sync_t* p1pps, adcInfo_t* padcinfo, int cycle_64k_H
p1pps->last_cycle_high = 0;
}
//On last cycle, we expect one of each transition
//and to be in the low state
if ( cycle_64k_Hz == MODEL_RATE_HZ ) {
//On 2nd to last cycle, we expect to have transitioned
//in the allowed cycles and to be in the low state
if ( cycle_64k_Hz == (MODEL_RATE_HZ/UNDERSAMPLE) - 2) {
if( p1pps->transition_high_cycle > MAX_CYCLE_FOR_1PPS_TO_BE_HIGH ||
p1pps->transition_high_cycle < 0 ||
p1pps->last_cycle_high == 1) {
RTSLOG_ERROR("PPS Tracking error, transition_high_cycle: %d, last_cycle_high: %d\n",
RTSLOG_DEBUG("PPS Tracking error, transition_high_cycle: %d, last_cycle_high: %d, PPS chan val: %d\n",
p1pps->transition_high_cycle,
p1pps->last_cycle_high);
p1pps->last_cycle_high,
p1pps->value);
return -1;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment