Skip to content

Commit

Permalink
decode-reg: fix misleading pos_calc output.
Browse files Browse the repository at this point in the history
Using the decode mode with pos_calc::Core would print register fields
belonging to the amplitude FIFO (both status and values), but read from
zeroed-out memory, instead of from the hardware. Beyond being
misleading, it's incomplete information. Therefore, we force the core to
read amplitude FIFO information from the hardware.
  • Loading branch information
ericonr committed Sep 13, 2024
1 parent 5bc7bdb commit 53b4310
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/decode-reg.cc
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,14 @@ int main(int argc, char *argv[])
}

dec->get_data();

if (type == "pos_calc") {
/* force module to actually read these registers */
auto dec_pos_calc = dynamic_cast<pos_calc::Core *>(dec.get());
dec_pos_calc->fifo_empty();
dec_pos_calc->get_fifo_amps();
}

dec->print(stdout, verbose);
} while (watch);
} else {
Expand Down

0 comments on commit 53b4310

Please sign in to comment.