Commit c178c603 authored by Lucas Russo's avatar Lucas Russo

sm_io/*/acq/*: fix triggered acquisition when post_samples = 0

See github issue #62.
parent 17559883
......@@ -159,14 +159,19 @@ static int _acq_data_acquire (void *owner, void *args, void *ret)
"Number of shots = %u\n", acq_core_shots);
smio_thsafe_client_write_32 (self, ACQ_CORE_REG_SHOTS, &acq_core_shots);
uint32_t trigger = 0;
_acq_get_trigger_type (self, &trigger);
/* FIXME FPGA Firmware requires number of samples to be divisible by
* acquisition channel sample size */
uint32_t samples_alignment =
DDR3_PAYLOAD_SIZE/acq->acq_buf[chan].sample_size;
uint32_t num_samples_pre_aligned = hutils_align_value(num_samples_pre,
samples_alignment);
uint32_t num_samples_post_aligned = hutils_align_value(num_samples_post,
samples_alignment);
/* FIXME. Curently, the FPGA gateware does not support triggered acquisitions with
* post_samples = 0. See github lnls-bpm/bpm-gw#62 */
uint32_t num_samples_post_aligned = (num_samples_post == 0 && trigger != TYPE_ACQ_CORE_SKIP) ?
samples_alignment : hutils_align_value(num_samples_post, samples_alignment);
/* Set the parameters: number of samples of this channel */
acq->acq_params[chan].num_samples_pre = num_samples_pre_aligned;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment