]> git.defcon.no Git - avrfbosd/commitdiff
Merge branch 'videodetect'
authorJon Langseth <jon.langseth@lilug.no>
Sun, 22 Jul 2012 11:51:58 +0000 (13:51 +0200)
committerJon Langseth <jon.langseth@lilug.no>
Sun, 22 Jul 2012 11:51:58 +0000 (13:51 +0200)
1  2 
syncgen/main.c

diff --cc syncgen/main.c
index 3fa6cea892f4c0d790f23942d1c6816ee30a2d2c,e67d582bd0b1a1f15259934e26d1604af55f6846..1dbfefb67913f324b1f547a93705c4c2b0f05923
@@@ -134,19 -128,22 +128,22 @@@ void vsync(uint8_t odd_even
  
  ISR (TIMER0_COMPA_vect) 
  {
-       if(line == 310) vsync(0);
-       else if(line == 622) vsync(1);
-       else
+       if(line == 310) vsync(0); // End of ODD fields, start vsync'ing
+       else if(line == 622) vsync(1); // End of EVEN, start vsync'ing
+       else // In frame. Generate a hsync pulse, then do some drawing :)
        {
                hsync();
-               int t_line = line;
+               int t_line = line; // Reducing line-count complexity by half ;)
                t_line = ( line > 312 ) ? line - 312 : line;
  
+               // Draw the logo-image centered vertically
                if ( t_line > 118 && t_line < 118 + (2*testimg_height) )
                {
 -                      _delay_us(12);
 +                      _delay_us(12.3);
                        asm_render_line();
  
+                       // Stretch the image vertically by repeating the same line twice
                        if( !stretch )
                        {
                                stretch = 1;