Allow applications to sync with vblank.
Signed-off-by: Keith Packard <keithp@keithp.com>
+uint8_t ao_vga_vblank;
+
void stm_tim2_isr(void)
{
int16_t line = stm_tim3.cnt;
void stm_tim2_isr(void)
{
int16_t line = stm_tim3.cnt;
if (((line - VBLANK_END) & 1))
scanline += AO_VGA_STRIDE;
} else {
if (((line - VBLANK_END) & 1))
scanline += AO_VGA_STRIDE;
} else {
+ if (line == VBLANK_START) {
+ ao_vga_vblank = 1;
+ ao_wakeup(&ao_vga_vblank);
+ }
scanline = ao_vga_fb;
}
stm_tim2.sr = 0;
scanline = ao_vga_fb;
}
stm_tim2.sr = 0;
extern const struct ao_bitmap ao_vga_bitmap;
extern const struct ao_bitmap ao_vga_bitmap;
+extern uint8_t ao_vga_vblank;
+