forked from M-Labs/artiq
grabber: fix frame size off-by-1
This commit is contained in:
parent
ec62eb9373
commit
312256a18d
|
@ -134,8 +134,12 @@ pub fn tick() {
|
|||
if clock_pattern_ok(g) {
|
||||
let last_xy = get_last_pixels(g);
|
||||
if last_xy != unsafe { INFO[g].frame_size } {
|
||||
// x capture is on ~LVAL which is after
|
||||
// the last increment on DVAL
|
||||
// y capture is on ~FVAL which coincides with the
|
||||
// last increment on ~LVAL
|
||||
info!("grabber{} frame size: {}x{}",
|
||||
g, last_xy.0 + 1, last_xy.1 + 1);
|
||||
g, last_xy.0, last_xy.1 + 1);
|
||||
unsafe { INFO[g].frame_size = last_xy }
|
||||
}
|
||||
State::Watch
|
||||
|
|
|
@ -89,14 +89,16 @@ class Parser(Module, AutoCSR):
|
|||
pix.x.eq(pix.x + 1),
|
||||
),
|
||||
If(~lval,
|
||||
If(last_lval, last_x.eq(pix.x)),
|
||||
pix.x.eq(0),
|
||||
If(last_fval & last_lval,
|
||||
If(last_lval,
|
||||
last_x.eq(pix.x),
|
||||
pix.y.eq(pix.y + 1)
|
||||
)
|
||||
),
|
||||
pix.x.eq(0)
|
||||
),
|
||||
If(~fval,
|
||||
If(last_fval, last_y.eq(pix.y)),
|
||||
If(last_fval,
|
||||
last_y.eq(pix.y)
|
||||
),
|
||||
pix.y.eq(0)
|
||||
)
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue