Example #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;
}
Example #2
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;
}
Example #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);
	/* 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;
}
Example #4
0
File: main.c Project: wanborj/PSEFM
int main(void)
{
    init_led();
    init_rs232();
    enable_rs232_interrupts();
    enable_rs232();

    //vTaskCompleteInitialise();
    vAppInitialise();
    vSemaphoreInitialise();
    vParameterInitialise(); 
    vInitialiseEventLists(NUMBEROFEVENTS);


    xTaskCreate( vR_Servant, "R-Servant", SERVANT_STACK_SIZE, (void *)&pvParameters[NUMBEROFSERVANT-1],tskIDLE_PRIORITY + 1, &xTaskOfHandle[NUMBEROFSERVANT-1]);

    portBASE_TYPE i,j;
    
    for( i = 0; i < NUMBEROFTASK; ++i )
    {
        xTaskCreate( vSensor, "Sensor", SERVANT_STACK_SIZE, (void *)&pvParameters[i*(xConcurrents + 1)],NUMBEROFTASK - i + 1, &xTaskOfHandle[i*(xConcurrents + 1)]);
        for( j = 1; j <= xConcurrents; ++j )
        {
            /* j is the number of concurrent servants in one task*/
            xTaskCreate( vServant, "servant", SERVANT_STACK_SIZE, (void *)&pvParameters[i*(xConcurrents + 1) + j],NUMBEROFTASK - i + 1, &xTaskOfHandle[i*(xConcurrents + 1) + j]);
        }
    }


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

    return 0;
}
Example #5
0
int main()
{
	init_led();

	init_button();
	enable_button_interrupts();

	init_rs232();
	enable_rs232_interrupts();
	enable_rs232();

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


    // queue_str_task1 = queue_str_task2 = serial_readwrite_task > rs232_xmit_msg_task
    // 
    // 
    // 
    // queue_str_task1 ->
    // queue_str_task2 ->
    //                                                               -> [serial_str_queue] -> rs232_xmit_msg_task
    // isr -> [serial_rx_queue] -> serial_readwrite_task:receive_byte
    // 
    // ---------->
    //
    // rs232_xmit_msg_task:send_byte -> <serial_tx_wait_sem> -> isr(complete)
    // 

	/* Create tasks to queue a string to be written to the RS232 port. */
	xTaskCreate(queue_str_task1,
	            (signed portCHAR *) "Serial Write 1",
	            512 /* stack size */, NULL,
	            tskIDLE_PRIORITY + 10, NULL );
	xTaskCreate(queue_str_task2,
	            (signed portCHAR *) "Serial Write 2",
	            512 /* stack size */, NULL, 
                tskIDLE_PRIORITY + 10, NULL);

	/* Create a task to write messages from the queue to the RS232 port. */
	xTaskCreate(rs232_xmit_msg_task,
	            (signed portCHAR *) "Serial Xmit Str",
	            512 /* stack size */, NULL, 
                tskIDLE_PRIORITY + 2, NULL);

	/* Create a task to receive characters from the RS232 port and echo
	 * them back to the RS232 port. */
	xTaskCreate(serial_readwrite_task,
	            (signed portCHAR *) "Serial Read/Write",
	            512 /* stack size */, NULL,
	            tskIDLE_PRIORITY + 10, NULL);

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

	return 0;
}
Example #6
0
int main(void)
{
    init_led();

    init_button();
    enable_button_interrupts();

    init_rs232();
    enable_rs232_interrupts();
    enable_rs232();

    /* Create the queue to hold messages to be written to the RS232. */
    serial_str_queue = xQueueCreate( 10, sizeof( serial_str_msg ) );
    vSemaphoreCreateBinary(serial_tx_wait_sem);
    serial_rx_queue = xQueueCreate( 1, sizeof( serial_ch_msg ) );

    /* Create a task to flash the LED. */
    xTaskCreate( led_flash_task, ( signed portCHAR * ) "LED Flash", 512 /* stack size */, NULL, tskIDLE_PRIORITY + 5, NULL );

    /* Create tasks to queue a string to be written to the RS232 port. */
    xTaskCreate( queue_str_task1, ( signed portCHAR * ) "Serial Write 1", 512 /* stack size */, NULL, tskIDLE_PRIORITY + 10, NULL );
    xTaskCreate( queue_str_task2, ( signed portCHAR * ) "Serial Write 2", 512 /* stack size */, NULL, tskIDLE_PRIORITY + 10, NULL );

    /* Create a task to write messages from the queue to the RS232 port. */
    xTaskCreate(rs232_xmit_msg_task, ( signed portCHAR * ) "Serial Xmit Str", 512 /* stack size */, NULL, tskIDLE_PRIORITY + 2, NULL );

    /* Create a task to receive characters from the RS232 port and echo them back to the RS232 port. */
    xTaskCreate(serial_readwrite_task, ( signed portCHAR * ) "Serial Read/Write", 512 /* stack size */, NULL, tskIDLE_PRIORITY + 10, NULL );

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

    return 0;
}
Example #7
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;
}
Example #8
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(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;
}
Example #9
0
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;
}