コード例 #1
0
ファイル: main.c プロジェクト: HEATHlabs/de0-storm-sdram
/* ---- Main function ---- */
int main(void)
{
    //int temp;
    unsigned int temp;
    unsigned char temp_string[9]="\0";

    io_disable_xint();
    // timer init
    //not usingSTME0_CNT  = 0;
    //not using  STME0_VAL  = 50000000; // threshold value for 1s ticks
    // not using STME0_CONF = (1<<2) | (1<<1) | (1<<0); // interrupt en, auto reset, timer enable
    // not using timer  VICVectAddr0 = (unsigned long)timer0_isr;
    //VICVectCntl0 = (1<<5) | 0; // enable and channel select = 0 (timer0)
    //VICIntEnable = (1<<0); // enable channel 0 (timer0)

//	ic_init ();
    //uart0_printf("ic_init complete\n\r");
    //io_enable_xint(); // enable IRQ ----still works
    //uart0_printf("io_enable_xint complete\n\r");

    // Intro
    uart0_printf("\r\n\r\nSTORM SoC Basic Configuration\r\n");
    uart0_printf("Interupt Demo program+IRQ test\r\n\r\n");

    print_irq() ;

    uart0_printf("Press any key!\r\n");
    uart0_printf("s = print IRQ status\r\n");
    uart0_printf("i = Software Int\r\n");
    uart0_printf("e = Enable all Ints\r\n");
    uart0_printf("d = Disable all Ints\r\n");
    // echo received char


    while(1) {
        temp = io_uart0_read_byte();


        if (temp != -1)
            io_uart0_send_byte(temp);
        if (temp == 's') {
            print_irq();
        }
        if (temp == 'i') {
            sw_int ();
        }
        if (temp == 'e') {
            enable_all_int ();
        }
        if (temp == 'd') {
            disable_all_int ();
        }
    }

}
コード例 #2
0
void print_statisic(void)
{
	print_time();
	print_hard_irq();
	print_irq();
	pm_debug_dump_ahb_glb_regs();
	if(is_print_wakeup){
		printk("###wake up form %s : %08x\n",  sleep_mode_str[sleep_mode],  sprd_irqs_sts[0]);
		printk("###wake up form %s : %08x\n",  sleep_mode_str[sleep_mode],  sprd_irqs_sts[1]);
	}
}
コード例 #3
0
ファイル: main.c プロジェクト: HEATHlabs/de0-storm-sdram
void disable_all_int() {
    IC_IRQ0_ENABLECLR = 0xFFFFFFFF;
    uart0_printf("Disabling all Interrupts\n\r");
    print_irq();
}
コード例 #4
0
ファイル: main.c プロジェクト: HEATHlabs/de0-storm-sdram
void enable_all_int() {
    IC_IRQ0_ENABLESET = 0xFFFFFFFF;
    uart0_printf("Enabling all Interrupts\n\r");
    print_irq();
}
コード例 #5
0
ファイル: main.c プロジェクト: HEATHlabs/de0-storm-sdram
void sw_int () {
    IC_INT_SOFTSET_0 = 0x1;
    uart0_printf("SW INTERUPT!\n\r");
    print_irq();
}