Commit 190573d7 authored by Miguel Jimenez Lopez's avatar Miguel Jimenez Lopez

irq-demo: Fix a bug in the demo_irq_process_loop

If get_utc_ts_from_fmc_dio_device returns EAGAIN, we have to check later because
there are not more timestamps (Other errors cause an exit).
parent 767b56cf
...@@ -161,16 +161,18 @@ static void demo_irq_process_loop(fmc_dio_device fmc_dev, stats_engine engine) ...@@ -161,16 +161,18 @@ static void demo_irq_process_loop(fmc_dio_device fmc_dev, stats_engine engine)
{ {
struct usr_timestamp *ts; struct usr_timestamp *ts;
unsigned int nts; unsigned int nts;
int ret;
/* Process loop: /* Process loop:
* - Get timestamps from FMC DIO device (specific channel under testing) * - Get timestamps from FMC DIO device (specific channel under testing)
* - Pass them to the stats engine and generate the statistics * - Pass them to the stats engine and generate the statistics
* - Sleep for a while to avoid excesive CPU consumption * - Sleep for a while to avoid excesive CPU consumption
*/ */
while(!get_utc_ts_from_fmc_dio_device(fmc_dev, TEST_FMC_DIO_CH, &ts, &nts)) { do {
ret = get_utc_ts_from_fmc_dio_device(fmc_dev, TEST_FMC_DIO_CH, &ts, &nts);
process_timestamps_to_engine(engine, ts, nts); process_timestamps_to_engine(engine, ts, nts);
usleep(PROCESS_SLEEP_US); usleep(PROCESS_SLEEP_US);
} } while(!ret || ret == -EAGAIN);
} }
static void process_timestamps_to_engine(stats_engine engine, struct usr_timestamp *ts, static void process_timestamps_to_engine(stats_engine engine, struct usr_timestamp *ts,
......
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