int main(void) { irq_setmask(0); irq_setie(1); uart_init(); #ifdef CSR_HDMI_OUT0_I2C_W_ADDR hdmi_out0_i2c_init(); #endif #ifdef CSR_HDMI_OUT1_I2C_W_ADDR hdmi_out1_i2c_init(); #endif puts("\r\nHDMI2USB firmware http://timvideos.us/"); print_version(); fx2_reset_out_write(1); config_init(); time_init(); processor_init(); processor_start(config_get(CONFIG_KEY_RESOLUTION)); // Set HDMI Output 0 to be pattern #ifdef CSR_HDMI_OUT0_BASE processor_set_hdmi_out0_source(VIDEO_IN_PATTERN); #endif // Set HDMI Output 1 to be pattern #ifdef CSR_HDMI_OUT1_BASE processor_set_hdmi_out1_source(VIDEO_IN_PATTERN); #endif processor_update(); // Reboot the FX2 chip into HDMI2USB mode #ifdef CSR_FX2_RESET_OUT_ADDR //fx2_init(); #endif // Set Encoder to be pattern #ifdef ENCODER_BASE processor_set_encoder_source(VIDEO_IN_PATTERN); encoder_enable(1); processor_update(); #endif ci_prompt(); while(1) { processor_service(); ci_service(); #ifdef CSR_FX2_RESET_OUT_ADDR //fx2_service(true); #endif /* XXX FIX DDR conflict between DMA and L2 cache */ #if 0 pattern_service(); #endif } return 0; }
static void video_matrix_connect(int source, int sink) { if(source >= 0 && source <= VIDEO_IN_PATTERN) { if(sink >= 0 && sink <= VIDEO_OUT_HDMI_OUT1) { printf("Connecting %s to output%d\r\n", processor_get_source_name(source), sink); if(sink == VIDEO_OUT_HDMI_OUT0) #ifdef CSR_HDMI_OUT0_BASE processor_set_hdmi_out0_source(source); #else printf("hdmi_out0 is missing.\r\n"); #endif else if(sink == VIDEO_OUT_HDMI_OUT1) #ifdef CSR_HDMI_OUT1_BASE processor_set_hdmi_out1_source(source); #else printf("hdmi_out1 is missing.\r\n"); #endif processor_update(); }