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

Adding define for invalid pps cycle

parent 9e60febb
No related branches found
No related tags found
1 merge request!653Adding sync code, to re-sync ADCs on startup.
......@@ -177,7 +177,7 @@ void fe_start_controller( void )
one_pps_sync_t onePps = {0,9999};
one_pps_sync_t onePps = {0, INVALID_CYCLE_1PPS};
......
......@@ -183,6 +183,7 @@ int sync21pps_check( one_pps_sync_t* p1pps, adcInfo_t* padcinfo, int cycle_64k_H
if ( cycle_64k_Hz == MODEL_RATE_HZ ) {
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",
p1pps->transition_high_cycle,
......@@ -190,7 +191,7 @@ int sync21pps_check( one_pps_sync_t* p1pps, adcInfo_t* padcinfo, int cycle_64k_H
return -1;
}
p1pps->transition_high_cycle = 9999;//Reset to invalid number
p1pps->transition_high_cycle = INVALID_CYCLE_1PPS;//Reset to invalid number
}
......
......@@ -10,6 +10,7 @@ extern "C" {
#define MAX_CYCLE_FOR_1PPS_TO_BE_HIGH (2)
#define MAX_CYCLES_TO_WAIT_FOR_1PPS_HIGH (MODEL_RATE_HZ * 4) //4 seconds
#define INVALID_CYCLE_1PPS -1
typedef enum
{
......
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