fjkfwz / arduino-tvout

Automatically exported from code.google.com/p/arduino-tvout
0 stars 0 forks source link

Improvement Request: add VBI hook capability #5

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I'd like TVout to have the ability to call a hook during the vertical blanking 
interval.  I am using this capability to communicate with an I2C device.

Example implementation

TVout.h:
// declaration of set_vbi_hook function
void set_vbi_hook(void (*func)());

TVout.cpp:
// implementation of set_vbi_hook
void TVout::set_vbi_hook(void (*func)()) {
  vbi_hook = func;
}

video_gen.h:
// extern declaration of vbi_hook function pointer
extern void (*vbi_hook)();

video_gen.cpp:
// declaration of vbi_hook function pointer and invocation of function at 
beginning of VBI
void (*vbi_hook)();

// in active_line()...
    if ((display.scanLine + 1) == display.stop_render) {
        line_handler = &blank_line;
        if (vbi_hook != 0) {
          vbi_hook();
        }
    }

Let me know if you have any questions; this should be pretty self explanatory 
for you.

Original issue reported on code.google.com by nootropi...@gmail.com on 15 Oct 2010 at 9:02

GoogleCodeExporter commented 8 years ago

Original comment by mdmetzle@gmail.com on 15 Oct 2010 at 9:59

GoogleCodeExporter commented 8 years ago

Original comment by mdmetzle@gmail.com on 15 Oct 2010 at 11:23

GoogleCodeExporter commented 8 years ago

Original comment by mdmetzle@gmail.com on 17 Oct 2010 at 4:29

GoogleCodeExporter commented 8 years ago

Original comment by mdmetzle@gmail.com on 21 Oct 2010 at 2:23