/* Called by vApplicationTickHook(), which is defined in main.c. */
void vFullDemoTickHookFunction( void )
{
	/* Call the periodic timer test, which tests the timer API functions that
	can be called from an ISR. */
	#if( configUSE_PREEMPTION != 0 )
	{
		/* Only created when preemption is used. */
		vTimerPeriodicISRTests();
	}
	#endif

	/* Call the periodic queue overwrite from ISR demo. */
	vQueueOverwritePeriodicISRDemo();

	/* Write to a queue that is in use as part of the queue set demo to
	demonstrate using queue sets from an ISR. */
	vQueueSetAccessQueueSetFromISR();

	/* Exercise event groups from interrupts. */
	vPeriodicEventGroupsProcessing();

	/* Exercise giving mutexes from an interrupt. */
	vInterruptSemaphorePeriodicTest();

	/* Exercise using task notifications from an interrupt. */
	xNotifyTaskFromISR();
}
Пример #2
0
void vApplicationTickHook( void )
{
#if( mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 0 )
    {
        /* The full demo includes a software timer demo/test that requires
        prodding periodically from the tick interrupt. */
        vTimerPeriodicISRTests();

        /* Call the periodic queue overwrite from ISR demo. */
        vQueueOverwritePeriodicISRDemo();

        /* Call the periodic event group from ISR demo. */
        vPeriodicEventGroupsProcessing();

        /* Call the code that uses a mutex from an ISR. */
        vInterruptSemaphorePeriodicTest();

        /* Use a queue set from an ISR. */
        vQueueSetAccessQueueSetFromISR();

        /* Use task notifications from an ISR. */
        xNotifyTaskFromISR();
    }
#endif
}
Пример #3
0
/* Called by vApplicationTickHook(), which is defined in main.c. */
void vFullDemoTickHookFunction( void )
{
TaskHandle_t xTimerTask;

	/* Call the periodic timer test, which tests the timer API functions that
	can be called from an ISR. */
	#if( configUSE_PREEMPTION != 0 )
	{
		/* Only created when preemption is used. */
		vTimerPeriodicISRTests();
	}
	#endif

	/* Call the periodic queue overwrite from ISR demo. */
	vQueueOverwritePeriodicISRDemo();

	/* Write to a queue that is in use as part of the queue set demo to
	demonstrate using queue sets from an ISR. */
	vQueueSetAccessQueueSetFromISR();
	vQueueSetPollingInterruptAccess();

	/* Exercise event groups from interrupts. */
	vPeriodicEventGroupsProcessing();

	/* Exercise giving mutexes from an interrupt. */
	vInterruptSemaphorePeriodicTest();

	/* Exercise using task notifications from an interrupt. */
	xNotifyTaskFromISR();

	/* For code coverage purposes. */
	xTimerTask = xTimerGetTimerDaemonTaskHandle();
	configASSERT( uxTaskPriorityGetFromISR( xTimerTask ) == configTIMER_TASK_PRIORITY );
}
void vFullDemoTickHook( void )
{
	/* Call the periodic queue overwrite from ISR test function. */
	vQueueOverwritePeriodicISRDemo();

	/* Call the periodic queue set ISR test function. */
	vQueueSetAccessQueueSetFromISR();
	
	/* Call the event group ISR tests. */
	vPeriodicEventGroupsProcessing();
}
Пример #5
0
void vApplicationTickHook( void )
{
    static xOLEDMessage xMessage = { "PASS" };
    static unsigned long ulTicksSinceLastDisplay = 0;
    portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;

    /* Called from every tick interrupt.  Have enough ticks passed to make it
    time to perform our health status check again? */
    ulTicksSinceLastDisplay++;
    if( ulTicksSinceLastDisplay >= mainCHECK_DELAY ) {
        ulTicksSinceLastDisplay = 0;

        /* Has an error been found in any task? */
        if( xAreGenericQueueTasksStillRunning() != pdTRUE ) {
            xMessage.pcMessage = "ERROR IN GEN Q";
        } else if( xIsCreateTaskStillRunning() != pdTRUE ) {
            xMessage.pcMessage = "ERROR IN CREATE";
        } else if( xAreIntegerMathsTaskStillRunning() != pdTRUE ) {
            xMessage.pcMessage = "ERROR IN MATH";
        } else if( xAreIntQueueTasksStillRunning() != pdTRUE ) {
            xMessage.pcMessage = "ERROR IN INT QUEUE";
        } else if( xAreBlockingQueuesStillRunning() != pdTRUE ) {
            xMessage.pcMessage = "ERROR IN BLOCK Q";
        } else if( xAreBlockTimeTestTasksStillRunning() != pdTRUE ) {
            xMessage.pcMessage = "ERROR IN BLOCK TIME";
        } else if( xAreSemaphoreTasksStillRunning() != pdTRUE ) {
            xMessage.pcMessage = "ERROR IN SEMAPHORE";
        } else if( xArePollingQueuesStillRunning() != pdTRUE ) {
            xMessage.pcMessage = "ERROR IN POLL Q";
        } else if( xAreQueuePeekTasksStillRunning() != pdTRUE ) {
            xMessage.pcMessage = "ERROR IN PEEK Q";
        } else if( xAreRecursiveMutexTasksStillRunning() != pdTRUE ) {
            xMessage.pcMessage = "ERROR IN REC MUTEX";
        } else if( xAreQueueSetTasksStillRunning() != pdPASS ) {
            xMessage.pcMessage = "ERROR IN Q SET";
        } else if( xAreEventGroupTasksStillRunning() != pdTRUE ) {
            xMessage.pcMessage = "ERROR IN EVNT GRP";
        }

        configASSERT( strcmp( ( const char * ) xMessage.pcMessage, "PASS" ) == 0 );

        /* Send the message to the OLED gatekeeper for display. */
        xHigherPriorityTaskWoken = pdFALSE;
        xQueueSendFromISR( xOLEDQueue, &xMessage, &xHigherPriorityTaskWoken );
    }

    /* Write to a queue that is in use as part of the queue set demo to
    demonstrate using queue sets from an ISR. */
    vQueueSetAccessQueueSetFromISR();

    /* Call the event group ISR tests. */
    vPeriodicEventGroupsProcessing();
}
Пример #6
0
/* Called by vApplicationTickHook(), which is defined in main.c. */
void vFullDemoTickHookFunction( void )
{
	/* Call the periodic timer test, which tests the timer API functions that
	can be called from an ISR. */
	vTimerPeriodicISRTests();

	/* Call the periodic queue overwrite from ISR demo. */
	vQueueOverwritePeriodicISRDemo();

	/* Write to a queue that is in use as part of the queue set demo to 
	demonstrate using queue sets from an ISR. */
	vQueueSetAccessQueueSetFromISR();
}
Пример #7
0
void vApplicationTickHook( void )
{
	/* This function will be called by each tick interrupt if
	configUSE_TICK_HOOK is set to 1 in FreeRTOSConfig.h.  User code can be
	added here, but the tick hook is called from an interrupt context, so
	code must not attempt to block, and only the interrupt safe FreeRTOS API
	functions can be used (those that end in FromISR()).  */

	#if ( mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 0 )
	{
		/* In this case the tick hook is used as part of the queue set test. */
		vQueueSetAccessQueueSetFromISR();
	}
	#endif /* mainCREATE_SIMPLE_BLINKY_DEMO_ONLY */
}
Пример #8
0
void vFullDemoTickHook( void )
{
	/* In this case the tick hook is used as part of the queue set test. */
	vQueueSetAccessQueueSetFromISR();
		
	/* Use task notifications from an interrupt. */
	xNotifyTaskFromISR();
		
	/* Use timers from an interrupt. */
	vTimerPeriodicISRTests();
	
	/* Use event groups from an interrupt. */
	vPeriodicEventGroupsProcessing();
	
	/* Use mutexes from interrupts. */
	vInterruptSemaphorePeriodicTest();
}
Пример #9
0
void vApplicationTickHook( void )
{
	/* This function will be called by each tick interrupt if
	configUSE_TICK_HOOK is set to 1 in FreeRTOSConfig.h.  User code can be
	added here, but the tick hook is called from an interrupt context, so
	code must not attempt to block, and only the interrupt safe FreeRTOS API
	functions can be used (those that end in FromISR()). */

	/* The semaphore and associated task are not created when the simple blinky
	demo is used. */
	#if mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 0
	{
		/* Write to a queue that is in use as part of the queue set demo to
		demonstrate using queue sets from an ISR. */
		vQueueSetAccessQueueSetFromISR();
	}
	#endif /* mainCREATE_SIMPLE_BLINKY_DEMO_ONLY */
}
void vApplicationTickHook( void )
{
	/* This function will be called by each tick interrupt if
	configUSE_TICK_HOOK is set to 1 in FreeRTOSConfig.h.  User code can be
	added here, but the tick hook is called from an interrupt context, so
	code must not attempt to block, and only the interrupt safe FreeRTOS API
	functions can be used (those that end in FromISR()). */

	#if mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 0
	{
		/* Write to a queue that is in use as part of the queue set demo to
		demonstrate using queue sets from an ISR. */
		vQueueSetAccessQueueSetFromISR();

		/* Test the ISR safe queue overwrite functions. */
		vQueueOverwritePeriodicISRDemo();
	}
	#endif /* mainCREATE_SIMPLE_BLINKY_DEMO_ONLY */
}
Пример #11
0
void vFullDemoTickHook( void )
{
	/* Call the periodic queue overwrite from ISR test function. */
	vQueueOverwritePeriodicISRDemo();

	/* Call the periodic queue set ISR test function. */
	vQueueSetAccessQueueSetFromISR();
	
	/* Call the event group ISR tests. */
	vPeriodicEventGroupsProcessing();
	
	/* Exercise task notifications from interrupts. */
	xNotifyTaskFromISR();
	
	/* Use mutexes from interrupts. */
	vInterruptSemaphorePeriodicTest();
	
	/* Use timers from an interrupt. */
	vTimerPeriodicISRTests();
}
Пример #12
0
void vApplicationTickHook( void )
{
	/* This function will be called by each tick interrupt if
	configUSE_TICK_HOOK is set to 1 in FreeRTOSConfig.h.  User code can be
	added here, but the tick hook is called from an interrupt context, so
	code must not attempt to block, and only the interrupt safe FreeRTOS API
	functions can be used (those that end in FromISR()).  The code in this
	tick hook implementation is for demonstration only - it has no real
	purpose.  It just gives a semaphore every 50ms.  The semaphore unblocks a
	task that then toggles an LED.  Additionally, the call to
	vQueueSetAccessQueueSetFromISR() is part of the "standard demo tasks"
	functionality. */

	/* The semaphore and associated task are not created when the simple blinky
	demo is used. */
	#if mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 0
	{
	static unsigned long ulLastGiveTime = 0UL;
	const unsigned long ulRate = 50UL / portTICK_PERIOD_MS;
	extern SemaphoreHandle_t xLEDSemaphore;

		configASSERT( xLEDSemaphore );

		if( ( xTaskGetTickCountFromISR() - ulLastGiveTime ) > ulRate )
		{
			/* The second parameter is normally used to determine if a context
			switch should be performed or not.  In this case the function is
			being performed from the tick hook, so the scheduler will make that
			assessment before returning to a task anyway - so the parameter is
			not needed and is just set to NULL. */
			xSemaphoreGiveFromISR( xLEDSemaphore, NULL );
			ulLastGiveTime += ulRate;
		}

		/* Write to a queue that is in use as part of the queue set demo to
		demonstrate using queue sets from an ISR. */
		vQueueSetAccessQueueSetFromISR();
	}
	#endif /* mainCREATE_SIMPLE_BLINKY_DEMO_ONLY */
}
Пример #13
0
void vApplicationTickHook( void )
{
static xOLEDMessage xMessage = { "PASS" };
static unsigned long ulTicksSinceLastDisplay = 0;
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;

	/* Called from every tick interrupt.  Have enough ticks passed to make it
	time to perform our health status check again? */
	ulTicksSinceLastDisplay++;
	if( ulTicksSinceLastDisplay >= mainCHECK_DELAY )
	{
		ulTicksSinceLastDisplay = 0;

		/* Has an error been found in any task? */
		if( xAreGenericQueueTasksStillRunning() != pdTRUE )
		{
			xMessage.pcMessage = "ERROR IN GEN Q";
		}
		else if( xAreQueuePeekTasksStillRunning() != pdTRUE )
		{
			xMessage.pcMessage = "ERROR IN PEEK Q";
		}
		else if( xAreBlockingQueuesStillRunning() != pdTRUE )
		{
			xMessage.pcMessage = "ERROR IN BLOCK Q";
		}
		else if( xAreBlockTimeTestTasksStillRunning() != pdTRUE )
		{
			xMessage.pcMessage = "ERROR IN BLOCK TIME";
		}
	    else if( xAreSemaphoreTasksStillRunning() != pdTRUE )
	    {
	        xMessage.pcMessage = "ERROR IN SEMAPHORE";
	    }
	    else if( xArePollingQueuesStillRunning() != pdTRUE )
	    {
	        xMessage.pcMessage = "ERROR IN POLL Q";
	    }
	    else if( xIsCreateTaskStillRunning() != pdTRUE )
	    {
	        xMessage.pcMessage = "ERROR IN CREATE";
	    }
	    else if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
	    {
	        xMessage.pcMessage = "ERROR IN MATH";
	    }
	    else if( xAreRecursiveMutexTasksStillRunning() != pdTRUE )
	    {
	    	xMessage.pcMessage = "ERROR IN REC MUTEX";
	    }
		else if( ulIdleError != pdFALSE )
		{
			xMessage.pcMessage = "ERROR IN HOOK";
		}
		else if( xAreIntQueueTasksStillRunning() != pdTRUE )
		{
			xMessage.pcMessage = "ERROR IN INT QUEUE";
		}
		else if( xAreQueueSetTasksStillRunning() != pdTRUE )
		{
        	xMessage.pcMessage = "ERROR IN QUEUE SET";
		}

		/* Send the message to the OLED gatekeeper for display. */
		xHigherPriorityTaskWoken = pdFALSE;
		xQueueSendFromISR( xOLEDQueue, &xMessage, &xHigherPriorityTaskWoken );
	}

	/* Exercise the queue sets from an ISR. */
    vQueueSetAccessQueueSetFromISR();
}