1
0
mirror of git://projects.qi-hardware.com/ben-blinkenlights.git synced 2025-04-21 12:27:27 +03:00

ubb-vga: express mode data in more common units and remove hard-coded constants

- ubb-vga.h (struct mode), ubb-vga.c (mode_db): replaced hsync_end with
  its constituends hsync_cycles and hback_cycles
- ubb-vga.h (struct mode), ubb-vga.c (mode_db): added vsync_lines,
  vfront_lines, and vback_lines
- ubb-vga.h (struct mode): changed "line_cycles" from "int" to
  "uint16_t"
- ubb-vga.c (line): don't hard-code horizontal back porch
- ubb-vga.c (line): don't hard-code sum of horizontal back porch and
  hsync
- ubb-vga.c (hdelay): don't hard-code hsync
- ubb-vga.c (frame): don't hard-code vsync and the vertical porches
- ubb-vga.c (frame): don't hard-code hsync and horizontal back porch
This commit is contained in:
Werner Almesberger
2011-05-01 20:59:38 -03:00
parent aa2fc7101d
commit 4b59dbf062
2 changed files with 35 additions and 20 deletions

View File

@@ -27,8 +27,12 @@ struct mode {
const char *name; /* NULL for end of table */
int xres, yres;
int clkdiv; /* pixel clock = 336 MHz/(clkdiv+1) */
int line_cycles; /* 31.77 us for official VGA */
int hsync_end; /* 0.79+3.77 us for official VGA */
int vsync_lines; /* 2 lines, for official VGA */
int vfront_lines; /* 32 lines */
int vback_lines; /* 14 lines */
uint16_t hsync_cycles; /* 3.77 us */
uint16_t hback_cycles; /* 0.79 us */
uint16_t line_cycles; /* 31.77 us */
};
extern const struct mode *mode;