2013-03-21 05:42:31 -04:00
|
|
|
#include <stdio.h>
|
2013-03-23 19:46:23 -04:00
|
|
|
#include <stdlib.h>
|
2013-03-21 05:42:31 -04:00
|
|
|
|
|
|
|
#include <irq.h>
|
|
|
|
#include <uart.h>
|
2013-04-14 10:33:00 -04:00
|
|
|
#include <hw/csr.h>
|
|
|
|
#include <hw/flags.h>
|
2013-05-12 15:46:16 -04:00
|
|
|
#include <console.h>
|
2013-03-21 10:32:26 -04:00
|
|
|
|
2013-05-09 07:41:21 -04:00
|
|
|
#include "dvisampler0.h"
|
|
|
|
#include "dvisampler1.h"
|
2013-03-21 05:42:31 -04:00
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
2013-05-12 15:46:16 -04:00
|
|
|
int c;
|
|
|
|
|
2013-03-21 05:42:31 -04:00
|
|
|
irq_setmask(0);
|
|
|
|
irq_setie(1);
|
|
|
|
uart_init();
|
|
|
|
|
|
|
|
puts("Minimal video mixer software built "__DATE__" "__TIME__"\n");
|
|
|
|
|
2013-05-09 08:11:08 -04:00
|
|
|
timer0_reload_write(2*identifier_frequency_read());
|
|
|
|
timer0_en_write(1);
|
|
|
|
|
2013-05-09 04:52:43 -04:00
|
|
|
dvisampler0_init_video();
|
2013-05-10 15:03:55 -04:00
|
|
|
dvisampler1_init_video();
|
2013-05-06 03:56:49 -04:00
|
|
|
fb_enable_write(1);
|
2013-05-10 15:03:55 -04:00
|
|
|
fb_blender_f0_write(127);
|
|
|
|
fb_blender_f1_write(127);
|
|
|
|
while(1) {
|
|
|
|
dvisampler0_service();
|
|
|
|
dvisampler1_service();
|
2013-05-12 15:46:16 -04:00
|
|
|
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");
|
|
|
|
}
|
|
|
|
}
|
2013-05-10 15:03:55 -04:00
|
|
|
}
|
2013-03-21 05:42:31 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|