software/videomixer: framebuffer enable/disable
authorSebastien Bourdeauducq <sebastien@milkymist.org>
Sun, 12 May 2013 19:46:16 +0000 (21:46 +0200)
committerSebastien Bourdeauducq <sebastien@milkymist.org>
Sun, 12 May 2013 19:46:16 +0000 (21:46 +0200)
software/videomixer/main.c

index 10383e39166f061ccb5cbad13b231f7c5e4f14f8..de3c97919e823550d1d4972a0d8e2edb3f4c1414 100644 (file)
@@ -5,12 +5,15 @@
 #include <uart.h>
 #include <hw/csr.h>
 #include <hw/flags.h>
+#include <console.h>
 
 #include "dvisampler0.h"
 #include "dvisampler1.h"
 
 int main(void)
 {
+       int c;
+
        irq_setmask(0);
        irq_setie(1);
        uart_init();
@@ -28,6 +31,16 @@ int main(void)
        while(1) {
                dvisampler0_service();
                dvisampler1_service();
+               if(readchar_nonblock()) {
+                       c = readchar();
+                       if(c == '1') {
+                               fb_enable_write(1);
+                               printf("Framebuffer is ON\n");
+                       } else if(c == '0') {
+                               fb_enable_write(0);
+                               printf("Framebuffer is OFF\n");
+                       }
+               }
        }
        
        return 0;