Exemplo n.º 1
0
short main( void )
{
	/* Initialise hardware and utilities. */
	vParTestInitialise();
	vPrintInitialise();
	
	/* CREATE ALL THE DEMO APPLICATION TASKS. */
	prvStartMathTasks();
	vStartComTestTasks( mainCOM_TEST_PRIORITY, serCOM1, ser115200 );
	vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );
	vStartBlockingQueueTasks( mainQUEUE_BLOCK_PRIORITY );
	vCreateBlockTimeTasks();
	vStartGenericQueueTasks( mainGENERIC_QUEUE_PRIORITY );
	vStartSemaphoreTasks( mainSEMAPHORE_TASK_PRIORITY );
	vStartDynamicPriorityTasks();
	vStartMultiEventTasks();
	vStartQueuePeekTasks();
	vStartCountingSemaphoreTasks();
	vStartAltGenericQueueTasks( mainGENERIC_QUEUE_PRIORITY );
	vCreateAltBlockTimeTasks();
	vStartAltBlockingQueueTasks( mainQUEUE_BLOCK_PRIORITY );	
	vStartAltPolledQueueTasks( mainQUEUE_POLL_PRIORITY );
	vStartRecursiveMutexTasks();
		
	/* Create the "Print" task as described at the top of the file. */
	xTaskCreate( vErrorChecks, "Print", mainPRINT_STACK_SIZE, NULL, mainPRINT_TASK_PRIORITY, NULL );

	/* This task has to be created last as it keeps account of the number of tasks
	it expects to see running. */
	vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY );

	/* Create the co-routines that flash the LED's. */
	vStartFlashCoRoutines( mainNUM_FLASH_CO_ROUTINES );

	/* Create the co-routines that communicate with the tick hook. */
	vStartHookCoRoutines();

	/* Set the scheduler running.  This function will not return unless a task
	calls vTaskEndScheduler(). */
	vTaskStartScheduler();

	return 1;
}
Exemplo n.º 2
0
/*---------------------------------------------------------------------------
 * main()
 *---------------------------------------------------------------------------*/
void main( void )
{
	InitIrqLevels();		/* Initialize interrupts */
	__set_il( 7 );			/* Allow all levels      */

	prvSetupHardware();

	#if WATCHDOG == WTC_IN_TASK
		vStartWatchdogTask( WTC_TASK_PRIORITY );
	#endif

	/* Start the standard demo application tasks. */
	#if ( INCLUDE_StartLEDFlashTasks == 1 )
		vStartLEDFlashTasks( mainLED_TASK_PRIORITY );
	#endif

	#if ( INCLUDE_StartIntegerMathTasks == 1 )
		vStartIntegerMathTasks( tskIDLE_PRIORITY );
	#endif

	#if ( INCLUDE_AltStartComTestTasks == 1 )
		vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED - 1 );
	#endif

	#if ( INCLUDE_StartPolledQueueTasks == 1 )
		vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );
	#endif

	#if ( INCLUDE_StartSemaphoreTasks == 1 )
		vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );
	#endif

	#if ( INCLUDE_StartBlockingQueueTasks == 1 )
		vStartBlockingQueueTasks( mainQUEUE_BLOCK_PRIORITY );
	#endif

	#if ( INCLUDE_StartDynamicPriorityTasks == 1 )
		vStartDynamicPriorityTasks();
	#endif

	#if ( INCLUDE_StartMathTasks == 1 )
		vStartMathTasks( tskIDLE_PRIORITY );
	#endif

	#if ( INCLUDE_StartFlashCoRoutines == 1 )
		vStartFlashCoRoutines( ledNUMBER_OF_LEDS );
	#endif

	#if ( INCLUDE_StartHookCoRoutines == 1 )
		vStartHookCoRoutines();
	#endif

	#if ( INCLUDE_StartGenericQueueTasks == 1 )
		vStartGenericQueueTasks( mainGENERIC_QUEUE_PRIORITY );
	#endif

	#if ( INCLUDE_StartQueuePeekTasks == 1 )
		vStartQueuePeekTasks();
	#endif

	#if ( INCLUDE_CreateBlockTimeTasks == 1 )
		vCreateBlockTimeTasks();
	#endif

	#if ( INCLUDE_CreateSuicidalTasks == 1 )
		vCreateSuicidalTasks( mainDEATH_PRIORITY );
	#endif

	#if ( INCLUDE_TraceListTasks == 1 )
		vTraceListTasks( TASK_UTILITY_PRIORITY );
	#endif

	/* Start the 'Check' task which is defined in this file. */
	xTaskCreate( vErrorChecks, (signed portCHAR *) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );

	vTaskStartScheduler();

	/* Should not reach here */
	while( 1 )
	{
		__asm( " NOP " );	/*  //  */
	}
}