Skip to content
Snippets Groups Projects
Commit fbdab872 authored by Pieter Donker's avatar Pieter Donker
Browse files

L2SDP-436, made some changes to get it working

parent 8c757c6c
Branches
Tags
1 merge request!33Resolve L2SDP-436
......@@ -345,7 +345,7 @@ bool Periph_fpga::read(TermOutput& termout, const string addr,
retval = read_all_from_port(termout, "REG_SI", "enable", format);
}
else if (addr == "fpga/pps_expected_cnt") {
retval = read_all_from_port(termout, "PIO_PPS", "expected_cnt", format);
retval = read_pps_expected_cnt(termout, format);
}
else if (addr == "fpga/pps_present") {
retval = read_pps_present(termout, format, R_MEM);
......@@ -557,9 +557,11 @@ bool Periph_fpga::monitor(TermOutput& termout)
tictoc.tic(name.c_str());
read_system_info(termout); // read_system_info() will set Online state.
if (Online) {
if (my_pps_expected_cnt == 0) {
read_pps_expected_cnt(termout, REG_FORMAT_UINT32);
}
read_time_since_last_pps(termout, REG_FORMAT_INT64, R_UCP);
read_pps_capture_cnt(termout, REG_FORMAT_UINT32, R_UCP);
read_pps_present(termout, REG_FORMAT_BOOLEAN, R_UCP);
read_bsn_monitor_input_sync_timeout(termout, REG_FORMAT_INT64, R_UCP);
read_bsn_monitor_input_bsn(termout, REG_FORMAT_INT64, R_UCP);
read_xst_input_sync_at_bsn(termout, REG_FORMAT_INT64, R_UCP);
......@@ -2230,10 +2232,25 @@ bool Periph_fpga::read_all_from_port(TermOutput& termout, const string& port_nam
}*/
bool Periph_fpga::read_pps_expected_cnt(TermOutput& termout, int format) {
bool retval = true;
uint32_t data = 0;
retval = Read("mm/0/PIO_PPS/0/expected_cnt", &data);
my_pps_expected_cnt = data;
uint32_t *_ptr = (uint32_t *)termout.val;
*_ptr = my_pps_expected_cnt;
termout.nof_vals = 1;
termout.datatype = format;
return retval;
}
bool Periph_fpga::write_pps_expected_cnt(const char *data) {
uint32_t *_ptr = (uint32_t *)data;
bool retval = true;
retval = Write("mm/0/PIO_PPS/0/expected_cnt", _ptr);
return retval;
}
......@@ -2257,7 +2274,10 @@ bool Periph_fpga::read_pps_capture_cnt(TermOutput& termout, int format, int mode
retval = Read("mm/0/PIO_PPS/0/capture_cnt", &data);
my_pps_capture_cnt = data;
// check if capture count is as expected, and set pps_present
my_pps_present = (my_pps_capture_cnt == my_pps_expected_cnt);
my_pps_present = false;
if (my_pps_capture_cnt == my_pps_expected_cnt) {
my_pps_present = true;
}
}
uint32_t *_ptr = (uint32_t *)termout.val;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment