Skip to content

Commit

Permalink
framebuffer: fix sync generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastien Bourdeauducq committed Jul 1, 2012
1 parent 6776e22 commit 0a29b74
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions milkymist/framebuffer/__init__.py
Expand Up @@ -109,8 +109,6 @@ def get_fragment(self):
generate_en = Signal()
hcounter = Signal(BV(_hbits))
vcounter = Signal(BV(_vbits))
hsync = Signal()
vsync = Signal()

comb = [
active.eq(hactive & vactive),
Expand All @@ -133,8 +131,8 @@ def get_fragment(self):

If(hcounter == 0, hactive.eq(1)),
If(hcounter == tp.hres, hactive.eq(0)),
If(hcounter == tp.hsync_start, hsync.eq(1)),
If(hcounter == tp.hsync_end, hsync.eq(0)),
If(hcounter == tp.hsync_start, self.token("dac").hsync.eq(1)),
If(hcounter == tp.hsync_end, self.token("dac").hsync.eq(0)),
If(hcounter == tp.hscan,
hcounter.eq(0),
If(vcounter == tp.vscan,
Expand All @@ -146,9 +144,9 @@ def get_fragment(self):

If(vcounter == 0, vactive.eq(1)),
If(vcounter == tp.vres, vactive.eq(0)),
If(vcounter == tp.vsync_start, vsync.eq(1)),
If(vcounter == tp.vsync_start, self.token("dac").vsync.eq(1)),
If(vcounter == tp.vsync_end,
vsync.eq(0),
self.token("dac").vsync.eq(0),
self.endpoints["timing"].ack.eq(1)
)
)
Expand Down

0 comments on commit 0a29b74

Please sign in to comment.