if ((ret = read_fpga_register(sdi, 1, ®1)) != SR_OK)
return ret;
+ /* Ignore FIFO overflow on previous capture */
+ reg1 &= ~0x20;
+
if (reg1 != 0x08) {
sr_dbg("Invalid state at acquisition setup: 0x%02x != 0x08.", reg1);
return SR_ERR;
if ((ret = read_fpga_register(sdi, 1, ®1)) != SR_OK)
return ret;
- if (reg1 != 0x08) {
- sr_dbg("Invalid state at acquisition stop: 0x%02x != 0x08.", reg1);
+ if ((reg1 & ~0x20) != 0x08) {
+ sr_dbg("Invalid state at acquisition stop: 0x%02x != 0x08.", reg1 & ~0x20);
return SR_ERR;
}
if ((ret = read_fpga_register(sdi, 9, ®9)) != SR_OK)
return ret;
+ if (reg1 & 0x20) {
+ sr_warn("FIFO overflow, capture data may be truncated.");
+ return SR_ERR;
+ }
+
return SR_OK;
}