mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-19 21:11:57 -04:00
Add event groups demo to Zynq demo.
Add C implementations of some standard library functions to the Zynq demo to prevent the GCC libraries (which use floating point registers as scratch registers) being linked in.
This commit is contained in:
parent
3eb212f454
commit
0cc51d99a7
|
@ -116,8 +116,8 @@
|
||||||
#define configUSE_IDLE_HOOK 1
|
#define configUSE_IDLE_HOOK 1
|
||||||
#define configUSE_TICK_HOOK 1
|
#define configUSE_TICK_HOOK 1
|
||||||
#define configMAX_PRIORITIES ( 7 )
|
#define configMAX_PRIORITIES ( 7 )
|
||||||
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 160 )
|
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 200 )
|
||||||
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 51200 ) )
|
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 65536 ) )
|
||||||
#define configMAX_TASK_NAME_LEN ( 10 )
|
#define configMAX_TASK_NAME_LEN ( 10 )
|
||||||
#define configUSE_TRACE_FACILITY 1
|
#define configUSE_TRACE_FACILITY 1
|
||||||
#define configUSE_16_BIT_TICKS 0
|
#define configUSE_16_BIT_TICKS 0
|
||||||
|
|
|
@ -143,6 +143,7 @@
|
||||||
#include "TimerDemo.h"
|
#include "TimerDemo.h"
|
||||||
#include "QueueOverwrite.h"
|
#include "QueueOverwrite.h"
|
||||||
#include "IntQueue.h"
|
#include "IntQueue.h"
|
||||||
|
#include "EventGroupsDemo.h"
|
||||||
|
|
||||||
/* Priorities for the demo application tasks. */
|
/* Priorities for the demo application tasks. */
|
||||||
#define mainSEM_TEST_PRIORITY ( tskIDLE_PRIORITY + 1UL )
|
#define mainSEM_TEST_PRIORITY ( tskIDLE_PRIORITY + 1UL )
|
||||||
|
@ -243,6 +244,7 @@ void main_full( void )
|
||||||
vStartMathTasks( mainFLOP_TASK_PRIORITY );
|
vStartMathTasks( mainFLOP_TASK_PRIORITY );
|
||||||
vStartTimerDemoTask( mainTIMER_TEST_PERIOD );
|
vStartTimerDemoTask( mainTIMER_TEST_PERIOD );
|
||||||
vStartQueueOverwriteTask( mainQUEUE_OVERWRITE_PRIORITY );
|
vStartQueueOverwriteTask( mainQUEUE_OVERWRITE_PRIORITY );
|
||||||
|
vStartEventGroupTasks();
|
||||||
|
|
||||||
/* Start the tasks that implements the command console on the UART, as
|
/* Start the tasks that implements the command console on the UART, as
|
||||||
described above. */
|
described above. */
|
||||||
|
@ -366,6 +368,11 @@ unsigned long ulErrorFound = pdFALSE;
|
||||||
ulErrorFound = pdTRUE;
|
ulErrorFound = pdTRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( xAreEventGroupTasksStillRunning() != pdPASS )
|
||||||
|
{
|
||||||
|
ulErrorFound = pdTRUE;
|
||||||
|
}
|
||||||
|
|
||||||
/* Check that the register test 1 task is still running. */
|
/* Check that the register test 1 task is still running. */
|
||||||
if( ulLastRegTest1Value == ulRegTest1LoopCounter )
|
if( ulLastRegTest1Value == ulRegTest1LoopCounter )
|
||||||
{
|
{
|
||||||
|
|
|
@ -74,12 +74,15 @@
|
||||||
* This file implements the code that is not demo specific, including the
|
* This file implements the code that is not demo specific, including the
|
||||||
* hardware setup and FreeRTOS hook functions.
|
* hardware setup and FreeRTOS hook functions.
|
||||||
*
|
*
|
||||||
* NOTE: The full demo includes a test that checks the floating point context
|
* !!! IMPORTANT NOTE !!!
|
||||||
* is maintained correctly across task switches. The standard GCC libraries can
|
* The GCC libraries that ship with the Xilinx SDK make use of the floating
|
||||||
* use floating point registers and made this test fail (unless the tasks that
|
* point registers. To avoid this causing corruption it is necessary to avoid
|
||||||
* use the library are given a floating point context as described on the
|
* their use. For this reason main.c contains very basic C implementations of
|
||||||
* documentation page for this demo). printf-stdarg.c is included in this
|
* the standard C library functions memset(), memcpy() and memcmp(), which are
|
||||||
* project to prevent the standard GCC libraries being linked into the project.
|
* are used by FreeRTOS itself. Defining these functions in the project
|
||||||
|
* prevents the linker pulling them in from the library. Any other standard C
|
||||||
|
* library functions that are used by the application must likewise be defined
|
||||||
|
* in C.
|
||||||
*
|
*
|
||||||
* ENSURE TO READ THE DOCUMENTATION PAGE FOR THIS PORT AND DEMO APPLICATION ON
|
* ENSURE TO READ THE DOCUMENTATION PAGE FOR THIS PORT AND DEMO APPLICATION ON
|
||||||
* THE http://www.FreeRTOS.org WEB SITE FOR FULL INFORMATION ON USING THIS DEMO
|
* THE http://www.FreeRTOS.org WEB SITE FOR FULL INFORMATION ON USING THIS DEMO
|
||||||
|
@ -99,6 +102,7 @@
|
||||||
#include "partest.h"
|
#include "partest.h"
|
||||||
#include "TimerDemo.h"
|
#include "TimerDemo.h"
|
||||||
#include "QueueOverwrite.h"
|
#include "QueueOverwrite.h"
|
||||||
|
#include "EventGroupsDemo.h"
|
||||||
|
|
||||||
/* Xilinx includes. */
|
/* Xilinx includes. */
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
|
@ -109,7 +113,7 @@
|
||||||
|
|
||||||
/* Set mainCREATE_SIMPLE_BLINKY_DEMO_ONLY to one to run the simple blinky demo,
|
/* Set mainCREATE_SIMPLE_BLINKY_DEMO_ONLY to one to run the simple blinky demo,
|
||||||
or 0 to run the more comprehensive test and demo application. */
|
or 0 to run the more comprehensive test and demo application. */
|
||||||
#define mainCREATE_SIMPLE_BLINKY_DEMO_ONLY 1
|
#define mainCREATE_SIMPLE_BLINKY_DEMO_ONLY 0
|
||||||
|
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
@ -158,7 +162,7 @@ int main( void )
|
||||||
|
|
||||||
/* The mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting is described at the top
|
/* The mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting is described at the top
|
||||||
of this file. */
|
of this file. */
|
||||||
#if mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 1
|
#if( mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 1 )
|
||||||
{
|
{
|
||||||
main_blinky();
|
main_blinky();
|
||||||
}
|
}
|
||||||
|
@ -281,6 +285,59 @@ void vApplicationTickHook( void )
|
||||||
|
|
||||||
/* Call the periodic queue overwrite from ISR demo. */
|
/* Call the periodic queue overwrite from ISR demo. */
|
||||||
vQueueOverwritePeriodicISRDemo();
|
vQueueOverwritePeriodicISRDemo();
|
||||||
|
|
||||||
|
/* Call the periodic event group from ISR demo. */
|
||||||
|
vPeriodicEventGroupsProcessing();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
void *memcpy( void *pvDest, const void *pvSource, size_t ulBytes )
|
||||||
|
{
|
||||||
|
unsigned char *pcDest = ( unsigned char * ) pvDest, *pcSource = ( unsigned char * ) pvSource;
|
||||||
|
size_t x;
|
||||||
|
|
||||||
|
for( x = 0; x < ulBytes; x++ )
|
||||||
|
{
|
||||||
|
*pcDest = *pcSource;
|
||||||
|
pcDest++;
|
||||||
|
pcSource++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return pvDest;
|
||||||
|
}
|
||||||
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
void *memset( void *pvDest, int iValue, size_t ulBytes )
|
||||||
|
{
|
||||||
|
unsigned char *pcDest = ( unsigned char * ) pvDest;
|
||||||
|
size_t x;
|
||||||
|
|
||||||
|
for( x = 0; x < ulBytes; x++ )
|
||||||
|
{
|
||||||
|
*pcDest = ( unsigned char ) c;
|
||||||
|
pcDest++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return pvDest;
|
||||||
|
}
|
||||||
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
int memcmp( const void *pvMem1, const void *pvMem2 ,size_t ulBytes )
|
||||||
|
{
|
||||||
|
const unsigned char *pucMem1 = pvMem1, *pucMem2 = pvMem2;
|
||||||
|
size_t x;
|
||||||
|
|
||||||
|
for( x = 0; x < ulBytes; x++ )
|
||||||
|
{
|
||||||
|
if( pucMem1[ x ] != pucMem2[ x ] )
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return n - x;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue