示例#1
0
int main()
{
	init_rs232();
	enable_rs232_interrupts();
	enable_rs232();
	
	fs_init();
	fio_init();
	
	register_romfs("romfs", &_sromfs);
	pwd_hash=hash_djb2((const uint8_t *)&"",-1); // init pwd to /romfs/
	/* Create the queue used by the serial task.  Messages for write to
	 * the RS232. */
	vSemaphoreCreateBinary(serial_tx_wait_sem);
	/* Add for serial input 
	 * Reference: www.freertos.org/a00116.html */
	serial_rx_queue = xQueueCreate(1, sizeof(char));

	/* Create a task to output text read from romfs. */
	xTaskCreate(command_prompt,
	            (signed portCHAR *) "CLI",
	            512 /* stack size */, NULL, tskIDLE_PRIORITY + 2, NULL);

#if 0
	/* Create a task to record system log. */
	xTaskCreate(system_logger,
	            (signed portCHAR *) "Logger",
	            1024 /* stack size */, NULL, tskIDLE_PRIORITY + 1, NULL);
#endif

	/* Start running the tasks. */
	vTaskStartScheduler();

	return 0;
}
示例#2
0
文件: main.c 项目: tkloong/freertos
int main()
{
	init_rs232();
	enable_rs232_interrupts();
	enable_rs232();
	
	fs_init();
	fio_init();
	
	register_romfs("romfs", &_sromfs);
	
	/* Create the queue used by the serial task.  Messages for write to
	 * the RS232. */
	vSemaphoreCreateBinary(serial_tx_wait_sem);
	/* Add for serial input 
	 * Reference: www.freertos.org/a00116.html */
	serial_rx_queue = xQueueCreate(1, sizeof(char));

	/* Create a task to output text read from romfs. */
	xTaskCreate(command_prompt,
	            (signed portCHAR *) "Command Prompt",
				512 /* stack size */, NULL, configMAX_PRIORITIES, NULL);

	xTaskCreate(semihost_sysinfo,
				(signed portCHAR *) "Semihost Sysinfo",
	            512 /* stack size */, NULL, tskIDLE_PRIORITY + 2, NULL);
	/* Start running the tasks. */
	vTaskStartScheduler();

	return 0;
}
示例#3
0
int main()
{
	init_rs232();
	enable_rs232_interrupts();
	enable_rs232();
	
	fs_init();
	fio_init();
	
	register_romfs("romfs", &_sromfs);
	
	/* Create the queue used by the serial task.  Messages for write to
	 * the RS232. */
	vSemaphoreCreateBinary(serial_tx_wait_sem);
	serial_rx_queue = xQueueCreate(1, sizeof(ch));

	/*Create a task handle reference to
	http://www.freertos.org/a00128.html */
	xTaskHandle xHandle;

	xTaskCreate(shell_task,
	            (signed portCHAR *) "Implement shell",
	            512 /* stack size */, NULL, tskIDLE_PRIORITY + 2, NULL);
	
	/* Start running the tasks. */
	vTaskStartScheduler();

	return 0;
}
示例#4
0
int main()
{
	//uint8_t testint=12;

	init_rs232();
	enable_rs232_interrupts();
	enable_rs232();
	
	fs_init();
	fio_init();
	
	register_romfs("romfs", &_sromfs);
	
	/* Create the queue used by the serial task.  Messages for write to
	 * the RS232. */
	vSemaphoreCreateBinary(serial_tx_wait_sem);
	/* Add for serial input 
	 * Reference: www.freertos.org/a00116.html */
	serial_rx_queue = xQueueCreate(1, sizeof(char));

	/* Test zone */
	// testint =  fs_open("romfs/test.txt", 0, O_RDONLY); /*fs_open is working if we input correct name




	// fio_printf(1, "\rWelcome to FreeRTOS Shell %d  \r\n",testint);
	// fio_printf(1, "\rWelcome to FreeRTOS Shell\r\n");




	/* Create a task to output text read from romfs. */
	xTaskCreate(command_prompt,
	            (signed portCHAR *) "CLI",
	            512 /* stack size */, NULL, tskIDLE_PRIORITY + 2, NULL);

#if 0
	/* Create a task to record system log. */
	xTaskCreate(system_logger,
	            (signed portCHAR *) "Logger",
	            1024 /* stack size */, NULL, tskIDLE_PRIORITY + 1, NULL);
#endif

	/* Start running the tasks. */
	vTaskStartScheduler();

	return 0;
}
示例#5
0
文件: fio.c 项目: a5216652166/ddd
int main(int argc, char **argv)
{
    if (argc < 2)
    {
        printf("argc < 2\n");
        return 0;
    }

    if (0 != parse_config(argv[1]))
        return 0;

    //fio_register_handler(FIO_CBF_SINGLE_THREAD, single_mode_handle);
    //fio_register_handler(IPPROTO_UDP, handle_audp);
    switch (sysconfig.single_thread)
    {
        case FIO_MODE_1_SND_OR_RCV /*2*/:
            fio_register_handler(T_FIO_PKT_INTD, handle_dns_resp);
            break;
        case FIO_MODE_2CARDS /*3*/:
            fio_register_handler(T_FIO_PKT_INTD, handle_udps_2cards);
            break;
        case FIO_MODE_N_BRG_OUT /*4*/:
            fio_register_handler(T_FIO_PKT_INTD, handle_udps);
            break;
        default:
            fio_register_handler(T_FIO_PKT_INTD, handle_udps_in);
            break;
    }

    if (0 != fio_init() || 0 != fio_start())
        return 0;
	signal(SIGINT, fio_sigint_h);
    fio_start_statistics();

    fio_wait();
    fio_shutdown();

    return 0;
}
示例#6
0
文件: main.c 项目: kvzhao/freertos
int main()
{
	init_rs232();
	enable_rs232_interrupts();
	enable_rs232();

	fs_init();
	fio_init();

	register_romfs("romfs", &_sromfs);

	/* Create the queue used by the serial task.  Messages for write to
	 * the RS232. */
	vSemaphoreCreateBinary(serial_tx_wait_sem);
	serial_rx_queue = xQueueCreate(1, sizeof(serial_ch_msg));

#ifdef UNIT_TEST
    xTaskCreate(unit_test_task,
                (signed portCHAR *) "Unit Test",
                256, // stack size
                NULL,
                tskIDLE_PRIORITY + 2,
                NULL);
#endif

    xTaskCreate(shell_task,
                (signed portCHAR*) "Shell",
                512, /* Stack Size*/
                NULL,
                tskIDLE_PRIORITY + 1,
                NULL);

	/* Start running the tasks. */
	vTaskStartScheduler();

	return 0;
}
示例#7
0
文件: main.c 项目: LanKuDot/freertos
int main()
{
	init_rs232();
	enable_rs232_interrupts();
	enable_rs232();
	
	fs_init();
	fio_init();
	
	/* Create the queue used by the serial task.  Messages for write to
	 * the RS232. */
	serial_rx_queue = xQueueCreate( 1, sizeof(char) );

	vSemaphoreCreateBinary(serial_tx_wait_sem);

	/* Create a task that run the sell environment. */
	xTaskCreate( shellEnv, (signed portCHAR *)"Shell",
			512, NULL, tskIDLE_PRIORITY + 5, NULL );

	/* Start running the tasks. */
	vTaskStartScheduler();

	return 0;
}