示例#1
0
文件: main.c 项目: haimiange/myboot
int main()
{
    char c;

    printf("\n------------MYBOOT LIUJIANG--------------\n");
    while(1) {
        printf("\n[w] write data to the nand flash\n");
        printf("[r] read the nand flash\n");
        printf("[e] erase the nand flash\n");
        printf("[g] get file, and write to nand flash 0 block\n");
        printf("[x] get file to SDRAM(0x52000000), run it\n\n");
        c = uart_getc();
        printf("%c\n\n",c);
        switch(c) {
        case 'w':
        case 'W':
            nand_write_test();
            break;
        case 'r':
        case 'R':
            nand_read_test();
            break;
        case 'e':
        case 'E':
            nand_erase_test();
            break;
        case 'g':
        case 'G':
            write_file();
            break;
        case 'x':
        case 'X':
            run_program();
            break;
        }
    }
    return 0;
}
示例#2
0
int main()
{
    char c;

    init_uart();
    printf("can update program with serial port\n\r");

    while (1)
    {
#if 1
        printf("[w] write the nand flash\n\r");
        printf("[r] read the nand flash\n\r");
        printf("[e] erase the nand flash\n\r");
        printf("[g] get file, and write to nand flash 0 block\n\r");
        printf("[x] get file to ddr(0x52000000), run it\n\r");
#else
        printf("[w] \n\r");
        printf("[r] \n\r");
        printf("[e] \n\r");
        printf("[g] \n\r");
        printf("[x] \n\r");
#endif
        do {
            c = getc();
            if (c == '\n' || c == '\r')
            {
                printf("\n\r");
            }
            else
            {
                putc(c);
            }
        } while (c == '\n' || c == '\r');

        switch (c)
        {
        case 'w':
        case 'W':
        {
            nand_write_test();
            break;
        }

        case 'r':
        case 'R':
        {
            nand_read_test();
            break;
        }

        case 'e':
        case 'E':
        {
            nand_erase_test();
            break;
        }

        case 'g':
        case 'G':
        {
            update_program();
            break;
        }

        case 'x':
        case 'X':
        {
            run_program();
            break;
        }

        }
    }

    return 0;
}
示例#3
0
文件: main.c 项目: bourne015/myCODES
int main()
{
	char c;
	
	init_uart();
	lcd_init();
	lcd_enable();

	ts_init();

	ts_calibrate();
	
	printf("can update program with serial port\n\r");

	while (1)
	{
		printf("[w] write the nand flash\n\r");
		printf("[r] read the nand flash\n\r");
		printf("[e] erase the nand flash\n\r");
		printf("[g] get file, and write to nand flash 0 block\n\r");
		printf("[x] get file to ddr(0x52000000), run it\n\r");
		printf("[t] test lcd\n\r");
		printf("[s] test touch screem\n\r");

		do {
			c = getc();
			if (c == '\n' || c == '\r')
			{
				printf("\n\r");
			}
			else
			{
				putc(c);
			}
		} while (c == '\n' || c == '\r');
		
		switch (c)
		{
			case 'w':
			case 'W':
			{
				nand_write_test();
				break;
			}

			case 'r':
			case 'R':
			{
				nand_read_test();
				break;
			}

			case 'e':
			case 'E':
			{
				nand_erase_test();
				break;
			}

			case 'g':
			case 'G':
			{
				update_program();
				break;
			}

			case 'x':
			case 'X':
			{
				run_program();
				break;
			}
			
			case 't':
			case 'T':
			{
				lcd_test();
				break;
			}
			case 's':
			case 'S':
			{
				ts_test();
				break;
			}
		}
	}
	
	return 0;
}