From: richardbarry Date: Fri, 30 May 2008 15:51:35 +0000 (+0000) Subject: Update to V5.0.2 X-Git-Tag: V5.0.2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6de02d28c7f10d03bafedff7e7503956b0e1c291;p=freertos Update to V5.0.2 git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@397 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- diff --git a/Demo/PIC24_MPLAB/FreeRTOSConfig.h b/Demo/PIC24_MPLAB/FreeRTOSConfig.h index 8857eb79e..ff6670b3e 100644 --- a/Demo/PIC24_MPLAB/FreeRTOSConfig.h +++ b/Demo/PIC24_MPLAB/FreeRTOSConfig.h @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/PIC24_MPLAB/ParTest/ParTest.c b/Demo/PIC24_MPLAB/ParTest/ParTest.c index 53213969c..c546f37a5 100644 --- a/Demo/PIC24_MPLAB/ParTest/ParTest.c +++ b/Demo/PIC24_MPLAB/ParTest/ParTest.c @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/PIC24_MPLAB/lcd.c b/Demo/PIC24_MPLAB/lcd.c index 06a065303..bc3681c39 100644 --- a/Demo/PIC24_MPLAB/lcd.c +++ b/Demo/PIC24_MPLAB/lcd.c @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/PIC24_MPLAB/lcd.h b/Demo/PIC24_MPLAB/lcd.h index 171d71381..60e536bad 100644 --- a/Demo/PIC24_MPLAB/lcd.h +++ b/Demo/PIC24_MPLAB/lcd.h @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/PIC24_MPLAB/main.c b/Demo/PIC24_MPLAB/main.c index 67e3327c0..5b18088fa 100644 --- a/Demo/PIC24_MPLAB/main.c +++ b/Demo/PIC24_MPLAB/main.c @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/PIC24_MPLAB/serial/serial.c b/Demo/PIC24_MPLAB/serial/serial.c index 87d01ba46..cb837eb50 100644 --- a/Demo/PIC24_MPLAB/serial/serial.c +++ b/Demo/PIC24_MPLAB/serial/serial.c @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/PIC24_MPLAB/timertest.c b/Demo/PIC24_MPLAB/timertest.c index d0a46f1ee..23cfb2722 100644 --- a/Demo/PIC24_MPLAB/timertest.c +++ b/Demo/PIC24_MPLAB/timertest.c @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/PIC24_MPLAB/timertest.h b/Demo/PIC24_MPLAB/timertest.h index a439b31c1..e752ebe39 100644 --- a/Demo/PIC24_MPLAB/timertest.h +++ b/Demo/PIC24_MPLAB/timertest.h @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/PIC32MX_MPLAB/FreeRTOSConfig.h b/Demo/PIC32MX_MPLAB/FreeRTOSConfig.h index 73f9ed97a..26a82bc04 100644 --- a/Demo/PIC32MX_MPLAB/FreeRTOSConfig.h +++ b/Demo/PIC32MX_MPLAB/FreeRTOSConfig.h @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. @@ -66,8 +66,8 @@ #define configUSE_IDLE_HOOK 0 #define configUSE_TICK_HOOK 0 #define configTICK_RATE_HZ ( ( portTickType ) 1000 ) -#define configCPU_CLOCK_HZ ( ( unsigned portLONG ) 72000000UL ) -#define configPERIPHERAL_CLOCK_HZ ( ( unsigned portLONG ) 36000000UL ) +#define configCPU_CLOCK_HZ ( ( unsigned portLONG ) 80000000UL ) +#define configPERIPHERAL_CLOCK_HZ ( ( unsigned portLONG ) 40000000UL ) #define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 5 ) #define configMINIMAL_STACK_SIZE ( 200 ) #define configISR_STACK_SIZE ( 400 ) @@ -81,7 +81,7 @@ #define configQUEUE_REGISTRY_SIZE 0 /* Co-routine definitions. */ -#define configUSE_CO_ROUTINES 0 +#define configUSE_CO_ROUTINES 0 #define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* Set the following definitions to 1 to include the API function, or zero diff --git a/Demo/PIC32MX_MPLAB/IntQueueTimer.c b/Demo/PIC32MX_MPLAB/IntQueueTimer.c index 887fe5e0b..d0a0bb519 100644 --- a/Demo/PIC32MX_MPLAB/IntQueueTimer.c +++ b/Demo/PIC32MX_MPLAB/IntQueueTimer.c @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/PIC32MX_MPLAB/IntQueueTimer.h b/Demo/PIC32MX_MPLAB/IntQueueTimer.h index 33686269e..797e63030 100644 --- a/Demo/PIC32MX_MPLAB/IntQueueTimer.h +++ b/Demo/PIC32MX_MPLAB/IntQueueTimer.h @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/PIC32MX_MPLAB/IntQueueTimer_isr.S b/Demo/PIC32MX_MPLAB/IntQueueTimer_isr.S index c1acec58b..a088ced83 100644 --- a/Demo/PIC32MX_MPLAB/IntQueueTimer_isr.S +++ b/Demo/PIC32MX_MPLAB/IntQueueTimer_isr.S @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/PIC32MX_MPLAB/ParTest/ParTest.c b/Demo/PIC32MX_MPLAB/ParTest/ParTest.c index 321153cd8..1719010e5 100644 --- a/Demo/PIC32MX_MPLAB/ParTest/ParTest.c +++ b/Demo/PIC32MX_MPLAB/ParTest/ParTest.c @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/PIC32MX_MPLAB/RTOSDemo.mcp b/Demo/PIC32MX_MPLAB/RTOSDemo.mcp index 425d64cc6..575846df5 100644 --- a/Demo/PIC32MX_MPLAB/RTOSDemo.mcp +++ b/Demo/PIC32MX_MPLAB/RTOSDemo.mcp @@ -93,7 +93,7 @@ suite_guid={14495C23-81F8-43F3-8A44-859C583D7760} suite_state= [TOOL_SETTINGS] TS{CB0AF4B8-4022-429D-8F99-8A56782B2C6D}=--keep-locals --gdwarf-2 -TS{9C698E0A-CBC9-4EFF-AE7D-B569F93E7322}=-g -DMPLAB_PIC32MX_PORT -Wall -O3 -fomit-frame-pointer +TS{9C698E0A-CBC9-4EFF-AE7D-B569F93E7322}=-g -DMPLAB_PIC32MX_PORT -Wall -fomit-frame-pointer TS{77F59DA1-3C53-4677-AC5F-A03EB0125170}=--defsym=_min_heap_size=0 --defsym=_min_heap_size=0 -Map="$(BINDIR_)$(TARGETBASE).map" -o"$(BINDIR_)$(TARGETBASE).$(TARGETSUFFIX)" -O3 TS{0396C0A1-9052-4E4F-8B84-EF0162B1B4E9}= [INSTRUMENTED_TRACE] diff --git a/Demo/PIC32MX_MPLAB/RTOSDemo.mcs b/Demo/PIC32MX_MPLAB/RTOSDemo.mcs index bf47bded7..0eeb73802 100644 --- a/Demo/PIC32MX_MPLAB/RTOSDemo.mcs +++ b/Demo/PIC32MX_MPLAB/RTOSDemo.mcs @@ -1,318 +1,6 @@ [Header] MagicCookie={0b13fe8c-dfe0-40eb-8900-6712719559a7} Version=1.0 -[File000] -Location=C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\PIC32MX_MPLAB\main.o -Folder=Intermediary -DeviceName=PIC32MX360F512L -LanguageToolSuiteID={14495C23-81F8-43F3-8A44-859C583D7760} -LanguageToolID={430F471F-7ECB-4852-A80D-DEF9A5C8E751} -LanguageToolLocation=C:\Devtools\Microchip\MPLAB C32\bin\pic32-gcc.exe -PPAD=$(BINDIR)||$(TMPDIR)||$(AINDIR)|..\..\Source\portable\MPLAB\PIC32MX;.||$(INCDIR)|.;.;..\common\include;..\..\source\portable\mplab\pic32mx;..\..\source\include||$(LIBDIR)||$(LKRDIR)|| -SOLK=|main.c|ParTest\ParTest.c|..\..\Source\portable\MPLAB\PIC32MX\port.c|..\..\Source\list.c|..\..\Source\queue.c|..\..\Source\tasks.c|..\..\Source\portable\MPLAB\PIC32MX\port_asm.S|RegisterTestTasks.s|..\..\Source\portable\MemMang\heap_2.c|..\Common\Minimal\flash.c|..\Common\Minimal\QPeek.c|..\Common\Minimal\semtest.c|..\Common\Minimal\GenQTest.c|..\Common\Minimal\blocktim.c|lcd.c|serial\serial.c|..\Common\Minimal\comtest.c|serial\serial_isr.S|timertest.c|timertest_isr.S|C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\Common\Minimal\IntQueue.c|IntQueueTimer.c|IntQueueTimer_isr.S|printf-stdarg.c|||||||| -SuiteArgsString= -ToolArgsString=-g -DMPLAB_PIC32MX_PORT -Wall -O3 -fomit-frame-pointer -TraceCmdString= -[File001] -Location=C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\PIC32MX_MPLAB\ParTest.o -Folder=Intermediary -DeviceName=PIC32MX360F512L -LanguageToolSuiteID={14495C23-81F8-43F3-8A44-859C583D7760} -LanguageToolID={430F471F-7ECB-4852-A80D-DEF9A5C8E751} -LanguageToolLocation=C:\Devtools\Microchip\MPLAB C32\bin\pic32-gcc.exe -PPAD=$(BINDIR)||$(TMPDIR)||$(AINDIR)|..\..\Source\portable\MPLAB\PIC32MX;.||$(INCDIR)|.;.;..\common\include;..\..\source\portable\mplab\pic32mx;..\..\source\include||$(LIBDIR)||$(LKRDIR)|| -SOLK=|main.c|ParTest\ParTest.c|..\..\Source\portable\MPLAB\PIC32MX\port.c|..\..\Source\list.c|..\..\Source\queue.c|..\..\Source\tasks.c|..\..\Source\portable\MPLAB\PIC32MX\port_asm.S|RegisterTestTasks.s|..\..\Source\portable\MemMang\heap_2.c|..\Common\Minimal\flash.c|..\Common\Minimal\QPeek.c|..\Common\Minimal\semtest.c|..\Common\Minimal\GenQTest.c|..\Common\Minimal\blocktim.c|lcd.c|serial\serial.c|..\Common\Minimal\comtest.c|serial\serial_isr.S|timertest.c|timertest_isr.S|C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\Common\Minimal\IntQueue.c|IntQueueTimer.c|IntQueueTimer_isr.S|printf-stdarg.c|||||||| -SuiteArgsString= -ToolArgsString=-g -DMPLAB_PIC32MX_PORT -Wall -O3 -fomit-frame-pointer -TraceCmdString= -[File002] -Location=C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\PIC32MX_MPLAB\port.o -Folder=Intermediary -DeviceName=PIC32MX360F512L -LanguageToolSuiteID={14495C23-81F8-43F3-8A44-859C583D7760} -LanguageToolID={430F471F-7ECB-4852-A80D-DEF9A5C8E751} -LanguageToolLocation=C:\Devtools\Microchip\MPLAB C32\bin\pic32-gcc.exe -PPAD=$(BINDIR)||$(TMPDIR)||$(AINDIR)|..\..\Source\portable\MPLAB\PIC32MX;.||$(INCDIR)|.;.;..\common\include;..\..\source\portable\mplab\pic32mx;..\..\source\include||$(LIBDIR)||$(LKRDIR)|| -SOLK=|main.c|ParTest\ParTest.c|..\..\Source\portable\MPLAB\PIC32MX\port.c|..\..\Source\list.c|..\..\Source\queue.c|..\..\Source\tasks.c|..\..\Source\portable\MPLAB\PIC32MX\port_asm.S|RegisterTestTasks.s|..\..\Source\portable\MemMang\heap_2.c|..\Common\Minimal\flash.c|..\Common\Minimal\QPeek.c|..\Common\Minimal\semtest.c|..\Common\Minimal\GenQTest.c|..\Common\Minimal\blocktim.c|lcd.c|serial\serial.c|..\Common\Minimal\comtest.c|serial\serial_isr.S|timertest.c|timertest_isr.S|C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\Common\Minimal\IntQueue.c|IntQueueTimer.c|IntQueueTimer_isr.S|printf-stdarg.c|||||||| -SuiteArgsString= -ToolArgsString=-g -DMPLAB_PIC32MX_PORT -Wall -O3 -fomit-frame-pointer -TraceCmdString= -[File003] -Location=C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\PIC32MX_MPLAB\list.o -Folder=Intermediary -DeviceName=PIC32MX360F512L -LanguageToolSuiteID={14495C23-81F8-43F3-8A44-859C583D7760} -LanguageToolID={430F471F-7ECB-4852-A80D-DEF9A5C8E751} -LanguageToolLocation=C:\Devtools\Microchip\MPLAB C32\bin\pic32-gcc.exe -PPAD=$(BINDIR)||$(TMPDIR)||$(AINDIR)|..\..\Source\portable\MPLAB\PIC32MX;.||$(INCDIR)|.;.;..\common\include;..\..\source\portable\mplab\pic32mx;..\..\source\include||$(LIBDIR)||$(LKRDIR)|| -SOLK=|main.c|ParTest\ParTest.c|..\..\Source\portable\MPLAB\PIC32MX\port.c|..\..\Source\list.c|..\..\Source\queue.c|..\..\Source\tasks.c|..\..\Source\portable\MPLAB\PIC32MX\port_asm.S|RegisterTestTasks.s|..\..\Source\portable\MemMang\heap_2.c|..\Common\Minimal\flash.c|..\Common\Minimal\QPeek.c|..\Common\Minimal\semtest.c|..\Common\Minimal\GenQTest.c|..\Common\Minimal\blocktim.c|lcd.c|serial\serial.c|..\Common\Minimal\comtest.c|serial\serial_isr.S|timertest.c|timertest_isr.S|C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\Common\Minimal\IntQueue.c|IntQueueTimer.c|IntQueueTimer_isr.S|printf-stdarg.c|||||||| -SuiteArgsString= -ToolArgsString=-g -DMPLAB_PIC32MX_PORT -Wall -O3 -fomit-frame-pointer -TraceCmdString= -[File004] -Location=C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\PIC32MX_MPLAB\queue.o -Folder=Intermediary -DeviceName=PIC32MX360F512L -LanguageToolSuiteID={14495C23-81F8-43F3-8A44-859C583D7760} -LanguageToolID={430F471F-7ECB-4852-A80D-DEF9A5C8E751} -LanguageToolLocation=C:\Devtools\Microchip\MPLAB C32\bin\pic32-gcc.exe -PPAD=$(BINDIR)||$(TMPDIR)||$(AINDIR)|..\..\Source\portable\MPLAB\PIC32MX;.||$(INCDIR)|.;.;..\common\include;..\..\source\portable\mplab\pic32mx;..\..\source\include||$(LIBDIR)||$(LKRDIR)|| -SOLK=|main.c|ParTest\ParTest.c|..\..\Source\portable\MPLAB\PIC32MX\port.c|..\..\Source\list.c|..\..\Source\queue.c|..\..\Source\tasks.c|..\..\Source\portable\MPLAB\PIC32MX\port_asm.S|RegisterTestTasks.s|..\..\Source\portable\MemMang\heap_2.c|..\Common\Minimal\flash.c|..\Common\Minimal\QPeek.c|..\Common\Minimal\semtest.c|..\Common\Minimal\GenQTest.c|..\Common\Minimal\blocktim.c|lcd.c|serial\serial.c|..\Common\Minimal\comtest.c|serial\serial_isr.S|timertest.c|timertest_isr.S|C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\Common\Minimal\IntQueue.c|IntQueueTimer.c|IntQueueTimer_isr.S|printf-stdarg.c|||||||| -SuiteArgsString= -ToolArgsString=-g -DMPLAB_PIC32MX_PORT -Wall -O3 -fomit-frame-pointer -TraceCmdString= -[File005] -Location=C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\PIC32MX_MPLAB\tasks.o -Folder=Intermediary -DeviceName=PIC32MX360F512L -LanguageToolSuiteID={14495C23-81F8-43F3-8A44-859C583D7760} -LanguageToolID={430F471F-7ECB-4852-A80D-DEF9A5C8E751} -LanguageToolLocation=C:\Devtools\Microchip\MPLAB C32\bin\pic32-gcc.exe -PPAD=$(BINDIR)||$(TMPDIR)||$(AINDIR)|..\..\Source\portable\MPLAB\PIC32MX;.||$(INCDIR)|.;.;..\common\include;..\..\source\portable\mplab\pic32mx;..\..\source\include||$(LIBDIR)||$(LKRDIR)|| -SOLK=|main.c|ParTest\ParTest.c|..\..\Source\portable\MPLAB\PIC32MX\port.c|..\..\Source\list.c|..\..\Source\queue.c|..\..\Source\tasks.c|..\..\Source\portable\MPLAB\PIC32MX\port_asm.S|RegisterTestTasks.s|..\..\Source\portable\MemMang\heap_2.c|..\Common\Minimal\flash.c|..\Common\Minimal\QPeek.c|..\Common\Minimal\semtest.c|..\Common\Minimal\GenQTest.c|..\Common\Minimal\blocktim.c|lcd.c|serial\serial.c|..\Common\Minimal\comtest.c|serial\serial_isr.S|timertest.c|timertest_isr.S|C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\Common\Minimal\IntQueue.c|IntQueueTimer.c|IntQueueTimer_isr.S|printf-stdarg.c|||||||| -SuiteArgsString= -ToolArgsString=-g -DMPLAB_PIC32MX_PORT -Wall -O3 -fomit-frame-pointer -TraceCmdString= -[File006] -Location=C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\PIC32MX_MPLAB\port_asm.o -Folder=Intermediary -DeviceName=PIC32MX360F512L -LanguageToolSuiteID={14495C23-81F8-43F3-8A44-859C583D7760} -LanguageToolID={92E15EC6-5E91-4BF4-B5FA-C80AD2601AA7} -LanguageToolLocation=C:\Devtools\Microchip\MPLAB C32\bin\pic32-as.exe -PPAD=$(BINDIR)||$(TMPDIR)||$(AINDIR)|..\..\Source\portable\MPLAB\PIC32MX;.||$(INCDIR)|.;.;..\common\include;..\..\source\portable\mplab\pic32mx;..\..\source\include||$(LIBDIR)||$(LKRDIR)|| -SOLK=|main.c|ParTest\ParTest.c|..\..\Source\portable\MPLAB\PIC32MX\port.c|..\..\Source\list.c|..\..\Source\queue.c|..\..\Source\tasks.c|..\..\Source\portable\MPLAB\PIC32MX\port_asm.S|RegisterTestTasks.s|..\..\Source\portable\MemMang\heap_2.c|..\Common\Minimal\flash.c|..\Common\Minimal\QPeek.c|..\Common\Minimal\semtest.c|..\Common\Minimal\GenQTest.c|..\Common\Minimal\blocktim.c|lcd.c|serial\serial.c|..\Common\Minimal\comtest.c|serial\serial_isr.S|timertest.c|timertest_isr.S|C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\Common\Minimal\IntQueue.c|IntQueueTimer.c|IntQueueTimer_isr.S|printf-stdarg.c|||||||| -SuiteArgsString= -ToolArgsString=--keep-locals --gdwarf-2 -TraceCmdString= -[File007] -Location=C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\PIC32MX_MPLAB\RegisterTestTasks.o -Folder=Intermediary -DeviceName=PIC32MX360F512L -LanguageToolSuiteID={14495C23-81F8-43F3-8A44-859C583D7760} -LanguageToolID={92E15EC6-5E91-4BF4-B5FA-C80AD2601AA7} -LanguageToolLocation=C:\Devtools\Microchip\MPLAB C32\bin\pic32-as.exe -PPAD=$(BINDIR)||$(TMPDIR)||$(AINDIR)|..\..\Source\portable\MPLAB\PIC32MX;.||$(INCDIR)|.;.;..\common\include;..\..\source\portable\mplab\pic32mx;..\..\source\include||$(LIBDIR)||$(LKRDIR)|| -SOLK=|main.c|ParTest\ParTest.c|..\..\Source\portable\MPLAB\PIC32MX\port.c|..\..\Source\list.c|..\..\Source\queue.c|..\..\Source\tasks.c|..\..\Source\portable\MPLAB\PIC32MX\port_asm.S|RegisterTestTasks.s|..\..\Source\portable\MemMang\heap_2.c|..\Common\Minimal\flash.c|..\Common\Minimal\QPeek.c|..\Common\Minimal\semtest.c|..\Common\Minimal\GenQTest.c|..\Common\Minimal\blocktim.c|lcd.c|serial\serial.c|..\Common\Minimal\comtest.c|serial\serial_isr.S|timertest.c|timertest_isr.S|C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\Common\Minimal\IntQueue.c|IntQueueTimer.c|IntQueueTimer_isr.S|printf-stdarg.c|||||||| -SuiteArgsString= -ToolArgsString=--keep-locals --gdwarf-2 -TraceCmdString= -[File008] -Location=C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\PIC32MX_MPLAB\heap_2.o -Folder=Intermediary -DeviceName=PIC32MX360F512L -LanguageToolSuiteID={14495C23-81F8-43F3-8A44-859C583D7760} -LanguageToolID={430F471F-7ECB-4852-A80D-DEF9A5C8E751} -LanguageToolLocation=C:\Devtools\Microchip\MPLAB C32\bin\pic32-gcc.exe -PPAD=$(BINDIR)||$(TMPDIR)||$(AINDIR)|..\..\Source\portable\MPLAB\PIC32MX;.||$(INCDIR)|.;.;..\common\include;..\..\source\portable\mplab\pic32mx;..\..\source\include||$(LIBDIR)||$(LKRDIR)|| -SOLK=|main.c|ParTest\ParTest.c|..\..\Source\portable\MPLAB\PIC32MX\port.c|..\..\Source\list.c|..\..\Source\queue.c|..\..\Source\tasks.c|..\..\Source\portable\MPLAB\PIC32MX\port_asm.S|RegisterTestTasks.s|..\..\Source\portable\MemMang\heap_2.c|..\Common\Minimal\flash.c|..\Common\Minimal\QPeek.c|..\Common\Minimal\semtest.c|..\Common\Minimal\GenQTest.c|..\Common\Minimal\blocktim.c|lcd.c|serial\serial.c|..\Common\Minimal\comtest.c|serial\serial_isr.S|timertest.c|timertest_isr.S|C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\Common\Minimal\IntQueue.c|IntQueueTimer.c|IntQueueTimer_isr.S|printf-stdarg.c|||||||| -SuiteArgsString= -ToolArgsString=-g -DMPLAB_PIC32MX_PORT -Wall -O3 -fomit-frame-pointer -TraceCmdString= -[File009] -Location=C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\PIC32MX_MPLAB\flash.o -Folder=Intermediary -DeviceName=PIC32MX360F512L -LanguageToolSuiteID={14495C23-81F8-43F3-8A44-859C583D7760} -LanguageToolID={430F471F-7ECB-4852-A80D-DEF9A5C8E751} -LanguageToolLocation=C:\Devtools\Microchip\MPLAB C32\bin\pic32-gcc.exe -PPAD=$(BINDIR)||$(TMPDIR)||$(AINDIR)|..\..\Source\portable\MPLAB\PIC32MX;.||$(INCDIR)|.;.;..\common\include;..\..\source\portable\mplab\pic32mx;..\..\source\include||$(LIBDIR)||$(LKRDIR)|| -SOLK=|main.c|ParTest\ParTest.c|..\..\Source\portable\MPLAB\PIC32MX\port.c|..\..\Source\list.c|..\..\Source\queue.c|..\..\Source\tasks.c|..\..\Source\portable\MPLAB\PIC32MX\port_asm.S|RegisterTestTasks.s|..\..\Source\portable\MemMang\heap_2.c|..\Common\Minimal\flash.c|..\Common\Minimal\QPeek.c|..\Common\Minimal\semtest.c|..\Common\Minimal\GenQTest.c|..\Common\Minimal\blocktim.c|lcd.c|serial\serial.c|..\Common\Minimal\comtest.c|serial\serial_isr.S|timertest.c|timertest_isr.S|C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\Common\Minimal\IntQueue.c|IntQueueTimer.c|IntQueueTimer_isr.S|printf-stdarg.c|||||||| -SuiteArgsString= -ToolArgsString=-g -DMPLAB_PIC32MX_PORT -Wall -O3 -fomit-frame-pointer -TraceCmdString= -[File010] -Location=C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\PIC32MX_MPLAB\QPeek.o -Folder=Intermediary -DeviceName=PIC32MX360F512L -LanguageToolSuiteID={14495C23-81F8-43F3-8A44-859C583D7760} -LanguageToolID={430F471F-7ECB-4852-A80D-DEF9A5C8E751} -LanguageToolLocation=C:\Devtools\Microchip\MPLAB C32\bin\pic32-gcc.exe -PPAD=$(BINDIR)||$(TMPDIR)||$(AINDIR)|..\..\Source\portable\MPLAB\PIC32MX;.||$(INCDIR)|.;.;..\common\include;..\..\source\portable\mplab\pic32mx;..\..\source\include||$(LIBDIR)||$(LKRDIR)|| -SOLK=|main.c|ParTest\ParTest.c|..\..\Source\portable\MPLAB\PIC32MX\port.c|..\..\Source\list.c|..\..\Source\queue.c|..\..\Source\tasks.c|..\..\Source\portable\MPLAB\PIC32MX\port_asm.S|RegisterTestTasks.s|..\..\Source\portable\MemMang\heap_2.c|..\Common\Minimal\flash.c|..\Common\Minimal\QPeek.c|..\Common\Minimal\semtest.c|..\Common\Minimal\GenQTest.c|..\Common\Minimal\blocktim.c|lcd.c|serial\serial.c|..\Common\Minimal\comtest.c|serial\serial_isr.S|timertest.c|timertest_isr.S|C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\Common\Minimal\IntQueue.c|IntQueueTimer.c|IntQueueTimer_isr.S|printf-stdarg.c|||||||| -SuiteArgsString= -ToolArgsString=-g -DMPLAB_PIC32MX_PORT -Wall -O3 -fomit-frame-pointer -TraceCmdString= -[File011] -Location=C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\PIC32MX_MPLAB\semtest.o -Folder=Intermediary -DeviceName=PIC32MX360F512L -LanguageToolSuiteID={14495C23-81F8-43F3-8A44-859C583D7760} -LanguageToolID={430F471F-7ECB-4852-A80D-DEF9A5C8E751} -LanguageToolLocation=C:\Devtools\Microchip\MPLAB C32\bin\pic32-gcc.exe -PPAD=$(BINDIR)||$(TMPDIR)||$(AINDIR)|..\..\Source\portable\MPLAB\PIC32MX;.||$(INCDIR)|.;.;..\common\include;..\..\source\portable\mplab\pic32mx;..\..\source\include||$(LIBDIR)||$(LKRDIR)|| -SOLK=|main.c|ParTest\ParTest.c|..\..\Source\portable\MPLAB\PIC32MX\port.c|..\..\Source\list.c|..\..\Source\queue.c|..\..\Source\tasks.c|..\..\Source\portable\MPLAB\PIC32MX\port_asm.S|RegisterTestTasks.s|..\..\Source\portable\MemMang\heap_2.c|..\Common\Minimal\flash.c|..\Common\Minimal\QPeek.c|..\Common\Minimal\semtest.c|..\Common\Minimal\GenQTest.c|..\Common\Minimal\blocktim.c|lcd.c|serial\serial.c|..\Common\Minimal\comtest.c|serial\serial_isr.S|timertest.c|timertest_isr.S|C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\Common\Minimal\IntQueue.c|IntQueueTimer.c|IntQueueTimer_isr.S|printf-stdarg.c|||||||| -SuiteArgsString= -ToolArgsString=-g -DMPLAB_PIC32MX_PORT -Wall -O3 -fomit-frame-pointer -TraceCmdString= -[File012] -Location=C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\PIC32MX_MPLAB\GenQTest.o -Folder=Intermediary -DeviceName=PIC32MX360F512L -LanguageToolSuiteID={14495C23-81F8-43F3-8A44-859C583D7760} -LanguageToolID={430F471F-7ECB-4852-A80D-DEF9A5C8E751} -LanguageToolLocation=C:\Devtools\Microchip\MPLAB C32\bin\pic32-gcc.exe -PPAD=$(BINDIR)||$(TMPDIR)||$(AINDIR)|..\..\Source\portable\MPLAB\PIC32MX;.||$(INCDIR)|.;.;..\common\include;..\..\source\portable\mplab\pic32mx;..\..\source\include||$(LIBDIR)||$(LKRDIR)|| -SOLK=|main.c|ParTest\ParTest.c|..\..\Source\portable\MPLAB\PIC32MX\port.c|..\..\Source\list.c|..\..\Source\queue.c|..\..\Source\tasks.c|..\..\Source\portable\MPLAB\PIC32MX\port_asm.S|RegisterTestTasks.s|..\..\Source\portable\MemMang\heap_2.c|..\Common\Minimal\flash.c|..\Common\Minimal\QPeek.c|..\Common\Minimal\semtest.c|..\Common\Minimal\GenQTest.c|..\Common\Minimal\blocktim.c|lcd.c|serial\serial.c|..\Common\Minimal\comtest.c|serial\serial_isr.S|timertest.c|timertest_isr.S|C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\Common\Minimal\IntQueue.c|IntQueueTimer.c|IntQueueTimer_isr.S|printf-stdarg.c|||||||| -SuiteArgsString= -ToolArgsString=-g -DMPLAB_PIC32MX_PORT -Wall -O3 -fomit-frame-pointer -TraceCmdString= -[File013] -Location=C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\PIC32MX_MPLAB\blocktim.o -Folder=Intermediary -DeviceName=PIC32MX360F512L -LanguageToolSuiteID={14495C23-81F8-43F3-8A44-859C583D7760} -LanguageToolID={430F471F-7ECB-4852-A80D-DEF9A5C8E751} -LanguageToolLocation=C:\Devtools\Microchip\MPLAB C32\bin\pic32-gcc.exe -PPAD=$(BINDIR)||$(TMPDIR)||$(AINDIR)|..\..\Source\portable\MPLAB\PIC32MX;.||$(INCDIR)|.;.;..\common\include;..\..\source\portable\mplab\pic32mx;..\..\source\include||$(LIBDIR)||$(LKRDIR)|| -SOLK=|main.c|ParTest\ParTest.c|..\..\Source\portable\MPLAB\PIC32MX\port.c|..\..\Source\list.c|..\..\Source\queue.c|..\..\Source\tasks.c|..\..\Source\portable\MPLAB\PIC32MX\port_asm.S|RegisterTestTasks.s|..\..\Source\portable\MemMang\heap_2.c|..\Common\Minimal\flash.c|..\Common\Minimal\QPeek.c|..\Common\Minimal\semtest.c|..\Common\Minimal\GenQTest.c|..\Common\Minimal\blocktim.c|lcd.c|serial\serial.c|..\Common\Minimal\comtest.c|serial\serial_isr.S|timertest.c|timertest_isr.S|C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\Common\Minimal\IntQueue.c|IntQueueTimer.c|IntQueueTimer_isr.S|printf-stdarg.c|||||||| -SuiteArgsString= -ToolArgsString=-g -DMPLAB_PIC32MX_PORT -Wall -O3 -fomit-frame-pointer -TraceCmdString= -[File014] -Location=C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\PIC32MX_MPLAB\lcd.o -Folder=Intermediary -DeviceName=PIC32MX360F512L -LanguageToolSuiteID={14495C23-81F8-43F3-8A44-859C583D7760} -LanguageToolID={430F471F-7ECB-4852-A80D-DEF9A5C8E751} -LanguageToolLocation=C:\Devtools\Microchip\MPLAB C32\bin\pic32-gcc.exe -PPAD=$(BINDIR)||$(TMPDIR)||$(AINDIR)|..\..\Source\portable\MPLAB\PIC32MX;.||$(INCDIR)|.;.;..\common\include;..\..\source\portable\mplab\pic32mx;..\..\source\include||$(LIBDIR)||$(LKRDIR)|| -SOLK=|main.c|ParTest\ParTest.c|..\..\Source\portable\MPLAB\PIC32MX\port.c|..\..\Source\list.c|..\..\Source\queue.c|..\..\Source\tasks.c|..\..\Source\portable\MPLAB\PIC32MX\port_asm.S|RegisterTestTasks.s|..\..\Source\portable\MemMang\heap_2.c|..\Common\Minimal\flash.c|..\Common\Minimal\QPeek.c|..\Common\Minimal\semtest.c|..\Common\Minimal\GenQTest.c|..\Common\Minimal\blocktim.c|lcd.c|serial\serial.c|..\Common\Minimal\comtest.c|serial\serial_isr.S|timertest.c|timertest_isr.S|C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\Common\Minimal\IntQueue.c|IntQueueTimer.c|IntQueueTimer_isr.S|printf-stdarg.c|||||||| -SuiteArgsString= -ToolArgsString=-g -DMPLAB_PIC32MX_PORT -Wall -O3 -fomit-frame-pointer -TraceCmdString= -[File015] -Location=C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\PIC32MX_MPLAB\serial.o -Folder=Intermediary -DeviceName=PIC32MX360F512L -LanguageToolSuiteID={14495C23-81F8-43F3-8A44-859C583D7760} -LanguageToolID={430F471F-7ECB-4852-A80D-DEF9A5C8E751} -LanguageToolLocation=C:\Devtools\Microchip\MPLAB C32\bin\pic32-gcc.exe -PPAD=$(BINDIR)||$(TMPDIR)||$(AINDIR)|..\..\Source\portable\MPLAB\PIC32MX;.||$(INCDIR)|.;.;..\common\include;..\..\source\portable\mplab\pic32mx;..\..\source\include||$(LIBDIR)||$(LKRDIR)|| -SOLK=|main.c|ParTest\ParTest.c|..\..\Source\portable\MPLAB\PIC32MX\port.c|..\..\Source\list.c|..\..\Source\queue.c|..\..\Source\tasks.c|..\..\Source\portable\MPLAB\PIC32MX\port_asm.S|RegisterTestTasks.s|..\..\Source\portable\MemMang\heap_2.c|..\Common\Minimal\flash.c|..\Common\Minimal\QPeek.c|..\Common\Minimal\semtest.c|..\Common\Minimal\GenQTest.c|..\Common\Minimal\blocktim.c|lcd.c|serial\serial.c|..\Common\Minimal\comtest.c|serial\serial_isr.S|timertest.c|timertest_isr.S|C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\Common\Minimal\IntQueue.c|IntQueueTimer.c|IntQueueTimer_isr.S|printf-stdarg.c|||||||| -SuiteArgsString= -ToolArgsString=-g -DMPLAB_PIC32MX_PORT -Wall -O3 -fomit-frame-pointer -TraceCmdString= -[File016] -Location=C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\PIC32MX_MPLAB\comtest.o -Folder=Intermediary -DeviceName=PIC32MX360F512L -LanguageToolSuiteID={14495C23-81F8-43F3-8A44-859C583D7760} -LanguageToolID={430F471F-7ECB-4852-A80D-DEF9A5C8E751} -LanguageToolLocation=C:\Devtools\Microchip\MPLAB C32\bin\pic32-gcc.exe -PPAD=$(BINDIR)||$(TMPDIR)||$(AINDIR)|..\..\Source\portable\MPLAB\PIC32MX;.||$(INCDIR)|.;.;..\common\include;..\..\source\portable\mplab\pic32mx;..\..\source\include||$(LIBDIR)||$(LKRDIR)|| -SOLK=|main.c|ParTest\ParTest.c|..\..\Source\portable\MPLAB\PIC32MX\port.c|..\..\Source\list.c|..\..\Source\queue.c|..\..\Source\tasks.c|..\..\Source\portable\MPLAB\PIC32MX\port_asm.S|RegisterTestTasks.s|..\..\Source\portable\MemMang\heap_2.c|..\Common\Minimal\flash.c|..\Common\Minimal\QPeek.c|..\Common\Minimal\semtest.c|..\Common\Minimal\GenQTest.c|..\Common\Minimal\blocktim.c|lcd.c|serial\serial.c|..\Common\Minimal\comtest.c|serial\serial_isr.S|timertest.c|timertest_isr.S|C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\Common\Minimal\IntQueue.c|IntQueueTimer.c|IntQueueTimer_isr.S|printf-stdarg.c|||||||| -SuiteArgsString= -ToolArgsString=-g -DMPLAB_PIC32MX_PORT -Wall -O3 -fomit-frame-pointer -TraceCmdString= -[File017] -Location=C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\PIC32MX_MPLAB\serial_isr.o -Folder=Intermediary -DeviceName=PIC32MX360F512L -LanguageToolSuiteID={14495C23-81F8-43F3-8A44-859C583D7760} -LanguageToolID={92E15EC6-5E91-4BF4-B5FA-C80AD2601AA7} -LanguageToolLocation=C:\Devtools\Microchip\MPLAB C32\bin\pic32-as.exe -PPAD=$(BINDIR)||$(TMPDIR)||$(AINDIR)|..\..\Source\portable\MPLAB\PIC32MX;.||$(INCDIR)|.;.;..\common\include;..\..\source\portable\mplab\pic32mx;..\..\source\include||$(LIBDIR)||$(LKRDIR)|| -SOLK=|main.c|ParTest\ParTest.c|..\..\Source\portable\MPLAB\PIC32MX\port.c|..\..\Source\list.c|..\..\Source\queue.c|..\..\Source\tasks.c|..\..\Source\portable\MPLAB\PIC32MX\port_asm.S|RegisterTestTasks.s|..\..\Source\portable\MemMang\heap_2.c|..\Common\Minimal\flash.c|..\Common\Minimal\QPeek.c|..\Common\Minimal\semtest.c|..\Common\Minimal\GenQTest.c|..\Common\Minimal\blocktim.c|lcd.c|serial\serial.c|..\Common\Minimal\comtest.c|serial\serial_isr.S|timertest.c|timertest_isr.S|C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\Common\Minimal\IntQueue.c|IntQueueTimer.c|IntQueueTimer_isr.S|printf-stdarg.c|||||||| -SuiteArgsString= -ToolArgsString=--keep-locals --gdwarf-2 -TraceCmdString= -[File018] -Location=C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\PIC32MX_MPLAB\timertest.o -Folder=Intermediary -DeviceName=PIC32MX360F512L -LanguageToolSuiteID={14495C23-81F8-43F3-8A44-859C583D7760} -LanguageToolID={430F471F-7ECB-4852-A80D-DEF9A5C8E751} -LanguageToolLocation=C:\Devtools\Microchip\MPLAB C32\bin\pic32-gcc.exe -PPAD=$(BINDIR)||$(TMPDIR)||$(AINDIR)|..\..\Source\portable\MPLAB\PIC32MX;.||$(INCDIR)|.;.;..\common\include;..\..\source\portable\mplab\pic32mx;..\..\source\include||$(LIBDIR)||$(LKRDIR)|| -SOLK=|main.c|ParTest\ParTest.c|..\..\Source\portable\MPLAB\PIC32MX\port.c|..\..\Source\list.c|..\..\Source\queue.c|..\..\Source\tasks.c|..\..\Source\portable\MPLAB\PIC32MX\port_asm.S|RegisterTestTasks.s|..\..\Source\portable\MemMang\heap_2.c|..\Common\Minimal\flash.c|..\Common\Minimal\QPeek.c|..\Common\Minimal\semtest.c|..\Common\Minimal\GenQTest.c|..\Common\Minimal\blocktim.c|lcd.c|serial\serial.c|..\Common\Minimal\comtest.c|serial\serial_isr.S|timertest.c|timertest_isr.S|C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\Common\Minimal\IntQueue.c|IntQueueTimer.c|IntQueueTimer_isr.S|printf-stdarg.c|||||||| -SuiteArgsString= -ToolArgsString=-g -DMPLAB_PIC32MX_PORT -Wall -O3 -fomit-frame-pointer -TraceCmdString= -[File019] -Location=C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\PIC32MX_MPLAB\timertest_isr.o -Folder=Intermediary -DeviceName=PIC32MX360F512L -LanguageToolSuiteID={14495C23-81F8-43F3-8A44-859C583D7760} -LanguageToolID={92E15EC6-5E91-4BF4-B5FA-C80AD2601AA7} -LanguageToolLocation=C:\Devtools\Microchip\MPLAB C32\bin\pic32-as.exe -PPAD=$(BINDIR)||$(TMPDIR)||$(AINDIR)|..\..\Source\portable\MPLAB\PIC32MX;.||$(INCDIR)|.;.;..\common\include;..\..\source\portable\mplab\pic32mx;..\..\source\include||$(LIBDIR)||$(LKRDIR)|| -SOLK=|main.c|ParTest\ParTest.c|..\..\Source\portable\MPLAB\PIC32MX\port.c|..\..\Source\list.c|..\..\Source\queue.c|..\..\Source\tasks.c|..\..\Source\portable\MPLAB\PIC32MX\port_asm.S|RegisterTestTasks.s|..\..\Source\portable\MemMang\heap_2.c|..\Common\Minimal\flash.c|..\Common\Minimal\QPeek.c|..\Common\Minimal\semtest.c|..\Common\Minimal\GenQTest.c|..\Common\Minimal\blocktim.c|lcd.c|serial\serial.c|..\Common\Minimal\comtest.c|serial\serial_isr.S|timertest.c|timertest_isr.S|C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\Common\Minimal\IntQueue.c|IntQueueTimer.c|IntQueueTimer_isr.S|printf-stdarg.c|||||||| -SuiteArgsString= -ToolArgsString=--keep-locals --gdwarf-2 -TraceCmdString= -[File020] -Location=C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\PIC32MX_MPLAB\IntQueue.o -Folder=Intermediary -DeviceName=PIC32MX360F512L -LanguageToolSuiteID={14495C23-81F8-43F3-8A44-859C583D7760} -LanguageToolID={430F471F-7ECB-4852-A80D-DEF9A5C8E751} -LanguageToolLocation=C:\Devtools\Microchip\MPLAB C32\bin\pic32-gcc.exe -PPAD=$(BINDIR)||$(TMPDIR)||$(AINDIR)|..\..\Source\portable\MPLAB\PIC32MX;.||$(INCDIR)|.;.;..\common\include;..\..\source\portable\mplab\pic32mx;..\..\source\include||$(LIBDIR)||$(LKRDIR)|| -SOLK=|main.c|ParTest\ParTest.c|..\..\Source\portable\MPLAB\PIC32MX\port.c|..\..\Source\list.c|..\..\Source\queue.c|..\..\Source\tasks.c|..\..\Source\portable\MPLAB\PIC32MX\port_asm.S|RegisterTestTasks.s|..\..\Source\portable\MemMang\heap_2.c|..\Common\Minimal\flash.c|..\Common\Minimal\QPeek.c|..\Common\Minimal\semtest.c|..\Common\Minimal\GenQTest.c|..\Common\Minimal\blocktim.c|lcd.c|serial\serial.c|..\Common\Minimal\comtest.c|serial\serial_isr.S|timertest.c|timertest_isr.S|C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\Common\Minimal\IntQueue.c|IntQueueTimer.c|IntQueueTimer_isr.S|printf-stdarg.c|||||||| -SuiteArgsString= -ToolArgsString=-g -DMPLAB_PIC32MX_PORT -Wall -O3 -fomit-frame-pointer -TraceCmdString= -[File021] -Location=C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\PIC32MX_MPLAB\IntQueueTimer.o -Folder=Intermediary -DeviceName=PIC32MX360F512L -LanguageToolSuiteID={14495C23-81F8-43F3-8A44-859C583D7760} -LanguageToolID={430F471F-7ECB-4852-A80D-DEF9A5C8E751} -LanguageToolLocation=C:\Devtools\Microchip\MPLAB C32\bin\pic32-gcc.exe -PPAD=$(BINDIR)||$(TMPDIR)||$(AINDIR)|..\..\Source\portable\MPLAB\PIC32MX;.||$(INCDIR)|.;.;..\common\include;..\..\source\portable\mplab\pic32mx;..\..\source\include||$(LIBDIR)||$(LKRDIR)|| -SOLK=|main.c|ParTest\ParTest.c|..\..\Source\portable\MPLAB\PIC32MX\port.c|..\..\Source\list.c|..\..\Source\queue.c|..\..\Source\tasks.c|..\..\Source\portable\MPLAB\PIC32MX\port_asm.S|RegisterTestTasks.s|..\..\Source\portable\MemMang\heap_2.c|..\Common\Minimal\flash.c|..\Common\Minimal\QPeek.c|..\Common\Minimal\semtest.c|..\Common\Minimal\GenQTest.c|..\Common\Minimal\blocktim.c|lcd.c|serial\serial.c|..\Common\Minimal\comtest.c|serial\serial_isr.S|timertest.c|timertest_isr.S|C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\Common\Minimal\IntQueue.c|IntQueueTimer.c|IntQueueTimer_isr.S|printf-stdarg.c|||||||| -SuiteArgsString= -ToolArgsString=-g -DMPLAB_PIC32MX_PORT -Wall -O3 -fomit-frame-pointer -TraceCmdString= -[File022] -Location=C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\PIC32MX_MPLAB\IntQueueTimer_isr.o -Folder=Intermediary -DeviceName=PIC32MX360F512L -LanguageToolSuiteID={14495C23-81F8-43F3-8A44-859C583D7760} -LanguageToolID={92E15EC6-5E91-4BF4-B5FA-C80AD2601AA7} -LanguageToolLocation=C:\Devtools\Microchip\MPLAB C32\bin\pic32-as.exe -PPAD=$(BINDIR)||$(TMPDIR)||$(AINDIR)|..\..\Source\portable\MPLAB\PIC32MX;.||$(INCDIR)|.;.;..\common\include;..\..\source\portable\mplab\pic32mx;..\..\source\include||$(LIBDIR)||$(LKRDIR)|| -SOLK=|main.c|ParTest\ParTest.c|..\..\Source\portable\MPLAB\PIC32MX\port.c|..\..\Source\list.c|..\..\Source\queue.c|..\..\Source\tasks.c|..\..\Source\portable\MPLAB\PIC32MX\port_asm.S|RegisterTestTasks.s|..\..\Source\portable\MemMang\heap_2.c|..\Common\Minimal\flash.c|..\Common\Minimal\QPeek.c|..\Common\Minimal\semtest.c|..\Common\Minimal\GenQTest.c|..\Common\Minimal\blocktim.c|lcd.c|serial\serial.c|..\Common\Minimal\comtest.c|serial\serial_isr.S|timertest.c|timertest_isr.S|C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\Common\Minimal\IntQueue.c|IntQueueTimer.c|IntQueueTimer_isr.S|printf-stdarg.c|||||||| -SuiteArgsString= -ToolArgsString=--keep-locals --gdwarf-2 -TraceCmdString= -[File023] -Location=C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\PIC32MX_MPLAB\printf-stdarg.o -Folder=Intermediary -DeviceName=PIC32MX360F512L -LanguageToolSuiteID={14495C23-81F8-43F3-8A44-859C583D7760} -LanguageToolID={430F471F-7ECB-4852-A80D-DEF9A5C8E751} -LanguageToolLocation=C:\Devtools\Microchip\MPLAB C32\bin\pic32-gcc.exe -PPAD=$(BINDIR)||$(TMPDIR)||$(AINDIR)|..\..\Source\portable\MPLAB\PIC32MX;.||$(INCDIR)|.;.;..\common\include;..\..\source\portable\mplab\pic32mx;..\..\source\include||$(LIBDIR)||$(LKRDIR)|| -SOLK=|main.c|ParTest\ParTest.c|..\..\Source\portable\MPLAB\PIC32MX\port.c|..\..\Source\list.c|..\..\Source\queue.c|..\..\Source\tasks.c|..\..\Source\portable\MPLAB\PIC32MX\port_asm.S|RegisterTestTasks.s|..\..\Source\portable\MemMang\heap_2.c|..\Common\Minimal\flash.c|..\Common\Minimal\QPeek.c|..\Common\Minimal\semtest.c|..\Common\Minimal\GenQTest.c|..\Common\Minimal\blocktim.c|lcd.c|serial\serial.c|..\Common\Minimal\comtest.c|serial\serial_isr.S|timertest.c|timertest_isr.S|C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\Common\Minimal\IntQueue.c|IntQueueTimer.c|IntQueueTimer_isr.S|printf-stdarg.c|||||||| -SuiteArgsString= -ToolArgsString=-g -DMPLAB_PIC32MX_PORT -Wall -O3 -fomit-frame-pointer -TraceCmdString= -[File024] -Location=C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\PIC32MX_MPLAB\RTOSDemo.elf -Folder=Output -DeviceName=PIC32MX360F512L -LanguageToolSuiteID={14495C23-81F8-43F3-8A44-859C583D7760} -LanguageToolID={C68E5105-1196-4333-A0BF-3DC57271E614} -LanguageToolLocation=C:\Devtools\Microchip\MPLAB C32\bin\pic32-ld.exe -PPAD=$(BINDIR)||$(TMPDIR)||$(AINDIR)|..\..\Source\portable\MPLAB\PIC32MX;.||$(INCDIR)|.;.;..\common\include;..\..\source\portable\mplab\pic32mx;..\..\source\include||$(LIBDIR)||$(LKRDIR)|| -SOLK=|main.c|ParTest\ParTest.c|..\..\Source\portable\MPLAB\PIC32MX\port.c|..\..\Source\list.c|..\..\Source\queue.c|..\..\Source\tasks.c|..\..\Source\portable\MPLAB\PIC32MX\port_asm.S|RegisterTestTasks.s|..\..\Source\portable\MemMang\heap_2.c|..\Common\Minimal\flash.c|..\Common\Minimal\QPeek.c|..\Common\Minimal\semtest.c|..\Common\Minimal\GenQTest.c|..\Common\Minimal\blocktim.c|lcd.c|serial\serial.c|..\Common\Minimal\comtest.c|serial\serial_isr.S|timertest.c|timertest_isr.S|C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\Common\Minimal\IntQueue.c|IntQueueTimer.c|IntQueueTimer_isr.S|printf-stdarg.c|||||||| -SuiteArgsString= -ToolArgsString=--defsym=_min_heap_size=0 --defsym=_min_heap_size=0 -Map="$(BINDIR_)$(TARGETBASE).map" -o"$(BINDIR_)$(TARGETBASE).$(TARGETSUFFIX)" -O3 -TraceCmdString= -[File025] -Location=C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\PIC32MX_MPLAB\RTOSDemo.hex -Folder=Output -DeviceName=PIC32MX360F512L -LanguageToolSuiteID={14495C23-81F8-43F3-8A44-859C583D7760} -LanguageToolID={C68E5105-1196-4333-A0BF-3DC57271E614} -LanguageToolLocation=C:\Devtools\Microchip\MPLAB C32\bin\pic32-ld.exe -PPAD=$(BINDIR)||$(TMPDIR)||$(AINDIR)|..\..\Source\portable\MPLAB\PIC32MX;.||$(INCDIR)|.;.;..\common\include;..\..\source\portable\mplab\pic32mx;..\..\source\include||$(LIBDIR)||$(LKRDIR)|| -SOLK=|main.c|ParTest\ParTest.c|..\..\Source\portable\MPLAB\PIC32MX\port.c|..\..\Source\list.c|..\..\Source\queue.c|..\..\Source\tasks.c|..\..\Source\portable\MPLAB\PIC32MX\port_asm.S|RegisterTestTasks.s|..\..\Source\portable\MemMang\heap_2.c|..\Common\Minimal\flash.c|..\Common\Minimal\QPeek.c|..\Common\Minimal\semtest.c|..\Common\Minimal\GenQTest.c|..\Common\Minimal\blocktim.c|lcd.c|serial\serial.c|..\Common\Minimal\comtest.c|serial\serial_isr.S|timertest.c|timertest_isr.S|C:\E\Dev\FreeRTOS\WorkingCopy2\Demo\Common\Minimal\IntQueue.c|IntQueueTimer.c|IntQueueTimer_isr.S|printf-stdarg.c|||||||| -SuiteArgsString= -ToolArgsString=--defsym=_min_heap_size=0 --defsym=_min_heap_size=0 -Map="$(BINDIR_)$(TARGETBASE).map" -o"$(BINDIR_)$(TARGETBASE).$(TARGETSUFFIX)" -O3 -TraceCmdString= [TOOL_LOC_STAMPS] tool_loc{92E15EC6-5E91-4BF4-B5FA-C80AD2601AA7}=C:\Devtools\Microchip\MPLAB C32\bin\pic32-as.exe tool_loc{430F471F-7ECB-4852-A80D-DEF9A5C8E751}=C:\Devtools\Microchip\MPLAB C32\bin\pic32-gcc.exe diff --git a/Demo/PIC32MX_MPLAB/RTOSDemo.mcw b/Demo/PIC32MX_MPLAB/RTOSDemo.mcw index 583a0e721..60a29c2be 100644 Binary files a/Demo/PIC32MX_MPLAB/RTOSDemo.mcw and b/Demo/PIC32MX_MPLAB/RTOSDemo.mcw differ diff --git a/Demo/PIC32MX_MPLAB/RegisterTestTasks.s b/Demo/PIC32MX_MPLAB/RegisterTestTasks.s index 0fad055f3..122ddbf84 100644 --- a/Demo/PIC32MX_MPLAB/RegisterTestTasks.s +++ b/Demo/PIC32MX_MPLAB/RegisterTestTasks.s @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/PIC32MX_MPLAB/lcd.c b/Demo/PIC32MX_MPLAB/lcd.c index b555f90e9..1d829c841 100644 --- a/Demo/PIC32MX_MPLAB/lcd.c +++ b/Demo/PIC32MX_MPLAB/lcd.c @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/PIC32MX_MPLAB/lcd.h b/Demo/PIC32MX_MPLAB/lcd.h index 171d71381..60e536bad 100644 --- a/Demo/PIC32MX_MPLAB/lcd.h +++ b/Demo/PIC32MX_MPLAB/lcd.h @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/PIC32MX_MPLAB/main.c b/Demo/PIC32MX_MPLAB/main.c index 3b1bc954c..a6081e866 100644 --- a/Demo/PIC32MX_MPLAB/main.c +++ b/Demo/PIC32MX_MPLAB/main.c @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. @@ -53,15 +53,6 @@ * In addition to the standard demo tasks, the following tasks and tests are * defined and/or created within this file: * - * "Fast Interrupt Test" - A high frequency periodic interrupt is generated - * using a free running timer to demonstrate the use of the - * configKERNEL_INTERRUPT_PRIORITY configuration constant. The interrupt - * service routine measures the number of processor clocks that occur between - * each interrupt - and in so doing measures the jitter in the interrupt timing. - * The maximum measured jitter time is latched in the ulMaxJitter variable, and - * displayed on the LCD display by the 'LCD' task as described below. The - * fast interrupt is configured and handled in the timertest.c source file. - * * "LCD" task - the LCD task is a 'gatekeeper' task. It is the only task that * is permitted to access the display directly. Other tasks wishing to write a * message to the LCD send the message on a queue to the LCD task instead of @@ -73,8 +64,9 @@ * check that all the standard demo tasks are still operational. Should any * unexpected behaviour within a demo task be discovered the check task will * write an error to the LCD (via the LCD task). If all the demo tasks are - * executing with their expected behaviour then the check task writes the - * maximum jitter time to the LCD (as described above) - again via the LCD task. + * executing with their expected behaviour then the check task instead writes + * a count of the number of times the high frequency interrupt has incremented + * ulHighFrequencyTimerInterrupts - which is one in every 20,000 interrupts. * * "Register test" tasks - These tasks are used in part to test the kernel port. * They set each processor register to a known value, then check that the @@ -82,6 +74,26 @@ * to different values, and will get swapping in and out between setting and * then subsequently checking the register values. Discovery of an incorrect * value would be indicative of an error in the task switching mechanism. + * + * By way of demonstration, the demo application defines + * configMAX_SYSCALL_INTERRUPT_PRIORITY to be 3, configKERNEL_INTERRUPT_PRIORITY + * to be 1, and all other interrupts as follows: + * + * + The UART is allocated a priority of 2. This means it can interrupt the + * RTOS tick, and can also safely use queues. + * + Two timers are configured to generate interrupts just to test the nesting + * and queue access mechanisms. These timers are allocated priorities 2 and 3 + * respectively. Even though they both access the same two queues, the + * priority 3 interrupt can safely interrupt the priority 2 interrupt. Both + * can interrupt the RTOS tick. + * + Finally a high frequency timer interrupt is configured to use priority 4 - + * therefore kernel activity will never prevent the high frequency timer from + * executing immediately that the interrupt is raised (within the limitations + * of the hardware itself). It would not be safe to access a queue from this + * interrupt as it is above configMAX_SYSCALL_INTERRUPT_PRIORITY. + * + * See the online documentation for this demo for more information on interrupt + * usage. */ /* Standard includes. */ @@ -104,7 +116,7 @@ #include "timertest.h" #include "IntQueue.h" -#pragma config FPLLMUL = MUL_18, FPLLIDIV = DIV_2, FPLLODIV = DIV_1, FWDTEN = OFF +#pragma config FPLLMUL = MUL_20, FPLLIDIV = DIV_2, FPLLODIV = DIV_1, FWDTEN = OFF #pragma config POSCMOD = HS, FNOSC = PRIPLL, FPBDIV = DIV_2 /*-----------------------------------------------------------*/ @@ -138,8 +150,8 @@ See the comtest.c file for more information. */ /* Misc. */ #define mainDONT_WAIT ( 0 ) -/* Dimension the buffer used to hold the value of the maximum jitter time when -it is converted to a string. */ +/* Dimension the buffer used to hold the value of the high frequency timer +count when it is converted to a string. */ #define mainMAX_STRING_LENGTH ( 20 ) /* The frequency at which the "fast interrupt test" interrupt will occur. */ @@ -262,7 +274,8 @@ extern void vRegTest2( unsigned long * ); static void prvSetupHardware( void ) { /* Set the system and peripheral bus speeds and enable the program cache*/ - SYSTEMConfigPerformance( configCPU_CLOCK_HZ ); + SYSTEMConfigPerformance( configCPU_CLOCK_HZ - 1 ); + mOSCSetPBDIV( OSC_PB_DIV_2 ); /* Setup to use the external interrupt controller. */ INTEnableSystemMultiVectoredInt(); @@ -279,11 +292,11 @@ static void prvCheckTask( void *pvParameters ) unsigned portLONG ulLastRegTest1Value = 0, ulLastRegTest2Value = 0, ulTicksToWait = mainNO_ERROR_PERIOD; portTickType xLastExecutionTime; -/* Buffer into which the maximum jitter time is written as a string. */ +/* Buffer into which the high frequency timer count is written as a string. */ static portCHAR cStringBuffer[ mainMAX_STRING_LENGTH ]; -/* The maximum jitter time measured by the fast interrupt test. */ -extern unsigned portLONG ulMaxJitter ; +/* The count of the high frequency timer interrupts. */ +extern unsigned portLONG ulHighFrequencyTimerInterrupts; xLCDMessage xMessage = { ( 200 / portTICK_RATE_MS ), cStringBuffer }; /* Setup the high frequency, high priority, timer test. It is setup here @@ -357,9 +370,9 @@ xLCDMessage xMessage = { ( 200 / portTICK_RATE_MS ), cStringBuffer }; xMessage.pcMessage = "Error: Int queue"; } - /* Write the max jitter time to the string buffer. It will only be - displayed if no errors have been detected. */ - sprintf( cStringBuffer, "%dns max jitter", ( int ) ( ( ulMaxJitter - mainEXPECTED_CLOCKS_BETWEEN_INTERRUPTS ) * mainNS_PER_CLOCK ) ); + /* Write the ulHighFrequencyTimerInterrupts value to the string + buffer. It will only be displayed if no errors have been detected. */ + sprintf( cStringBuffer, "Pass %u", ( unsigned int ) ulHighFrequencyTimerInterrupts ); xQueueSend( xLCDQueue, &xMessage, mainDONT_WAIT ); vParTestToggleLED( mainCHECK_LED ); @@ -369,6 +382,7 @@ xLCDMessage xMessage = { ( 200 / portTICK_RATE_MS ), cStringBuffer }; void vApplicationStackOverflowHook( void ) { + /* Look at pxCurrentTCB to see which task overflowed its stack. */ for( ;; ); } /*-----------------------------------------------------------*/ diff --git a/Demo/PIC32MX_MPLAB/serial/serial.c b/Demo/PIC32MX_MPLAB/serial/serial.c index eccbb7e83..724d3629d 100644 --- a/Demo/PIC32MX_MPLAB/serial/serial.c +++ b/Demo/PIC32MX_MPLAB/serial/serial.c @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/PIC32MX_MPLAB/timertest.c b/Demo/PIC32MX_MPLAB/timertest.c index 10d0371f2..edb40356d 100644 --- a/Demo/PIC32MX_MPLAB/timertest.c +++ b/Demo/PIC32MX_MPLAB/timertest.c @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. @@ -53,12 +53,6 @@ /* Scheduler includes. */ #include "FreeRTOS.h" -/* Demo includes. */ -#include "partest.h" - -/* The number of interrupts to pass before we start looking at the jitter. */ -#define timerSETTLE_TIME 200 - /* The maximum value the 16bit timer can contain. */ #define timerMAX_COUNT 0xffff @@ -67,21 +61,26 @@ void __attribute__( (interrupt(ipl0), vector(_TIMER_2_VECTOR))) vT2InterruptWrap /*-----------------------------------------------------------*/ -/* The maximum time (in processor clocks) between two consecutive timer -interrupts so far. */ -unsigned portLONG ulMaxJitter = 0; +/* Incremented every 20,000 interrupts, so should count in seconds. */ +unsigned portLONG ulHighFrequencyTimerInterrupts = 0; + +/* The frequency at which the timer is interrupting. */ +static unsigned portLONG ulFrequencyHz; /*-----------------------------------------------------------*/ void vSetupTimerTest( unsigned portSHORT usFrequencyHz ) { - /* T2 is used to generate interrupts. The core timer is used to provide an - accurate time measurement. */ + /* Remember the frequency so it can be used from the ISR. */ + ulFrequencyHz = ( unsigned portLONG ) usFrequencyHz; + + /* T2 is used to generate interrupts above the kernel and max syscall interrupt + priority. */ T2CON = 0; TMR2 = 0; /* Timer 2 is going to interrupt at usFrequencyHz Hz. */ - PR2 = ( unsigned portSHORT ) ( configPERIPHERAL_CLOCK_HZ / ( unsigned portLONG ) usFrequencyHz ); + PR2 = ( unsigned portSHORT ) ( ( configPERIPHERAL_CLOCK_HZ / ( unsigned portLONG ) usFrequencyHz ) - 1 ); /* Setup timer 2 interrupt priority to be above the kernel priority so the timer jitter is not effected by the kernel activity. */ @@ -100,38 +99,18 @@ void vSetupTimerTest( unsigned portSHORT usFrequencyHz ) void vT2InterruptHandler( void ) { -static unsigned portLONG ulLastCount = 0, ulSettleCount = 0; -static unsigned portLONG ulThisCount, ulDifference; +static unsigned portLONG ulCalls = 0; - /* Capture the timer value as we enter the interrupt. */ - ulThisCount = _CP0_GET_COUNT(); - - if( ulSettleCount >= timerSETTLE_TIME ) - { - /* What is the difference between the timer value in this interrupt - and the value from the last interrupt. */ - ulDifference = ulThisCount - ulLastCount; - - /* Store the difference in the timer values if it is larger than the - currently stored largest value. The difference over and above the - expected difference will give the 'jitter' in the processing of these - interrupts. */ - if( ulDifference > ulMaxJitter ) - { - ulMaxJitter = ulDifference; - } - } - else + ++ulCalls; + if( ulCalls >= ulFrequencyHz ) { - /* Don't bother storing any values for the first couple of - interrupts. */ - ulSettleCount++; + /* Increment the count that will be shown on the LCD. + The increment occurs once every 20,000 interrupts so + ulHighFrequencyTimerInterrupts should count in seconds. */ + ulHighFrequencyTimerInterrupts++; + ulCalls = 0; } - /* Remember what the timer value was this time through, so we can calculate - the difference the next time through. */ - ulLastCount = ulThisCount; - /* Clear the timer interrupt. */ IFS0bits.T2IF = 0; } diff --git a/Demo/PIC32MX_MPLAB/timertest.h b/Demo/PIC32MX_MPLAB/timertest.h index a439b31c1..e752ebe39 100644 --- a/Demo/PIC32MX_MPLAB/timertest.h +++ b/Demo/PIC32MX_MPLAB/timertest.h @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/PIC32MX_MPLAB/timertest_isr.S b/Demo/PIC32MX_MPLAB/timertest_isr.S index a929b6adc..3528043b7 100644 --- a/Demo/PIC32MX_MPLAB/timertest_isr.S +++ b/Demo/PIC32MX_MPLAB/timertest_isr.S @@ -1,3 +1,52 @@ +/* + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. + + This file is part of the FreeRTOS.org distribution. + + FreeRTOS.org is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + FreeRTOS.org is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with FreeRTOS.org; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + A special exception to the GPL can be applied should you wish to distribute + a combined work that includes FreeRTOS.org, without being obliged to provide + the source code for any proprietary components. See the licensing section + of http://www.FreeRTOS.org for full details of how and when the exception + can be applied. + + *************************************************************************** + *************************************************************************** + * * + * SAVE TIME AND MONEY! We can port FreeRTOS.org to your own hardware, * + * and even write all or part of your application on your behalf. * + * See http://www.OpenRTOS.com for details of the services we provide to * + * expedite your project. * + * * + *************************************************************************** + *************************************************************************** + + Please ensure to read the configuration and relevant port sections of the + online documentation. + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + #include #include #include "ISR_Support.h" diff --git a/Demo/PPC405_FPU_Xilinx_Virtex4_GCC/RTOSDemo/FreeRTOSConfig.h b/Demo/PPC405_FPU_Xilinx_Virtex4_GCC/RTOSDemo/FreeRTOSConfig.h index 742c82021..142964bed 100644 --- a/Demo/PPC405_FPU_Xilinx_Virtex4_GCC/RTOSDemo/FreeRTOSConfig.h +++ b/Demo/PPC405_FPU_Xilinx_Virtex4_GCC/RTOSDemo/FreeRTOSConfig.h @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/PPC405_FPU_Xilinx_Virtex4_GCC/RTOSDemo/flop/flop-reg-test.c b/Demo/PPC405_FPU_Xilinx_Virtex4_GCC/RTOSDemo/flop/flop-reg-test.c index 355084dd4..2b19bd359 100644 --- a/Demo/PPC405_FPU_Xilinx_Virtex4_GCC/RTOSDemo/flop/flop-reg-test.c +++ b/Demo/PPC405_FPU_Xilinx_Virtex4_GCC/RTOSDemo/flop/flop-reg-test.c @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/PPC405_FPU_Xilinx_Virtex4_GCC/RTOSDemo/flop/flop-reg-test.h b/Demo/PPC405_FPU_Xilinx_Virtex4_GCC/RTOSDemo/flop/flop-reg-test.h index ecf30d506..56da50693 100644 --- a/Demo/PPC405_FPU_Xilinx_Virtex4_GCC/RTOSDemo/flop/flop-reg-test.h +++ b/Demo/PPC405_FPU_Xilinx_Virtex4_GCC/RTOSDemo/flop/flop-reg-test.h @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/PPC405_FPU_Xilinx_Virtex4_GCC/RTOSDemo/flop/flop.c b/Demo/PPC405_FPU_Xilinx_Virtex4_GCC/RTOSDemo/flop/flop.c index 563295647..a50b6bfb8 100644 --- a/Demo/PPC405_FPU_Xilinx_Virtex4_GCC/RTOSDemo/flop/flop.c +++ b/Demo/PPC405_FPU_Xilinx_Virtex4_GCC/RTOSDemo/flop/flop.c @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/PPC405_FPU_Xilinx_Virtex4_GCC/RTOSDemo/main.c b/Demo/PPC405_FPU_Xilinx_Virtex4_GCC/RTOSDemo/main.c index 557ecafe3..96186513c 100644 --- a/Demo/PPC405_FPU_Xilinx_Virtex4_GCC/RTOSDemo/main.c +++ b/Demo/PPC405_FPU_Xilinx_Virtex4_GCC/RTOSDemo/main.c @@ -1,699 +1,699 @@ -/* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. - - This file is part of the FreeRTOS.org distribution. - - FreeRTOS.org is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - FreeRTOS.org is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with FreeRTOS.org; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - A special exception to the GPL can be applied should you wish to distribute - a combined work that includes FreeRTOS.org, without being obliged to provide - the source code for any proprietary components. See the licensing section - of http://www.FreeRTOS.org for full details of how and when the exception - can be applied. - - *************************************************************************** - *************************************************************************** - * * - * SAVE TIME AND MONEY! We can port FreeRTOS.org to your own hardware, * - * and even write all or part of your application on your behalf. * - * See http://www.OpenRTOS.com for details of the services we provide to * - * expedite your project. * - * * - *************************************************************************** - *************************************************************************** - - Please ensure to read the configuration and relevant port sections of the - online documentation. - - http://www.FreeRTOS.org - Documentation, latest information, license and - contact details. - - http://www.SafeRTOS.com - A version that is certified for use in safety - critical systems. - - http://www.OpenRTOS.com - Commercial support, development, porting, - licensing and training services. -*/ - -/* - * Creates all the demo application tasks, then starts the scheduler. The WEB - * documentation provides more details of the demo application tasks. - * - * In addition to the standard demo tasks, the follow demo specific tasks are - * create: - * - * The "Check" task. This only executes every three seconds but has the highest - * priority so is guaranteed to get processor time. Its main function is to - * check that all the other tasks are still operational. Most tasks maintain - * a unique count that is incremented each time the task successfully completes - * its function. Should any error occur within such a task the count is - * permanently halted. The check task inspects the count of each task to ensure - * it has changed since the last time the check task executed. If all the count - * variables have changed all the tasks are still executing error free, and the - * check task toggles the onboard LED. Should any task contain an error at any time - * the LED toggle rate will change from 3 seconds to 500ms. - * - * The "Register Check" tasks. These tasks fill the CPU registers with known - * values, then check that each register still contains the expected value, the - * discovery of an unexpected value being indicative of an error in the RTOS - * context switch mechanism. The register check tasks operate at low priority - * so are switched in and out frequently. - * - */ - -/* Scheduler includes. */ -#include "FreeRTOS.h" -#include "task.h" - -/* Xilinx library includes. */ -#include "xcache_l.h" -#include "xintc.h" - -/* Demo application includes. */ -#include "flash.h" -#include "integer.h" -#include "comtest2.h" -#include "semtest.h" -#include "BlockQ.h" -#include "dynamic.h" -#include "GenQTest.h" -#include "QPeek.h" -#include "blocktim.h" -#include "death.h" -#include "partest.h" -#include "countsem.h" -#include "recmutex.h" -#include "flop.h" -#include "flop-reg-test.h" - -/* Priorities assigned to the demo tasks. */ -#define mainCHECK_TASK_PRIORITY ( tskIDLE_PRIORITY + 4 ) -#define mainSEM_TEST_PRIORITY ( tskIDLE_PRIORITY + 2 ) -#define mainCOM_TEST_PRIORITY ( tskIDLE_PRIORITY + 1 ) -#define mainQUEUE_BLOCK_PRIORITY ( tskIDLE_PRIORITY + 1 ) -#define mainDEATH_PRIORITY ( tskIDLE_PRIORITY + 1 ) -#define mainLED_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 ) -#define mainGENERIC_QUEUE_PRIORITY ( tskIDLE_PRIORITY ) -#define mainQUEUE_POLL_PRIORITY ( tskIDLE_PRIORITY + 1 ) -#define mainFLOP_PRIORITY ( tskIDLE_PRIORITY ) - -/* The first LED used by the COM test and check tasks respectively. */ -#define mainCOM_TEST_LED ( 4 ) -#define mainCHECK_TEST_LED ( 3 ) - -/* The baud rate used by the comtest tasks is set by the hardware, so the -baud rate parameters passed into the comtest initialisation has no effect. */ -#define mainBAUD_SET_IN_HARDWARE ( 0 ) - -/* Delay periods used by the check task. If no errors have been found then -the check LED will toggle every mainNO_ERROR_CHECK_DELAY milliseconds. If an -error has been found at any time then the toggle rate will increase to -mainERROR_CHECK_DELAY milliseconds. */ -#define mainNO_ERROR_CHECK_DELAY ( ( portTickType ) 3000 / portTICK_RATE_MS ) -#define mainERROR_CHECK_DELAY ( ( portTickType ) 500 / portTICK_RATE_MS ) - - -/* - * The tasks defined within this file - described within the comments at the - * head of this page. - */ -static void prvRegTestTask1( void *pvParameters ); -static void prvRegTestTask2( void *pvParameters ); -static void prvErrorChecks( void *pvParameters ); - -/* - * Called by the 'check' task to inspect all the standard demo tasks within - * the system, as described within the comments at the head of this page. - */ -static portBASE_TYPE prvCheckOtherTasksAreStillRunning( void ); - -/* - * Perform any hardware initialisation required by the demo application. - */ -static void prvSetupHardware( void ); - -/*-----------------------------------------------------------*/ - -/* xRegTestStatus will get set to pdFAIL by the regtest tasks if they -discover an unexpected value. */ -static volatile unsigned portBASE_TYPE xRegTestStatus = pdPASS; - -/* Counters used to ensure the regtest tasks are still running. */ -static volatile unsigned portLONG ulRegTest1Counter = 0UL, ulRegTest2Counter = 0UL; - -/*-----------------------------------------------------------*/ - -int main( void ) -{ - - /* Must be called prior to installing any interrupt handlers! */ - vPortSetupInterruptController(); - - /* In this case prvSetupHardware() just enables the caches and and - configures the IO ports for the LED outputs. */ - prvSetupHardware(); - - /* Start the standard demo application tasks. Note that the baud rate used - by the comtest tasks is set by the hardware, so the baud rate parameter - passed has no effect. */ - vStartLEDFlashTasks( mainLED_TASK_PRIORITY ); - vStartIntegerMathTasks( tskIDLE_PRIORITY ); - vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainBAUD_SET_IN_HARDWARE, mainCOM_TEST_LED ); - vStartSemaphoreTasks( mainSEM_TEST_PRIORITY ); - vStartBlockingQueueTasks ( mainQUEUE_BLOCK_PRIORITY ); - vStartDynamicPriorityTasks(); - vStartGenericQueueTasks( mainGENERIC_QUEUE_PRIORITY ); - vStartQueuePeekTasks(); - vCreateBlockTimeTasks(); - vStartCountingSemaphoreTasks(); - vStartRecursiveMutexTasks(); - - #if ( configUSE_FPU == 1 ) - vStartMathTasks( mainFLOP_PRIORITY ); - vStartFlopRegTests(); - #endif - - /* Create the tasks defined within this file. */ - xTaskCreate( prvRegTestTask1, ( signed portCHAR * ) "Regtest1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL ); - xTaskCreate( prvRegTestTask2, ( signed portCHAR * ) "Regtest2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL ); - xTaskCreate( prvErrorChecks, ( signed portCHAR * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL ); - - /* The suicide tasks must be started last as they record the number of other - tasks that exist within the system. The value is then used to ensure at run - time the number of tasks that exists is within expected bounds. */ - vCreateSuicidalTasks( mainDEATH_PRIORITY ); - - /* Now start the scheduler. Following this call the created tasks should - be executing. */ - vTaskStartScheduler(); - - /* vTaskStartScheduler() will only return if an error occurs while the - idle task is being created. */ - for( ;; ); - - return 0; -} -/*-----------------------------------------------------------*/ - -static portBASE_TYPE prvCheckOtherTasksAreStillRunning( void ) -{ -portBASE_TYPE lReturn = pdPASS; -static unsigned portLONG ulLastRegTest1Counter= 0UL, ulLastRegTest2Counter = 0UL; - - /* The demo tasks maintain a count that increments every cycle of the task - provided that the task has never encountered an error. This function - checks the counts maintained by the tasks to ensure they are still being - incremented. A count remaining at the same value between calls therefore - indicates that an error has been detected. */ - - if( xAreIntegerMathsTaskStillRunning() != pdTRUE ) - { - lReturn = pdFAIL; - } - - if( xAreComTestTasksStillRunning() != pdTRUE ) - { - lReturn = pdFAIL; - } - - if( xAreSemaphoreTasksStillRunning() != pdTRUE ) - { - lReturn = pdFAIL; - } - - if( xAreBlockingQueuesStillRunning() != pdTRUE ) - { - lReturn = pdFAIL; - } - - if( xAreDynamicPriorityTasksStillRunning() != pdTRUE ) - { - lReturn = pdFAIL; - } - - if( xIsCreateTaskStillRunning() != pdTRUE ) - { - lReturn = pdFAIL; - } - - if( xAreBlockTimeTestTasksStillRunning() != pdTRUE ) - { - lReturn = pdFAIL; - } - - if( xAreGenericQueueTasksStillRunning() != pdTRUE ) - { - lReturn = pdFAIL; - } - - if( xAreQueuePeekTasksStillRunning() != pdTRUE ) - { - lReturn = pdFAIL; - } - - if( xAreCountingSemaphoreTasksStillRunning() != pdTRUE ) - { - lReturn = pdFAIL; - } - - if( xAreRecursiveMutexTasksStillRunning() != pdTRUE ) - { - lReturn = pdFAIL; - } - - #if ( configUSE_FPU == 1 ) - if( xAreMathsTaskStillRunning() != pdTRUE ) - { - lReturn = pdFAIL; - } - - if( xAreFlopRegisterTestsStillRunning() != pdTRUE ) - { - lReturn = pdFAIL; - } - #endif - - /* Have the register test tasks found any errors? */ - if( xRegTestStatus != pdPASS ) - { - lReturn = pdFAIL; - } - - /* Are the register test tasks still looping? */ - if( ulLastRegTest1Counter == ulRegTest1Counter ) - { - lReturn = pdFAIL; - } - else - { - ulLastRegTest1Counter = ulRegTest1Counter; - } - - if( ulLastRegTest2Counter == ulRegTest2Counter ) - { - lReturn = pdFAIL; - } - else - { - ulLastRegTest2Counter = ulRegTest2Counter; - } - - return lReturn; -} -/*-----------------------------------------------------------*/ - -static void prvErrorChecks( void *pvParameters ) -{ -portTickType xDelayPeriod = mainNO_ERROR_CHECK_DELAY, xLastExecutionTime; -volatile unsigned portBASE_TYPE uxFreeStack; - - /* Just to remove compiler warning. */ - ( void ) pvParameters; - - /* This call is just to demonstrate the use of the function - nothing is - done with the value. You would expect the stack high water mark to be - lower (the function to return a larger value) here at function entry than - later following calls to other functions. */ - uxFreeStack = uxTaskGetStackHighWaterMark( NULL ); - - /* Initialise xLastExecutionTime so the first call to vTaskDelayUntil() - works correctly. */ - xLastExecutionTime = xTaskGetTickCount(); - - /* Cycle for ever, delaying then checking all the other tasks are still - operating without error. */ - for( ;; ) - { - /* Again just for demo purposes - uxFreeStack should have a lower value - here than following the call to uxTaskGetStackHighWaterMark() on the - task entry. */ - uxFreeStack = uxTaskGetStackHighWaterMark( NULL ); - - /* Wait until it is time to check again. The time we wait here depends - on whether an error has been detected or not. When an error is - detected the time is shortened resulting in a faster LED flash rate. */ - vTaskDelayUntil( &xLastExecutionTime, xDelayPeriod ); - - /* See if the other tasks are all ok. */ - if( prvCheckOtherTasksAreStillRunning() != pdPASS ) - { - /* An error occurred in one of the tasks so shorten the delay - period - which has the effect of increasing the frequency of the - LED toggle. */ - xDelayPeriod = mainERROR_CHECK_DELAY; - } - - /* Flash! */ - vParTestToggleLED( mainCHECK_TEST_LED ); - } -} -/*-----------------------------------------------------------*/ - -static void prvSetupHardware( void ) -{ - XCache_EnableICache( 0x80000000 ); - XCache_EnableDCache( 0x80000000 ); - - /* Setup the IO port for use with the LED outputs. */ - vParTestInitialise(); -} -/*-----------------------------------------------------------*/ - -void prvRegTest1Pass( void ) -{ - /* Called from the inline assembler - this cannot be static - otherwise it can get optimised away. */ - ulRegTest1Counter++; -} -/*-----------------------------------------------------------*/ - -void prvRegTest2Pass( void ) -{ - /* Called from the inline assembler - this cannot be static - otherwise it can get optimised away. */ - ulRegTest2Counter++; -} -/*-----------------------------------------------------------*/ - -void prvRegTestFail( void ) -{ - /* Called from the inline assembler - this cannot be static - otherwise it can get optimised away. */ - xRegTestStatus = pdFAIL; -} -/*-----------------------------------------------------------*/ - -static void prvRegTestTask1( void *pvParameters ) +/* + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. + + This file is part of the FreeRTOS.org distribution. + + FreeRTOS.org is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + FreeRTOS.org is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with FreeRTOS.org; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + A special exception to the GPL can be applied should you wish to distribute + a combined work that includes FreeRTOS.org, without being obliged to provide + the source code for any proprietary components. See the licensing section + of http://www.FreeRTOS.org for full details of how and when the exception + can be applied. + + *************************************************************************** + *************************************************************************** + * * + * SAVE TIME AND MONEY! We can port FreeRTOS.org to your own hardware, * + * and even write all or part of your application on your behalf. * + * See http://www.OpenRTOS.com for details of the services we provide to * + * expedite your project. * + * * + *************************************************************************** + *************************************************************************** + + Please ensure to read the configuration and relevant port sections of the + online documentation. + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* + * Creates all the demo application tasks, then starts the scheduler. The WEB + * documentation provides more details of the demo application tasks. + * + * In addition to the standard demo tasks, the follow demo specific tasks are + * create: + * + * The "Check" task. This only executes every three seconds but has the highest + * priority so is guaranteed to get processor time. Its main function is to + * check that all the other tasks are still operational. Most tasks maintain + * a unique count that is incremented each time the task successfully completes + * its function. Should any error occur within such a task the count is + * permanently halted. The check task inspects the count of each task to ensure + * it has changed since the last time the check task executed. If all the count + * variables have changed all the tasks are still executing error free, and the + * check task toggles the onboard LED. Should any task contain an error at any time + * the LED toggle rate will change from 3 seconds to 500ms. + * + * The "Register Check" tasks. These tasks fill the CPU registers with known + * values, then check that each register still contains the expected value, the + * discovery of an unexpected value being indicative of an error in the RTOS + * context switch mechanism. The register check tasks operate at low priority + * so are switched in and out frequently. + * + */ + +/* Scheduler includes. */ +#include "FreeRTOS.h" +#include "task.h" + +/* Xilinx library includes. */ +#include "xcache_l.h" +#include "xintc.h" + +/* Demo application includes. */ +#include "flash.h" +#include "integer.h" +#include "comtest2.h" +#include "semtest.h" +#include "BlockQ.h" +#include "dynamic.h" +#include "GenQTest.h" +#include "QPeek.h" +#include "blocktim.h" +#include "death.h" +#include "partest.h" +#include "countsem.h" +#include "recmutex.h" +#include "flop.h" +#include "flop-reg-test.h" + +/* Priorities assigned to the demo tasks. */ +#define mainCHECK_TASK_PRIORITY ( tskIDLE_PRIORITY + 4 ) +#define mainSEM_TEST_PRIORITY ( tskIDLE_PRIORITY + 2 ) +#define mainCOM_TEST_PRIORITY ( tskIDLE_PRIORITY + 1 ) +#define mainQUEUE_BLOCK_PRIORITY ( tskIDLE_PRIORITY + 1 ) +#define mainDEATH_PRIORITY ( tskIDLE_PRIORITY + 1 ) +#define mainLED_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 ) +#define mainGENERIC_QUEUE_PRIORITY ( tskIDLE_PRIORITY ) +#define mainQUEUE_POLL_PRIORITY ( tskIDLE_PRIORITY + 1 ) +#define mainFLOP_PRIORITY ( tskIDLE_PRIORITY ) + +/* The first LED used by the COM test and check tasks respectively. */ +#define mainCOM_TEST_LED ( 4 ) +#define mainCHECK_TEST_LED ( 3 ) + +/* The baud rate used by the comtest tasks is set by the hardware, so the +baud rate parameters passed into the comtest initialisation has no effect. */ +#define mainBAUD_SET_IN_HARDWARE ( 0 ) + +/* Delay periods used by the check task. If no errors have been found then +the check LED will toggle every mainNO_ERROR_CHECK_DELAY milliseconds. If an +error has been found at any time then the toggle rate will increase to +mainERROR_CHECK_DELAY milliseconds. */ +#define mainNO_ERROR_CHECK_DELAY ( ( portTickType ) 3000 / portTICK_RATE_MS ) +#define mainERROR_CHECK_DELAY ( ( portTickType ) 500 / portTICK_RATE_MS ) + + +/* + * The tasks defined within this file - described within the comments at the + * head of this page. + */ +static void prvRegTestTask1( void *pvParameters ); +static void prvRegTestTask2( void *pvParameters ); +static void prvErrorChecks( void *pvParameters ); + +/* + * Called by the 'check' task to inspect all the standard demo tasks within + * the system, as described within the comments at the head of this page. + */ +static portBASE_TYPE prvCheckOtherTasksAreStillRunning( void ); + +/* + * Perform any hardware initialisation required by the demo application. + */ +static void prvSetupHardware( void ); + +/*-----------------------------------------------------------*/ + +/* xRegTestStatus will get set to pdFAIL by the regtest tasks if they +discover an unexpected value. */ +static volatile unsigned portBASE_TYPE xRegTestStatus = pdPASS; + +/* Counters used to ensure the regtest tasks are still running. */ +static volatile unsigned portLONG ulRegTest1Counter = 0UL, ulRegTest2Counter = 0UL; + +/*-----------------------------------------------------------*/ + +int main( void ) { - /* Just to remove compiler warning. */ - ( void ) pvParameters; - - /* The first register test task as described at the top of this file. The - values used in the registers are different to those use in the second - register test task. Also, unlike the second register test task, this task - yields between setting the register values and subsequently checking the - register values. */ - asm volatile - ( - "RegTest1Start: \n\t" \ - " \n\t" \ - " li 0, 301 \n\t" \ - " mtspr 256, 0 #USPRG0 \n\t" \ - " li 0, 501 \n\t" \ - " mtspr 8, 0 #LR \n\t" \ - " li 0, 4 \n\t" \ - " mtspr 1, 0 #XER \n\t" \ - " \n\t" \ - " li 0, 1 \n\t" \ - " li 2, 2 \n\t" \ - " li 3, 3 \n\t" \ - " li 4, 4 \n\t" \ - " li 5, 5 \n\t" \ - " li 6, 6 \n\t" \ - " li 7, 7 \n\t" \ - " li 8, 8 \n\t" \ - " li 9, 9 \n\t" \ - " li 10, 10 \n\t" \ - " li 11, 11 \n\t" \ - " li 12, 12 \n\t" \ - " li 13, 13 \n\t" \ - " li 14, 14 \n\t" \ - " li 15, 15 \n\t" \ - " li 16, 16 \n\t" \ - " li 17, 17 \n\t" \ - " li 18, 18 \n\t" \ - " li 19, 19 \n\t" \ - " li 20, 20 \n\t" \ - " li 21, 21 \n\t" \ - " li 22, 22 \n\t" \ - " li 23, 23 \n\t" \ - " li 24, 24 \n\t" \ - " li 25, 25 \n\t" \ - " li 26, 26 \n\t" \ - " li 27, 27 \n\t" \ - " li 28, 28 \n\t" \ - " li 29, 29 \n\t" \ - " li 30, 30 \n\t" \ - " li 31, 31 \n\t" \ - " \n\t" \ - " sc \n\t" \ - " nop \n\t" \ - " \n\t" \ - " cmpwi 0, 1 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 2, 2 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 3, 3 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 4, 4 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 5, 5 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 6, 6 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 7, 7 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 8, 8 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 9, 9 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 10, 10 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 11, 11 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 12, 12 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 13, 13 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 14, 14 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 15, 15 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 16, 16 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 17, 17 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 18, 18 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 19, 19 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 20, 20 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 21, 21 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 22, 22 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 23, 23 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 24, 24 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 25, 25 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 26, 26 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 27, 27 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 28, 28 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 29, 29 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 30, 30 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 31, 31 \n\t" \ - " bne RegTest1Fail \n\t" \ - " \n\t" \ - " mfspr 0, 256 #USPRG0 \n\t" \ - " cmpwi 0, 301 \n\t" \ - " bne RegTest1Fail \n\t" \ - " mfspr 0, 8 #LR \n\t" \ - " cmpwi 0, 501 \n\t" \ - " bne RegTest1Fail \n\t" \ - " mfspr 0, 1 #XER \n\t" \ - " cmpwi 0, 4 \n\t" \ - " bne RegTest1Fail \n\t" \ - " \n\t" \ - " bl prvRegTest1Pass \n\t" \ - " b RegTest1Start \n\t" \ - " \n\t" \ - "RegTest1Fail: \n\t" \ - " \n\t" \ - " \n\t" \ - " bl prvRegTestFail \n\t" \ - " b RegTest1Start \n\t" \ - ); -} -/*-----------------------------------------------------------*/ - -static void prvRegTestTask2( void *pvParameters ) + + /* Must be called prior to installing any interrupt handlers! */ + vPortSetupInterruptController(); + + /* In this case prvSetupHardware() just enables the caches and and + configures the IO ports for the LED outputs. */ + prvSetupHardware(); + + /* Start the standard demo application tasks. Note that the baud rate used + by the comtest tasks is set by the hardware, so the baud rate parameter + passed has no effect. */ + vStartLEDFlashTasks( mainLED_TASK_PRIORITY ); + vStartIntegerMathTasks( tskIDLE_PRIORITY ); + vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainBAUD_SET_IN_HARDWARE, mainCOM_TEST_LED ); + vStartSemaphoreTasks( mainSEM_TEST_PRIORITY ); + vStartBlockingQueueTasks ( mainQUEUE_BLOCK_PRIORITY ); + vStartDynamicPriorityTasks(); + vStartGenericQueueTasks( mainGENERIC_QUEUE_PRIORITY ); + vStartQueuePeekTasks(); + vCreateBlockTimeTasks(); + vStartCountingSemaphoreTasks(); + vStartRecursiveMutexTasks(); + + #if ( configUSE_FPU == 1 ) + vStartMathTasks( mainFLOP_PRIORITY ); + vStartFlopRegTests(); + #endif + + /* Create the tasks defined within this file. */ + xTaskCreate( prvRegTestTask1, ( signed portCHAR * ) "Regtest1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL ); + xTaskCreate( prvRegTestTask2, ( signed portCHAR * ) "Regtest2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL ); + xTaskCreate( prvErrorChecks, ( signed portCHAR * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL ); + + /* The suicide tasks must be started last as they record the number of other + tasks that exist within the system. The value is then used to ensure at run + time the number of tasks that exists is within expected bounds. */ + vCreateSuicidalTasks( mainDEATH_PRIORITY ); + + /* Now start the scheduler. Following this call the created tasks should + be executing. */ + vTaskStartScheduler(); + + /* vTaskStartScheduler() will only return if an error occurs while the + idle task is being created. */ + for( ;; ); + + return 0; +} +/*-----------------------------------------------------------*/ + +static portBASE_TYPE prvCheckOtherTasksAreStillRunning( void ) { - /* Just to remove compiler warning. */ - ( void ) pvParameters; - - /* The second register test task as described at the top of this file. - Note that this task fills the registers with different values to the - first register test task. */ - asm volatile - ( - "RegTest2Start: \n\t" \ - " \n\t" \ - " li 0, 300 \n\t" \ - " mtspr 256, 0 #USPRG0 \n\t" \ - " li 0, 500 \n\t" \ - " mtspr 8, 0 #LR \n\t" \ - " li 0, 4 \n\t" \ - " mtspr 1, 0 #XER \n\t" \ - " \n\t" \ - " li 0, 11 \n\t" \ - " li 2, 12 \n\t" \ - " li 3, 13 \n\t" \ - " li 4, 14 \n\t" \ - " li 5, 15 \n\t" \ - " li 6, 16 \n\t" \ - " li 7, 17 \n\t" \ - " li 8, 18 \n\t" \ - " li 9, 19 \n\t" \ - " li 10, 110 \n\t" \ - " li 11, 111 \n\t" \ - " li 12, 112 \n\t" \ - " li 13, 113 \n\t" \ - " li 14, 114 \n\t" \ - " li 15, 115 \n\t" \ - " li 16, 116 \n\t" \ - " li 17, 117 \n\t" \ - " li 18, 118 \n\t" \ - " li 19, 119 \n\t" \ - " li 20, 120 \n\t" \ - " li 21, 121 \n\t" \ - " li 22, 122 \n\t" \ - " li 23, 123 \n\t" \ - " li 24, 124 \n\t" \ - " li 25, 125 \n\t" \ - " li 26, 126 \n\t" \ - " li 27, 127 \n\t" \ - " li 28, 128 \n\t" \ - " li 29, 129 \n\t" \ - " li 30, 130 \n\t" \ - " li 31, 131 \n\t" \ - " \n\t" \ - " cmpwi 0, 11 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 2, 12 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 3, 13 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 4, 14 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 5, 15 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 6, 16 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 7, 17 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 8, 18 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 9, 19 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 10, 110 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 11, 111 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 12, 112 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 13, 113 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 14, 114 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 15, 115 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 16, 116 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 17, 117 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 18, 118 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 19, 119 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 20, 120 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 21, 121 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 22, 122 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 23, 123 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 24, 124 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 25, 125 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 26, 126 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 27, 127 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 28, 128 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 29, 129 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 30, 130 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 31, 131 \n\t" \ - " bne RegTest2Fail \n\t" \ - " \n\t" \ - " mfspr 0, 256 #USPRG0 \n\t" \ - " cmpwi 0, 300 \n\t" \ - " bne RegTest2Fail \n\t" \ - " mfspr 0, 8 #LR \n\t" \ - " cmpwi 0, 500 \n\t" \ - " bne RegTest2Fail \n\t" \ - " mfspr 0, 1 #XER \n\t" \ - " cmpwi 0, 4 \n\t" \ - " bne RegTest2Fail \n\t" \ - " \n\t" \ - " bl prvRegTest2Pass \n\t" \ - " b RegTest2Start \n\t" \ - " \n\t" \ - "RegTest2Fail: \n\t" \ - " \n\t" \ - " \n\t" \ - " bl prvRegTestFail \n\t" \ - " b RegTest2Start \n\t" \ - ); -} -/*-----------------------------------------------------------*/ - -/* This hook function will get called if there is a suspected stack overflow. -An overflow can cause the task name to be corrupted, in which case the task -handle needs to be used to determine the offending task. */ -void vApplicationStackOverflowHook( xTaskHandle xTask, signed portCHAR *pcTaskName ); -void vApplicationStackOverflowHook( xTaskHandle xTask, signed portCHAR *pcTaskName ) -{ -/* To prevent the optimiser removing the variables. */ -volatile xTaskHandle xTaskIn = xTask; -volatile signed portCHAR *pcTaskNameIn = pcTaskName; +portBASE_TYPE lReturn = pdPASS; +static unsigned portLONG ulLastRegTest1Counter= 0UL, ulLastRegTest2Counter = 0UL; + + /* The demo tasks maintain a count that increments every cycle of the task + provided that the task has never encountered an error. This function + checks the counts maintained by the tasks to ensure they are still being + incremented. A count remaining at the same value between calls therefore + indicates that an error has been detected. */ + + if( xAreIntegerMathsTaskStillRunning() != pdTRUE ) + { + lReturn = pdFAIL; + } + + if( xAreComTestTasksStillRunning() != pdTRUE ) + { + lReturn = pdFAIL; + } + + if( xAreSemaphoreTasksStillRunning() != pdTRUE ) + { + lReturn = pdFAIL; + } + + if( xAreBlockingQueuesStillRunning() != pdTRUE ) + { + lReturn = pdFAIL; + } + + if( xAreDynamicPriorityTasksStillRunning() != pdTRUE ) + { + lReturn = pdFAIL; + } + + if( xIsCreateTaskStillRunning() != pdTRUE ) + { + lReturn = pdFAIL; + } + + if( xAreBlockTimeTestTasksStillRunning() != pdTRUE ) + { + lReturn = pdFAIL; + } + + if( xAreGenericQueueTasksStillRunning() != pdTRUE ) + { + lReturn = pdFAIL; + } + + if( xAreQueuePeekTasksStillRunning() != pdTRUE ) + { + lReturn = pdFAIL; + } + + if( xAreCountingSemaphoreTasksStillRunning() != pdTRUE ) + { + lReturn = pdFAIL; + } + + if( xAreRecursiveMutexTasksStillRunning() != pdTRUE ) + { + lReturn = pdFAIL; + } + + #if ( configUSE_FPU == 1 ) + if( xAreMathsTaskStillRunning() != pdTRUE ) + { + lReturn = pdFAIL; + } + + if( xAreFlopRegisterTestsStillRunning() != pdTRUE ) + { + lReturn = pdFAIL; + } + #endif + + /* Have the register test tasks found any errors? */ + if( xRegTestStatus != pdPASS ) + { + lReturn = pdFAIL; + } + + /* Are the register test tasks still looping? */ + if( ulLastRegTest1Counter == ulRegTest1Counter ) + { + lReturn = pdFAIL; + } + else + { + ulLastRegTest1Counter = ulRegTest1Counter; + } + + if( ulLastRegTest2Counter == ulRegTest2Counter ) + { + lReturn = pdFAIL; + } + else + { + ulLastRegTest2Counter = ulRegTest2Counter; + } + + return lReturn; +} +/*-----------------------------------------------------------*/ + +static void prvErrorChecks( void *pvParameters ) +{ +portTickType xDelayPeriod = mainNO_ERROR_CHECK_DELAY, xLastExecutionTime; +volatile unsigned portBASE_TYPE uxFreeStack; + + /* Just to remove compiler warning. */ + ( void ) pvParameters; + + /* This call is just to demonstrate the use of the function - nothing is + done with the value. You would expect the stack high water mark to be + lower (the function to return a larger value) here at function entry than + later following calls to other functions. */ + uxFreeStack = uxTaskGetStackHighWaterMark( NULL ); + + /* Initialise xLastExecutionTime so the first call to vTaskDelayUntil() + works correctly. */ + xLastExecutionTime = xTaskGetTickCount(); + + /* Cycle for ever, delaying then checking all the other tasks are still + operating without error. */ + for( ;; ) + { + /* Again just for demo purposes - uxFreeStack should have a lower value + here than following the call to uxTaskGetStackHighWaterMark() on the + task entry. */ + uxFreeStack = uxTaskGetStackHighWaterMark( NULL ); + + /* Wait until it is time to check again. The time we wait here depends + on whether an error has been detected or not. When an error is + detected the time is shortened resulting in a faster LED flash rate. */ + vTaskDelayUntil( &xLastExecutionTime, xDelayPeriod ); + + /* See if the other tasks are all ok. */ + if( prvCheckOtherTasksAreStillRunning() != pdPASS ) + { + /* An error occurred in one of the tasks so shorten the delay + period - which has the effect of increasing the frequency of the + LED toggle. */ + xDelayPeriod = mainERROR_CHECK_DELAY; + } + + /* Flash! */ + vParTestToggleLED( mainCHECK_TEST_LED ); + } +} +/*-----------------------------------------------------------*/ + +static void prvSetupHardware( void ) +{ + XCache_EnableICache( 0x80000000 ); + XCache_EnableDCache( 0x80000000 ); + + /* Setup the IO port for use with the LED outputs. */ + vParTestInitialise(); +} +/*-----------------------------------------------------------*/ + +void prvRegTest1Pass( void ) +{ + /* Called from the inline assembler - this cannot be static + otherwise it can get optimised away. */ + ulRegTest1Counter++; +} +/*-----------------------------------------------------------*/ + +void prvRegTest2Pass( void ) +{ + /* Called from the inline assembler - this cannot be static + otherwise it can get optimised away. */ + ulRegTest2Counter++; +} +/*-----------------------------------------------------------*/ + +void prvRegTestFail( void ) +{ + /* Called from the inline assembler - this cannot be static + otherwise it can get optimised away. */ + xRegTestStatus = pdFAIL; +} +/*-----------------------------------------------------------*/ + +static void prvRegTestTask1( void *pvParameters ) +{ + /* Just to remove compiler warning. */ + ( void ) pvParameters; + + /* The first register test task as described at the top of this file. The + values used in the registers are different to those use in the second + register test task. Also, unlike the second register test task, this task + yields between setting the register values and subsequently checking the + register values. */ + asm volatile + ( + "RegTest1Start: \n\t" \ + " \n\t" \ + " li 0, 301 \n\t" \ + " mtspr 256, 0 #USPRG0 \n\t" \ + " li 0, 501 \n\t" \ + " mtspr 8, 0 #LR \n\t" \ + " li 0, 4 \n\t" \ + " mtspr 1, 0 #XER \n\t" \ + " \n\t" \ + " li 0, 1 \n\t" \ + " li 2, 2 \n\t" \ + " li 3, 3 \n\t" \ + " li 4, 4 \n\t" \ + " li 5, 5 \n\t" \ + " li 6, 6 \n\t" \ + " li 7, 7 \n\t" \ + " li 8, 8 \n\t" \ + " li 9, 9 \n\t" \ + " li 10, 10 \n\t" \ + " li 11, 11 \n\t" \ + " li 12, 12 \n\t" \ + " li 13, 13 \n\t" \ + " li 14, 14 \n\t" \ + " li 15, 15 \n\t" \ + " li 16, 16 \n\t" \ + " li 17, 17 \n\t" \ + " li 18, 18 \n\t" \ + " li 19, 19 \n\t" \ + " li 20, 20 \n\t" \ + " li 21, 21 \n\t" \ + " li 22, 22 \n\t" \ + " li 23, 23 \n\t" \ + " li 24, 24 \n\t" \ + " li 25, 25 \n\t" \ + " li 26, 26 \n\t" \ + " li 27, 27 \n\t" \ + " li 28, 28 \n\t" \ + " li 29, 29 \n\t" \ + " li 30, 30 \n\t" \ + " li 31, 31 \n\t" \ + " \n\t" \ + " sc \n\t" \ + " nop \n\t" \ + " \n\t" \ + " cmpwi 0, 1 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 2, 2 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 3, 3 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 4, 4 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 5, 5 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 6, 6 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 7, 7 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 8, 8 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 9, 9 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 10, 10 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 11, 11 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 12, 12 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 13, 13 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 14, 14 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 15, 15 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 16, 16 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 17, 17 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 18, 18 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 19, 19 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 20, 20 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 21, 21 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 22, 22 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 23, 23 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 24, 24 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 25, 25 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 26, 26 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 27, 27 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 28, 28 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 29, 29 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 30, 30 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 31, 31 \n\t" \ + " bne RegTest1Fail \n\t" \ + " \n\t" \ + " mfspr 0, 256 #USPRG0 \n\t" \ + " cmpwi 0, 301 \n\t" \ + " bne RegTest1Fail \n\t" \ + " mfspr 0, 8 #LR \n\t" \ + " cmpwi 0, 501 \n\t" \ + " bne RegTest1Fail \n\t" \ + " mfspr 0, 1 #XER \n\t" \ + " cmpwi 0, 4 \n\t" \ + " bne RegTest1Fail \n\t" \ + " \n\t" \ + " bl prvRegTest1Pass \n\t" \ + " b RegTest1Start \n\t" \ + " \n\t" \ + "RegTest1Fail: \n\t" \ + " \n\t" \ + " \n\t" \ + " bl prvRegTestFail \n\t" \ + " b RegTest1Start \n\t" \ + ); +} +/*-----------------------------------------------------------*/ + +static void prvRegTestTask2( void *pvParameters ) +{ + /* Just to remove compiler warning. */ + ( void ) pvParameters; + + /* The second register test task as described at the top of this file. + Note that this task fills the registers with different values to the + first register test task. */ + asm volatile + ( + "RegTest2Start: \n\t" \ + " \n\t" \ + " li 0, 300 \n\t" \ + " mtspr 256, 0 #USPRG0 \n\t" \ + " li 0, 500 \n\t" \ + " mtspr 8, 0 #LR \n\t" \ + " li 0, 4 \n\t" \ + " mtspr 1, 0 #XER \n\t" \ + " \n\t" \ + " li 0, 11 \n\t" \ + " li 2, 12 \n\t" \ + " li 3, 13 \n\t" \ + " li 4, 14 \n\t" \ + " li 5, 15 \n\t" \ + " li 6, 16 \n\t" \ + " li 7, 17 \n\t" \ + " li 8, 18 \n\t" \ + " li 9, 19 \n\t" \ + " li 10, 110 \n\t" \ + " li 11, 111 \n\t" \ + " li 12, 112 \n\t" \ + " li 13, 113 \n\t" \ + " li 14, 114 \n\t" \ + " li 15, 115 \n\t" \ + " li 16, 116 \n\t" \ + " li 17, 117 \n\t" \ + " li 18, 118 \n\t" \ + " li 19, 119 \n\t" \ + " li 20, 120 \n\t" \ + " li 21, 121 \n\t" \ + " li 22, 122 \n\t" \ + " li 23, 123 \n\t" \ + " li 24, 124 \n\t" \ + " li 25, 125 \n\t" \ + " li 26, 126 \n\t" \ + " li 27, 127 \n\t" \ + " li 28, 128 \n\t" \ + " li 29, 129 \n\t" \ + " li 30, 130 \n\t" \ + " li 31, 131 \n\t" \ + " \n\t" \ + " cmpwi 0, 11 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 2, 12 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 3, 13 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 4, 14 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 5, 15 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 6, 16 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 7, 17 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 8, 18 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 9, 19 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 10, 110 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 11, 111 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 12, 112 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 13, 113 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 14, 114 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 15, 115 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 16, 116 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 17, 117 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 18, 118 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 19, 119 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 20, 120 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 21, 121 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 22, 122 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 23, 123 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 24, 124 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 25, 125 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 26, 126 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 27, 127 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 28, 128 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 29, 129 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 30, 130 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 31, 131 \n\t" \ + " bne RegTest2Fail \n\t" \ + " \n\t" \ + " mfspr 0, 256 #USPRG0 \n\t" \ + " cmpwi 0, 300 \n\t" \ + " bne RegTest2Fail \n\t" \ + " mfspr 0, 8 #LR \n\t" \ + " cmpwi 0, 500 \n\t" \ + " bne RegTest2Fail \n\t" \ + " mfspr 0, 1 #XER \n\t" \ + " cmpwi 0, 4 \n\t" \ + " bne RegTest2Fail \n\t" \ + " \n\t" \ + " bl prvRegTest2Pass \n\t" \ + " b RegTest2Start \n\t" \ + " \n\t" \ + "RegTest2Fail: \n\t" \ + " \n\t" \ + " \n\t" \ + " bl prvRegTestFail \n\t" \ + " b RegTest2Start \n\t" \ + ); +} +/*-----------------------------------------------------------*/ + +/* This hook function will get called if there is a suspected stack overflow. +An overflow can cause the task name to be corrupted, in which case the task +handle needs to be used to determine the offending task. */ +void vApplicationStackOverflowHook( xTaskHandle xTask, signed portCHAR *pcTaskName ); +void vApplicationStackOverflowHook( xTaskHandle xTask, signed portCHAR *pcTaskName ) +{ +/* To prevent the optimiser removing the variables. */ +volatile xTaskHandle xTaskIn = xTask; +volatile signed portCHAR *pcTaskNameIn = pcTaskName; /* Remove compiler warnings. */ ( void ) xTaskIn; ( void ) pcTaskNameIn; - - /* The following three calls are simply to stop compiler warnings about the - functions not being used - they are called from the inline assembly. */ - prvRegTest1Pass(); - prvRegTest2Pass(); - prvRegTestFail(); - - for( ;; ); -} - - - + + /* The following three calls are simply to stop compiler warnings about the + functions not being used - they are called from the inline assembly. */ + prvRegTest1Pass(); + prvRegTest2Pass(); + prvRegTestFail(); + + for( ;; ); +} + + + diff --git a/Demo/PPC405_FPU_Xilinx_Virtex4_GCC/RTOSDemo/partest/partest.c b/Demo/PPC405_FPU_Xilinx_Virtex4_GCC/RTOSDemo/partest/partest.c index ac575c096..5daf7cb79 100644 --- a/Demo/PPC405_FPU_Xilinx_Virtex4_GCC/RTOSDemo/partest/partest.c +++ b/Demo/PPC405_FPU_Xilinx_Virtex4_GCC/RTOSDemo/partest/partest.c @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/PPC405_FPU_Xilinx_Virtex4_GCC/RTOSDemo/serial/serial.c b/Demo/PPC405_FPU_Xilinx_Virtex4_GCC/RTOSDemo/serial/serial.c index 4c39973b4..c3d28150a 100644 --- a/Demo/PPC405_FPU_Xilinx_Virtex4_GCC/RTOSDemo/serial/serial.c +++ b/Demo/PPC405_FPU_Xilinx_Virtex4_GCC/RTOSDemo/serial/serial.c @@ -1,233 +1,233 @@ -/* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. - - This file is part of the FreeRTOS.org distribution. - - FreeRTOS.org is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - FreeRTOS.org is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with FreeRTOS.org; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - A special exception to the GPL can be applied should you wish to distribute - a combined work that includes FreeRTOS.org, without being obliged to provide - the source code for any proprietary components. See the licensing section - of http://www.FreeRTOS.org for full details of how and when the exception - can be applied. - - *************************************************************************** - *************************************************************************** - * * - * SAVE TIME AND MONEY! We can port FreeRTOS.org to your own hardware, * - * and even write all or part of your application on your behalf. * - * See http://www.OpenRTOS.com for details of the services we provide to * - * expedite your project. * - * * - *************************************************************************** - *************************************************************************** - - Please ensure to read the configuration and relevant port sections of the - online documentation. - - http://www.FreeRTOS.org - Documentation, latest information, license and - contact details. - - http://www.SafeRTOS.com - A version that is certified for use in safety - critical systems. - - http://www.OpenRTOS.com - Commercial support, development, porting, - licensing and training services. -*/ - - -/* - BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER FOR UART -*/ - -/* Scheduler includes. */ -#include "FreeRTOS.h" -#include "queue.h" -#include "task.h" - -/* Demo application includes. */ -#include "serial.h" - -/* Library includes. */ -#include "xparameters.h" -#include "xuartlite.h" -#include "xuartlite_l.h" - -/*-----------------------------------------------------------*/ - -/* Queues used to hold received characters, and characters waiting to be -transmitted. */ -static xQueueHandle xRxedChars; -static xQueueHandle xCharsForTx; - -/* Structure that maintains information on the UART being used. */ -static XUartLite xUART; - -/* - * Sample UART interrupt handler. Note this is used to demonstrate the kernel - * features and test the port - it is not intended to represent an efficient - * implementation. - */ -static void vSerialISR( XUartLite *pxUART ); - -/*-----------------------------------------------------------*/ - -xComPortHandle xSerialPortInitMinimal( unsigned portLONG ulWantedBaud, unsigned portBASE_TYPE uxQueueLength ) -{ - /* NOTE: The baud rate used by this driver is determined by the hardware - parameterization of the UART Lite peripheral, and the baud value passed to - this function has no effect. */ - ( void ) ulWantedBaud; - - /* Create the queues used to hold Rx and Tx characters. */ - xRxedChars = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed portCHAR ) ); - xCharsForTx = xQueueCreate( uxQueueLength + 1, ( unsigned portBASE_TYPE ) sizeof( signed portCHAR ) ); - - /* Only initialise the UART if the queues were created correctly. */ - if( ( xRxedChars != NULL ) && ( xCharsForTx != NULL ) ) - { - - XUartLite_Initialize( &xUART, XPAR_RS232_UART_DEVICE_ID ); - XUartLite_ResetFifos( &xUART ); - XUartLite_DisableInterrupt( &xUART ); - - if( xPortInstallInterruptHandler( XPAR_XPS_INTC_0_RS232_UART_INTERRUPT_INTR, ( XInterruptHandler )vSerialISR, (void *)&xUART ) == pdPASS ) - { - /* xPortInstallInterruptHandler() could fail if - vPortSetupInterruptController() has not been called prior to this - function. */ - XUartLite_EnableInterrupt( &xUART ); - } - } - - /* There is only one port so the handle is not used. */ - return ( xComPortHandle ) 0; -} -/*-----------------------------------------------------------*/ - -signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed portCHAR *pcRxedChar, portTickType xBlockTime ) -{ - /* The port handle is not required as this driver only supports one UART. */ - ( void ) pxPort; - - /* Get the next character from the buffer. Return false if no characters - are available, or arrive before xBlockTime expires. */ - if( xQueueReceive( xRxedChars, pcRxedChar, xBlockTime ) ) - { - return pdTRUE; - } - else - { - return pdFALSE; - } -} -/*-----------------------------------------------------------*/ - -signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed portCHAR cOutChar, portTickType xBlockTime ) -{ -portBASE_TYPE xReturn = pdTRUE; +/* + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. + + This file is part of the FreeRTOS.org distribution. + + FreeRTOS.org is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + FreeRTOS.org is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with FreeRTOS.org; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + A special exception to the GPL can be applied should you wish to distribute + a combined work that includes FreeRTOS.org, without being obliged to provide + the source code for any proprietary components. See the licensing section + of http://www.FreeRTOS.org for full details of how and when the exception + can be applied. + + *************************************************************************** + *************************************************************************** + * * + * SAVE TIME AND MONEY! We can port FreeRTOS.org to your own hardware, * + * and even write all or part of your application on your behalf. * + * See http://www.OpenRTOS.com for details of the services we provide to * + * expedite your project. * + * * + *************************************************************************** + *************************************************************************** + + Please ensure to read the configuration and relevant port sections of the + online documentation. + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + + +/* + BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER FOR UART +*/ + +/* Scheduler includes. */ +#include "FreeRTOS.h" +#include "queue.h" +#include "task.h" + +/* Demo application includes. */ +#include "serial.h" + +/* Library includes. */ +#include "xparameters.h" +#include "xuartlite.h" +#include "xuartlite_l.h" + +/*-----------------------------------------------------------*/ + +/* Queues used to hold received characters, and characters waiting to be +transmitted. */ +static xQueueHandle xRxedChars; +static xQueueHandle xCharsForTx; + +/* Structure that maintains information on the UART being used. */ +static XUartLite xUART; + +/* + * Sample UART interrupt handler. Note this is used to demonstrate the kernel + * features and test the port - it is not intended to represent an efficient + * implementation. + */ +static void vSerialISR( XUartLite *pxUART ); + +/*-----------------------------------------------------------*/ + +xComPortHandle xSerialPortInitMinimal( unsigned portLONG ulWantedBaud, unsigned portBASE_TYPE uxQueueLength ) +{ + /* NOTE: The baud rate used by this driver is determined by the hardware + parameterization of the UART Lite peripheral, and the baud value passed to + this function has no effect. */ + ( void ) ulWantedBaud; + + /* Create the queues used to hold Rx and Tx characters. */ + xRxedChars = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed portCHAR ) ); + xCharsForTx = xQueueCreate( uxQueueLength + 1, ( unsigned portBASE_TYPE ) sizeof( signed portCHAR ) ); + + /* Only initialise the UART if the queues were created correctly. */ + if( ( xRxedChars != NULL ) && ( xCharsForTx != NULL ) ) + { + + XUartLite_Initialize( &xUART, XPAR_RS232_UART_DEVICE_ID ); + XUartLite_ResetFifos( &xUART ); + XUartLite_DisableInterrupt( &xUART ); + + if( xPortInstallInterruptHandler( XPAR_XPS_INTC_0_RS232_UART_INTERRUPT_INTR, ( XInterruptHandler )vSerialISR, (void *)&xUART ) == pdPASS ) + { + /* xPortInstallInterruptHandler() could fail if + vPortSetupInterruptController() has not been called prior to this + function. */ + XUartLite_EnableInterrupt( &xUART ); + } + } + + /* There is only one port so the handle is not used. */ + return ( xComPortHandle ) 0; +} +/*-----------------------------------------------------------*/ + +signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed portCHAR *pcRxedChar, portTickType xBlockTime ) +{ + /* The port handle is not required as this driver only supports one UART. */ + ( void ) pxPort; + + /* Get the next character from the buffer. Return false if no characters + are available, or arrive before xBlockTime expires. */ + if( xQueueReceive( xRxedChars, pcRxedChar, xBlockTime ) ) + { + return pdTRUE; + } + else + { + return pdFALSE; + } +} +/*-----------------------------------------------------------*/ + +signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed portCHAR cOutChar, portTickType xBlockTime ) +{ +portBASE_TYPE xReturn = pdTRUE; /* Just to remove compiler warning. */ ( void ) pxPort; - - portENTER_CRITICAL(); - { - /* If the UART FIFO is full we can block posting the new data on the - Tx queue. */ - if( XUartLite_mIsTransmitFull( XPAR_RS232_UART_BASEADDR ) ) - { - if( xQueueSend( xCharsForTx, &cOutChar, xBlockTime ) != pdPASS ) - { - xReturn = pdFAIL; - } - } - /* Otherwise, if there is data already in the queue we should add the - new data to the back of the queue to ensure the sequencing is - maintained. */ - else if( uxQueueMessagesWaiting( xCharsForTx ) ) - { - if( xQueueSend( xCharsForTx, &cOutChar, xBlockTime ) != pdPASS ) - { - xReturn = pdFAIL; - } - } - /* If the UART FIFO is not full and there is no data already in the - queue we can write directly to the FIFO without disrupting the - sequence. */ - else - { - XIo_Out32( XPAR_RS232_UART_BASEADDR + XUL_TX_FIFO_OFFSET, cOutChar ); - } - } - portEXIT_CRITICAL(); - - return xReturn; -} -/*-----------------------------------------------------------*/ - -void vSerialClose( xComPortHandle xPort ) -{ - /* Not supported as not required by the demo application. */ - ( void ) xPort; -} -/*-----------------------------------------------------------*/ - -static void vSerialISR( XUartLite *pxUART ) -{ -unsigned portLONG ulISRStatus; -portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE, lDidSomething; -portCHAR cChar; + + portENTER_CRITICAL(); + { + /* If the UART FIFO is full we can block posting the new data on the + Tx queue. */ + if( XUartLite_mIsTransmitFull( XPAR_RS232_UART_BASEADDR ) ) + { + if( xQueueSend( xCharsForTx, &cOutChar, xBlockTime ) != pdPASS ) + { + xReturn = pdFAIL; + } + } + /* Otherwise, if there is data already in the queue we should add the + new data to the back of the queue to ensure the sequencing is + maintained. */ + else if( uxQueueMessagesWaiting( xCharsForTx ) ) + { + if( xQueueSend( xCharsForTx, &cOutChar, xBlockTime ) != pdPASS ) + { + xReturn = pdFAIL; + } + } + /* If the UART FIFO is not full and there is no data already in the + queue we can write directly to the FIFO without disrupting the + sequence. */ + else + { + XIo_Out32( XPAR_RS232_UART_BASEADDR + XUL_TX_FIFO_OFFSET, cOutChar ); + } + } + portEXIT_CRITICAL(); + + return xReturn; +} +/*-----------------------------------------------------------*/ + +void vSerialClose( xComPortHandle xPort ) +{ + /* Not supported as not required by the demo application. */ + ( void ) xPort; +} +/*-----------------------------------------------------------*/ + +static void vSerialISR( XUartLite *pxUART ) +{ +unsigned portLONG ulISRStatus; +portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE, lDidSomething; +portCHAR cChar; /* Just to remove compiler warning. */ ( void ) pxUART; - - do - { - lDidSomething = pdFALSE; - - ulISRStatus = XIo_In32( XPAR_RS232_UART_BASEADDR + XUL_STATUS_REG_OFFSET ); - - if( ( ulISRStatus & XUL_SR_RX_FIFO_VALID_DATA ) != 0 ) - { - /* A character is available - place it in the queue of received - characters. This might wake a task that was blocked waiting for - data. */ - cChar = ( portCHAR ) XIo_In32( XPAR_RS232_UART_BASEADDR + XUL_RX_FIFO_OFFSET ); - xQueueSendFromISR( xRxedChars, &cChar, &xHigherPriorityTaskWoken ); - lDidSomething = pdTRUE; - } - - if( ( ulISRStatus & XUL_SR_TX_FIFO_EMPTY ) != 0 ) - { - /* There is space in the FIFO - if there are any characters queue for - transmission they can be sent to the UART now. This might unblock a - task that was waiting for space to become available on the Tx queue. */ - if( xQueueReceiveFromISR( xCharsForTx, &cChar, &xHigherPriorityTaskWoken ) == pdTRUE ) - { - XIo_Out32( XPAR_RS232_UART_BASEADDR + XUL_TX_FIFO_OFFSET, cChar ); - lDidSomething = pdTRUE; - } - } - } while( lDidSomething == pdTRUE ); - - /* If we woke any tasks we may require a context switch. */ - if( xHigherPriorityTaskWoken ) - { - portYIELD_FROM_ISR(); - } -} - - - + + do + { + lDidSomething = pdFALSE; + + ulISRStatus = XIo_In32( XPAR_RS232_UART_BASEADDR + XUL_STATUS_REG_OFFSET ); + + if( ( ulISRStatus & XUL_SR_RX_FIFO_VALID_DATA ) != 0 ) + { + /* A character is available - place it in the queue of received + characters. This might wake a task that was blocked waiting for + data. */ + cChar = ( portCHAR ) XIo_In32( XPAR_RS232_UART_BASEADDR + XUL_RX_FIFO_OFFSET ); + xQueueSendFromISR( xRxedChars, &cChar, &xHigherPriorityTaskWoken ); + lDidSomething = pdTRUE; + } + + if( ( ulISRStatus & XUL_SR_TX_FIFO_EMPTY ) != 0 ) + { + /* There is space in the FIFO - if there are any characters queue for + transmission they can be sent to the UART now. This might unblock a + task that was waiting for space to become available on the Tx queue. */ + if( xQueueReceiveFromISR( xCharsForTx, &cChar, &xHigherPriorityTaskWoken ) == pdTRUE ) + { + XIo_Out32( XPAR_RS232_UART_BASEADDR + XUL_TX_FIFO_OFFSET, cChar ); + lDidSomething = pdTRUE; + } + } + } while( lDidSomething == pdTRUE ); + + /* If we woke any tasks we may require a context switch. */ + if( xHigherPriorityTaskWoken ) + { + portYIELD_FROM_ISR(); + } +} + + + diff --git a/Demo/PPC405_FPU_Xilinx_Virtex4_GCC/system.xmp b/Demo/PPC405_FPU_Xilinx_Virtex4_GCC/system.xmp index 1fbb8abc0..4a7a93ca7 100644 --- a/Demo/PPC405_FPU_Xilinx_Virtex4_GCC/system.xmp +++ b/Demo/PPC405_FPU_Xilinx_Virtex4_GCC/system.xmp @@ -61,7 +61,7 @@ Header: RTOSDemo/FreeRTOSConfig.h DefaultInit: EXECUTABLE InitBram: 0 Active: 1 -CompilerOptLevel: 2 +CompilerOptLevel: 0 GlobPtrOpt: 0 DebugSym: 1 ProfileFlag: 0 diff --git a/Demo/PPC405_Xilinx_Virtex4_GCC/RTOSDemo/FreeRTOSConfig.h b/Demo/PPC405_Xilinx_Virtex4_GCC/RTOSDemo/FreeRTOSConfig.h index 56cab2f11..f89b681c8 100644 --- a/Demo/PPC405_Xilinx_Virtex4_GCC/RTOSDemo/FreeRTOSConfig.h +++ b/Demo/PPC405_Xilinx_Virtex4_GCC/RTOSDemo/FreeRTOSConfig.h @@ -1,110 +1,110 @@ -/* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. - - This file is part of the FreeRTOS.org distribution. - - FreeRTOS.org is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - FreeRTOS.org is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with FreeRTOS.org; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - A special exception to the GPL can be applied should you wish to distribute - a combined work that includes FreeRTOS.org, without being obliged to provide - the source code for any proprietary components. See the licensing section - of http://www.FreeRTOS.org for full details of how and when the exception - can be applied. - - *************************************************************************** - *************************************************************************** - * * - * SAVE TIME AND MONEY! We can port FreeRTOS.org to your own hardware, * - * and even write all or part of your application on your behalf. * - * See http://www.OpenRTOS.com for details of the services we provide to * - * expedite your project. * - * * - *************************************************************************** - *************************************************************************** - - Please ensure to read the configuration and relevant port sections of the - online documentation. - - http://www.FreeRTOS.org - Documentation, latest information, license and - contact details. - - http://www.SafeRTOS.com - A version that is certified for use in safety - critical systems. - - http://www.OpenRTOS.com - Commercial support, development, porting, - licensing and training services. -*/ - -#ifndef FREERTOS_CONFIG_H -#define FREERTOS_CONFIG_H - -/*----------------------------------------------------------- - * Application specific definitions. - * - * These definitions should be adjusted for your particular hardware and - * application requirements. - * - * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE - * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. - *----------------------------------------------------------*/ -#define configUSE_PREEMPTION 1 -#define configUSE_IDLE_HOOK 0 -#define configUSE_TICK_HOOK 0 -#define configMINIMAL_STACK_SIZE ( ( unsigned portSHORT ) 250 ) -#define configCPU_CLOCK_HZ ( ( unsigned portLONG ) 200000000 ) /* Clock setup from start.asm in the demo application. */ -#define configTICK_RATE_HZ ( (portTickType) 1000 ) -#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 6 ) -#define configTOTAL_HEAP_SIZE ( (size_t) (80 * 1024) ) -#define configMAX_TASK_NAME_LEN ( 20 ) -#define configUSE_16_BIT_TICKS 1 -#define configIDLE_SHOULD_YIELD 1 -#define configUSE_MUTEXES 1 -#define configUSE_TRACE_FACILITY 0 -#define configCHECK_FOR_STACK_OVERFLOW 2 -#define configUSE_COUNTING_SEMAPHORES 1 -#define configUSE_APPLICATION_TASK_TAG 1 -#define configUSE_FPU 0 - - -/* Co-routine definitions. */ -#define configUSE_CO_ROUTINES 0 -#define configMAX_CO_ROUTINE_PRIORITIES ( 4 ) - -/* Set the following definitions to 1 to include the API function, or zero -to exclude the API function. */ -#define INCLUDE_vTaskPrioritySet 1 -#define INCLUDE_uxTaskPriorityGet 1 -#define INCLUDE_vTaskDelete 1 -#define INCLUDE_vTaskCleanUpResources 1 -#define INCLUDE_vTaskSuspend 1 -#define INCLUDE_vResumeFromISR 1 -#define INCLUDE_vTaskDelayUntil 1 -#define INCLUDE_vTaskDelay 1 -#define INCLUDE_xTaskGetSchedulerState 1 -#define INCLUDE_xTaskGetCurrentTaskHandle 1 -#define INCLUDE_uxTaskGetStackHighWaterMark 1 -#define configUSE_RECURSIVE_MUTEXES 1 - - -#if configUSE_FPU == 1 - /* Include the header that define the traceTASK_SWITCHED_IN() and - traceTASK_SWITCHED_OUT() macros to save and restore the floating - point registers for tasks that have requested this behaviour. */ - #include "FPU_Macros.h" -#endif - -#endif /* FREERTOS_CONFIG_H */ - - +/* + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. + + This file is part of the FreeRTOS.org distribution. + + FreeRTOS.org is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + FreeRTOS.org is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with FreeRTOS.org; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + A special exception to the GPL can be applied should you wish to distribute + a combined work that includes FreeRTOS.org, without being obliged to provide + the source code for any proprietary components. See the licensing section + of http://www.FreeRTOS.org for full details of how and when the exception + can be applied. + + *************************************************************************** + *************************************************************************** + * * + * SAVE TIME AND MONEY! We can port FreeRTOS.org to your own hardware, * + * and even write all or part of your application on your behalf. * + * See http://www.OpenRTOS.com for details of the services we provide to * + * expedite your project. * + * * + *************************************************************************** + *************************************************************************** + + Please ensure to read the configuration and relevant port sections of the + online documentation. + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +#ifndef FREERTOS_CONFIG_H +#define FREERTOS_CONFIG_H + +/*----------------------------------------------------------- + * Application specific definitions. + * + * These definitions should be adjusted for your particular hardware and + * application requirements. + * + * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + *----------------------------------------------------------*/ +#define configUSE_PREEMPTION 1 +#define configUSE_IDLE_HOOK 0 +#define configUSE_TICK_HOOK 0 +#define configMINIMAL_STACK_SIZE ( ( unsigned portSHORT ) 250 ) +#define configCPU_CLOCK_HZ ( ( unsigned portLONG ) 200000000 ) /* Clock setup from start.asm in the demo application. */ +#define configTICK_RATE_HZ ( (portTickType) 1000 ) +#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 6 ) +#define configTOTAL_HEAP_SIZE ( (size_t) (80 * 1024) ) +#define configMAX_TASK_NAME_LEN ( 20 ) +#define configUSE_16_BIT_TICKS 1 +#define configIDLE_SHOULD_YIELD 1 +#define configUSE_MUTEXES 1 +#define configUSE_TRACE_FACILITY 0 +#define configCHECK_FOR_STACK_OVERFLOW 2 +#define configUSE_COUNTING_SEMAPHORES 1 +#define configUSE_APPLICATION_TASK_TAG 1 +#define configUSE_FPU 0 + + +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 4 ) + +/* Set the following definitions to 1 to include the API function, or zero +to exclude the API function. */ +#define INCLUDE_vTaskPrioritySet 1 +#define INCLUDE_uxTaskPriorityGet 1 +#define INCLUDE_vTaskDelete 1 +#define INCLUDE_vTaskCleanUpResources 1 +#define INCLUDE_vTaskSuspend 1 +#define INCLUDE_vResumeFromISR 1 +#define INCLUDE_vTaskDelayUntil 1 +#define INCLUDE_vTaskDelay 1 +#define INCLUDE_xTaskGetSchedulerState 1 +#define INCLUDE_xTaskGetCurrentTaskHandle 1 +#define INCLUDE_uxTaskGetStackHighWaterMark 1 +#define configUSE_RECURSIVE_MUTEXES 1 + + +#if configUSE_FPU == 1 + /* Include the header that define the traceTASK_SWITCHED_IN() and + traceTASK_SWITCHED_OUT() macros to save and restore the floating + point registers for tasks that have requested this behaviour. */ + #include "FPU_Macros.h" +#endif + +#endif /* FREERTOS_CONFIG_H */ + + diff --git a/Demo/PPC405_Xilinx_Virtex4_GCC/RTOSDemo/flop/flop-reg-test.c b/Demo/PPC405_Xilinx_Virtex4_GCC/RTOSDemo/flop/flop-reg-test.c index 355084dd4..2b19bd359 100644 --- a/Demo/PPC405_Xilinx_Virtex4_GCC/RTOSDemo/flop/flop-reg-test.c +++ b/Demo/PPC405_Xilinx_Virtex4_GCC/RTOSDemo/flop/flop-reg-test.c @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/PPC405_Xilinx_Virtex4_GCC/RTOSDemo/flop/flop-reg-test.h b/Demo/PPC405_Xilinx_Virtex4_GCC/RTOSDemo/flop/flop-reg-test.h index ecf30d506..56da50693 100644 --- a/Demo/PPC405_Xilinx_Virtex4_GCC/RTOSDemo/flop/flop-reg-test.h +++ b/Demo/PPC405_Xilinx_Virtex4_GCC/RTOSDemo/flop/flop-reg-test.h @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/PPC405_Xilinx_Virtex4_GCC/RTOSDemo/flop/flop.c b/Demo/PPC405_Xilinx_Virtex4_GCC/RTOSDemo/flop/flop.c index 563295647..a50b6bfb8 100644 --- a/Demo/PPC405_Xilinx_Virtex4_GCC/RTOSDemo/flop/flop.c +++ b/Demo/PPC405_Xilinx_Virtex4_GCC/RTOSDemo/flop/flop.c @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/PPC405_Xilinx_Virtex4_GCC/RTOSDemo/main.c b/Demo/PPC405_Xilinx_Virtex4_GCC/RTOSDemo/main.c index 3eb131470..c58f2256e 100644 --- a/Demo/PPC405_Xilinx_Virtex4_GCC/RTOSDemo/main.c +++ b/Demo/PPC405_Xilinx_Virtex4_GCC/RTOSDemo/main.c @@ -1,705 +1,705 @@ -/* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. - - This file is part of the FreeRTOS.org distribution. - - FreeRTOS.org is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - FreeRTOS.org is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with FreeRTOS.org; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - A special exception to the GPL can be applied should you wish to distribute - a combined work that includes FreeRTOS.org, without being obliged to provide - the source code for any proprietary components. See the licensing section - of http://www.FreeRTOS.org for full details of how and when the exception - can be applied. - - *************************************************************************** - *************************************************************************** - * * - * SAVE TIME AND MONEY! We can port FreeRTOS.org to your own hardware, * - * and even write all or part of your application on your behalf. * - * See http://www.OpenRTOS.com for details of the services we provide to * - * expedite your project. * - * * - *************************************************************************** - *************************************************************************** - - Please ensure to read the configuration and relevant port sections of the - online documentation. - - http://www.FreeRTOS.org - Documentation, latest information, license and - contact details. - - http://www.SafeRTOS.com - A version that is certified for use in safety - critical systems. - - http://www.OpenRTOS.com - Commercial support, development, porting, - licensing and training services. -*/ - -/* - * Creates all the demo application tasks, then starts the scheduler. The WEB - * documentation provides more details of the demo application tasks. - * - * In addition to the standard demo tasks, the follow demo specific tasks are - * create: - * - * The "Check" task. This only executes every three seconds but has the highest - * priority so is guaranteed to get processor time. Its main function is to - * check that all the other tasks are still operational. Most tasks maintain - * a unique count that is incremented each time the task successfully completes - * its function. Should any error occur within such a task the count is - * permanently halted. The check task inspects the count of each task to ensure - * it has changed since the last time the check task executed. If all the count - * variables have changed all the tasks are still executing error free, and the - * check task toggles the onboard LED. Should any task contain an error at any time - * the LED toggle rate will change from 3 seconds to 500ms. - * - * The "Register Check" tasks. These tasks fill the CPU registers with known - * values, then check that each register still contains the expected value, the - * discovery of an unexpected value being indicative of an error in the RTOS - * context switch mechanism. The register check tasks operate at low priority - * so are switched in and out frequently. - * - */ - -/* Scheduler includes. */ -#include "FreeRTOS.h" -#include "task.h" - -/* Xilinx library includes. */ -#include "xcache_l.h" -#include "xintc.h" - -/* Demo application includes. */ -#include "flash.h" -#include "integer.h" -#include "comtest2.h" -#include "semtest.h" -#include "BlockQ.h" -#include "dynamic.h" -#include "GenQTest.h" -#include "QPeek.h" -#include "blocktim.h" -#include "death.h" -#include "partest.h" -#include "countsem.h" -#include "recmutex.h" -#include "flop.h" -#include "flop-reg-test.h" - -/* Priorities assigned to the demo tasks. */ -#define mainCHECK_TASK_PRIORITY ( tskIDLE_PRIORITY + 4 ) -#define mainSEM_TEST_PRIORITY ( tskIDLE_PRIORITY + 2 ) -#define mainCOM_TEST_PRIORITY ( tskIDLE_PRIORITY + 1 ) -#define mainQUEUE_BLOCK_PRIORITY ( tskIDLE_PRIORITY + 1 ) -#define mainDEATH_PRIORITY ( tskIDLE_PRIORITY + 1 ) -#define mainLED_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 ) -#define mainGENERIC_QUEUE_PRIORITY ( tskIDLE_PRIORITY ) -#define mainQUEUE_POLL_PRIORITY ( tskIDLE_PRIORITY + 1 ) -#define mainFLOP_PRIORITY ( tskIDLE_PRIORITY ) - -/* The first LED used by the COM test and check tasks respectively. */ -#define mainCOM_TEST_LED ( 4 ) -#define mainCHECK_TEST_LED ( 3 ) - -/* The baud rate used by the comtest tasks is set by the hardware, so the -baud rate parameters passed into the comtest initialisation has no effect. */ -#define mainBAUD_SET_IN_HARDWARE ( 0 ) - -/* Delay periods used by the check task. If no errors have been found then -the check LED will toggle every mainNO_ERROR_CHECK_DELAY milliseconds. If an -error has been found at any time then the toggle rate will increase to -mainERROR_CHECK_DELAY milliseconds. */ -#define mainNO_ERROR_CHECK_DELAY ( ( portTickType ) 3000 / portTICK_RATE_MS ) -#define mainERROR_CHECK_DELAY ( ( portTickType ) 500 / portTICK_RATE_MS ) - - -/* - * The tasks defined within this file - described within the comments at the - * head of this page. - */ -static void prvRegTestTask1( void *pvParameters ); -static void prvRegTestTask2( void *pvParameters ); -static void prvErrorChecks( void *pvParameters ); - -/* - * Called by the 'check' task to inspect all the standard demo tasks within - * the system, as described within the comments at the head of this page. - */ -static portBASE_TYPE prvCheckOtherTasksAreStillRunning( void ); - -/* - * Perform any hardware initialisation required by the demo application. - */ -static void prvSetupHardware( void ); - -/*-----------------------------------------------------------*/ - -/* xRegTestStatus will get set to pdFAIL by the regtest tasks if they -discover an unexpected value. */ -static volatile unsigned portBASE_TYPE xRegTestStatus = pdPASS; - -/* Counters used to ensure the regtest tasks are still running. */ -static volatile unsigned portLONG ulRegTest1Counter = 0UL, ulRegTest2Counter = 0UL; - -/*-----------------------------------------------------------*/ - -int main( void ) -{ - - /* Must be called prior to installing any interrupt handlers! */ - vPortSetupInterruptController(); - - /* In this case prvSetupHardware() just enables the caches and and - configures the IO ports for the LED outputs. */ - prvSetupHardware(); - - /* Start the standard demo application tasks. Note that the baud rate used - by the comtest tasks is set by the hardware, so the baud rate parameter - passed has no effect. */ - vStartLEDFlashTasks( mainLED_TASK_PRIORITY ); - vStartIntegerMathTasks( tskIDLE_PRIORITY ); - vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainBAUD_SET_IN_HARDWARE, mainCOM_TEST_LED ); - vStartSemaphoreTasks( mainSEM_TEST_PRIORITY ); - vStartBlockingQueueTasks ( mainQUEUE_BLOCK_PRIORITY ); - vStartDynamicPriorityTasks(); - vStartGenericQueueTasks( mainGENERIC_QUEUE_PRIORITY ); - vStartQueuePeekTasks(); - vCreateBlockTimeTasks(); - vStartCountingSemaphoreTasks(); - vStartRecursiveMutexTasks(); - +/* + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. + + This file is part of the FreeRTOS.org distribution. + + FreeRTOS.org is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + FreeRTOS.org is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with FreeRTOS.org; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + A special exception to the GPL can be applied should you wish to distribute + a combined work that includes FreeRTOS.org, without being obliged to provide + the source code for any proprietary components. See the licensing section + of http://www.FreeRTOS.org for full details of how and when the exception + can be applied. + + *************************************************************************** + *************************************************************************** + * * + * SAVE TIME AND MONEY! We can port FreeRTOS.org to your own hardware, * + * and even write all or part of your application on your behalf. * + * See http://www.OpenRTOS.com for details of the services we provide to * + * expedite your project. * + * * + *************************************************************************** + *************************************************************************** + + Please ensure to read the configuration and relevant port sections of the + online documentation. + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* + * Creates all the demo application tasks, then starts the scheduler. The WEB + * documentation provides more details of the demo application tasks. + * + * In addition to the standard demo tasks, the follow demo specific tasks are + * create: + * + * The "Check" task. This only executes every three seconds but has the highest + * priority so is guaranteed to get processor time. Its main function is to + * check that all the other tasks are still operational. Most tasks maintain + * a unique count that is incremented each time the task successfully completes + * its function. Should any error occur within such a task the count is + * permanently halted. The check task inspects the count of each task to ensure + * it has changed since the last time the check task executed. If all the count + * variables have changed all the tasks are still executing error free, and the + * check task toggles the onboard LED. Should any task contain an error at any time + * the LED toggle rate will change from 3 seconds to 500ms. + * + * The "Register Check" tasks. These tasks fill the CPU registers with known + * values, then check that each register still contains the expected value, the + * discovery of an unexpected value being indicative of an error in the RTOS + * context switch mechanism. The register check tasks operate at low priority + * so are switched in and out frequently. + * + */ + +/* Scheduler includes. */ +#include "FreeRTOS.h" +#include "task.h" + +/* Xilinx library includes. */ +#include "xcache_l.h" +#include "xintc.h" + +/* Demo application includes. */ +#include "flash.h" +#include "integer.h" +#include "comtest2.h" +#include "semtest.h" +#include "BlockQ.h" +#include "dynamic.h" +#include "GenQTest.h" +#include "QPeek.h" +#include "blocktim.h" +#include "death.h" +#include "partest.h" +#include "countsem.h" +#include "recmutex.h" +#include "flop.h" +#include "flop-reg-test.h" + +/* Priorities assigned to the demo tasks. */ +#define mainCHECK_TASK_PRIORITY ( tskIDLE_PRIORITY + 4 ) +#define mainSEM_TEST_PRIORITY ( tskIDLE_PRIORITY + 2 ) +#define mainCOM_TEST_PRIORITY ( tskIDLE_PRIORITY + 1 ) +#define mainQUEUE_BLOCK_PRIORITY ( tskIDLE_PRIORITY + 1 ) +#define mainDEATH_PRIORITY ( tskIDLE_PRIORITY + 1 ) +#define mainLED_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 ) +#define mainGENERIC_QUEUE_PRIORITY ( tskIDLE_PRIORITY ) +#define mainQUEUE_POLL_PRIORITY ( tskIDLE_PRIORITY + 1 ) +#define mainFLOP_PRIORITY ( tskIDLE_PRIORITY ) + +/* The first LED used by the COM test and check tasks respectively. */ +#define mainCOM_TEST_LED ( 4 ) +#define mainCHECK_TEST_LED ( 3 ) + +/* The baud rate used by the comtest tasks is set by the hardware, so the +baud rate parameters passed into the comtest initialisation has no effect. */ +#define mainBAUD_SET_IN_HARDWARE ( 0 ) + +/* Delay periods used by the check task. If no errors have been found then +the check LED will toggle every mainNO_ERROR_CHECK_DELAY milliseconds. If an +error has been found at any time then the toggle rate will increase to +mainERROR_CHECK_DELAY milliseconds. */ +#define mainNO_ERROR_CHECK_DELAY ( ( portTickType ) 3000 / portTICK_RATE_MS ) +#define mainERROR_CHECK_DELAY ( ( portTickType ) 500 / portTICK_RATE_MS ) + + +/* + * The tasks defined within this file - described within the comments at the + * head of this page. + */ +static void prvRegTestTask1( void *pvParameters ); +static void prvRegTestTask2( void *pvParameters ); +static void prvErrorChecks( void *pvParameters ); + +/* + * Called by the 'check' task to inspect all the standard demo tasks within + * the system, as described within the comments at the head of this page. + */ +static portBASE_TYPE prvCheckOtherTasksAreStillRunning( void ); + +/* + * Perform any hardware initialisation required by the demo application. + */ +static void prvSetupHardware( void ); + +/*-----------------------------------------------------------*/ + +/* xRegTestStatus will get set to pdFAIL by the regtest tasks if they +discover an unexpected value. */ +static volatile unsigned portBASE_TYPE xRegTestStatus = pdPASS; + +/* Counters used to ensure the regtest tasks are still running. */ +static volatile unsigned portLONG ulRegTest1Counter = 0UL, ulRegTest2Counter = 0UL; + +/*-----------------------------------------------------------*/ + +int main( void ) +{ + + /* Must be called prior to installing any interrupt handlers! */ + vPortSetupInterruptController(); + + /* In this case prvSetupHardware() just enables the caches and and + configures the IO ports for the LED outputs. */ + prvSetupHardware(); + + /* Start the standard demo application tasks. Note that the baud rate used + by the comtest tasks is set by the hardware, so the baud rate parameter + passed has no effect. */ + vStartLEDFlashTasks( mainLED_TASK_PRIORITY ); + vStartIntegerMathTasks( tskIDLE_PRIORITY ); + vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainBAUD_SET_IN_HARDWARE, mainCOM_TEST_LED ); + vStartSemaphoreTasks( mainSEM_TEST_PRIORITY ); + vStartBlockingQueueTasks ( mainQUEUE_BLOCK_PRIORITY ); + vStartDynamicPriorityTasks(); + vStartGenericQueueTasks( mainGENERIC_QUEUE_PRIORITY ); + vStartQueuePeekTasks(); + vCreateBlockTimeTasks(); + vStartCountingSemaphoreTasks(); + vStartRecursiveMutexTasks(); + #if ( configUSE_FPU == 1 ) { /* A different project is provided that has configUSE_FPU set to 1 in order to demonstrate all the settings required to use the floating point unit. If you wish to use the floating point unit do not start - with this project. */ - vStartMathTasks( mainFLOP_PRIORITY ); + with this project. */ + vStartMathTasks( mainFLOP_PRIORITY ); vStartFlopRegTests(); - } - #endif - - /* Create the tasks defined within this file. */ - xTaskCreate( prvRegTestTask1, ( signed portCHAR * ) "Regtest1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL ); - xTaskCreate( prvRegTestTask2, ( signed portCHAR * ) "Regtest2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL ); - xTaskCreate( prvErrorChecks, ( signed portCHAR * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL ); - - /* The suicide tasks must be started last as they record the number of other - tasks that exist within the system. The value is then used to ensure at run - time the number of tasks that exists is within expected bounds. */ - vCreateSuicidalTasks( mainDEATH_PRIORITY ); - - /* Now start the scheduler. Following this call the created tasks should - be executing. */ - vTaskStartScheduler(); - - /* vTaskStartScheduler() will only return if an error occurs while the - idle task is being created. */ - for( ;; ); - - return 0; -} -/*-----------------------------------------------------------*/ - -static portBASE_TYPE prvCheckOtherTasksAreStillRunning( void ) -{ -portBASE_TYPE lReturn = pdPASS; -static unsigned portLONG ulLastRegTest1Counter= 0UL, ulLastRegTest2Counter = 0UL; - - /* The demo tasks maintain a count that increments every cycle of the task - provided that the task has never encountered an error. This function - checks the counts maintained by the tasks to ensure they are still being - incremented. A count remaining at the same value between calls therefore - indicates that an error has been detected. */ - - if( xAreIntegerMathsTaskStillRunning() != pdTRUE ) - { - lReturn = pdFAIL; - } - - if( xAreComTestTasksStillRunning() != pdTRUE ) - { - lReturn = pdFAIL; - } - - if( xAreSemaphoreTasksStillRunning() != pdTRUE ) - { - lReturn = pdFAIL; - } - - if( xAreBlockingQueuesStillRunning() != pdTRUE ) - { - lReturn = pdFAIL; - } - - if( xAreDynamicPriorityTasksStillRunning() != pdTRUE ) - { - lReturn = pdFAIL; - } - - if( xIsCreateTaskStillRunning() != pdTRUE ) - { - lReturn = pdFAIL; - } - - if( xAreBlockTimeTestTasksStillRunning() != pdTRUE ) - { - lReturn = pdFAIL; - } - - if( xAreGenericQueueTasksStillRunning() != pdTRUE ) - { - lReturn = pdFAIL; - } - - if( xAreQueuePeekTasksStillRunning() != pdTRUE ) - { - lReturn = pdFAIL; - } - - if( xAreCountingSemaphoreTasksStillRunning() != pdTRUE ) - { - lReturn = pdFAIL; - } - - if( xAreRecursiveMutexTasksStillRunning() != pdTRUE ) - { - lReturn = pdFAIL; - } - - #if ( configUSE_FPU == 1 ) - if( xAreMathsTaskStillRunning() != pdTRUE ) - { - lReturn = pdFAIL; - } - - if( xAreFlopRegisterTestsStillRunning() != pdTRUE ) - { - lReturn = pdFAIL; - } - #endif - - /* Have the register test tasks found any errors? */ - if( xRegTestStatus != pdPASS ) - { - lReturn = pdFAIL; - } - - /* Are the register test tasks still looping? */ - if( ulLastRegTest1Counter == ulRegTest1Counter ) - { - lReturn = pdFAIL; - } - else - { - ulLastRegTest1Counter = ulRegTest1Counter; - } - - if( ulLastRegTest2Counter == ulRegTest2Counter ) - { - lReturn = pdFAIL; - } - else - { - ulLastRegTest2Counter = ulRegTest2Counter; - } - - return lReturn; -} -/*-----------------------------------------------------------*/ - -static void prvErrorChecks( void *pvParameters ) -{ -portTickType xDelayPeriod = mainNO_ERROR_CHECK_DELAY, xLastExecutionTime; -volatile unsigned portBASE_TYPE uxFreeStack; - - /* Just to remove compiler warning. */ - ( void ) pvParameters; - - /* This call is just to demonstrate the use of the function - nothing is - done with the value. You would expect the stack high water mark to be - lower (the function to return a larger value) here at function entry than - later following calls to other functions. */ - uxFreeStack = uxTaskGetStackHighWaterMark( NULL ); - - /* Initialise xLastExecutionTime so the first call to vTaskDelayUntil() - works correctly. */ - xLastExecutionTime = xTaskGetTickCount(); - - /* Cycle for ever, delaying then checking all the other tasks are still - operating without error. */ - for( ;; ) - { - /* Again just for demo purposes - uxFreeStack should have a lower value - here than following the call to uxTaskGetStackHighWaterMark() on the - task entry. */ - uxFreeStack = uxTaskGetStackHighWaterMark( NULL ); - - /* Wait until it is time to check again. The time we wait here depends - on whether an error has been detected or not. When an error is - detected the time is shortened resulting in a faster LED flash rate. */ - vTaskDelayUntil( &xLastExecutionTime, xDelayPeriod ); - - /* See if the other tasks are all ok. */ - if( prvCheckOtherTasksAreStillRunning() != pdPASS ) - { - /* An error occurred in one of the tasks so shorten the delay - period - which has the effect of increasing the frequency of the - LED toggle. */ - xDelayPeriod = mainERROR_CHECK_DELAY; - } - - /* Flash! */ - vParTestToggleLED( mainCHECK_TEST_LED ); - } -} -/*-----------------------------------------------------------*/ - -static void prvSetupHardware( void ) -{ - XCache_EnableICache( 0x80000000 ); - XCache_EnableDCache( 0x80000000 ); - - /* Setup the IO port for use with the LED outputs. */ - vParTestInitialise(); -} -/*-----------------------------------------------------------*/ - -void prvRegTest1Pass( void ) -{ - /* Called from the inline assembler - this cannot be static - otherwise it can get optimised away. */ - ulRegTest1Counter++; -} -/*-----------------------------------------------------------*/ - -void prvRegTest2Pass( void ) -{ - /* Called from the inline assembler - this cannot be static - otherwise it can get optimised away. */ - ulRegTest2Counter++; -} -/*-----------------------------------------------------------*/ - -void prvRegTestFail( void ) -{ - /* Called from the inline assembler - this cannot be static - otherwise it can get optimised away. */ - xRegTestStatus = pdFAIL; -} -/*-----------------------------------------------------------*/ - -static void prvRegTestTask1( void *pvParameters ) + } + #endif + + /* Create the tasks defined within this file. */ + xTaskCreate( prvRegTestTask1, ( signed portCHAR * ) "Regtest1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL ); + xTaskCreate( prvRegTestTask2, ( signed portCHAR * ) "Regtest2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL ); + xTaskCreate( prvErrorChecks, ( signed portCHAR * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL ); + + /* The suicide tasks must be started last as they record the number of other + tasks that exist within the system. The value is then used to ensure at run + time the number of tasks that exists is within expected bounds. */ + vCreateSuicidalTasks( mainDEATH_PRIORITY ); + + /* Now start the scheduler. Following this call the created tasks should + be executing. */ + vTaskStartScheduler(); + + /* vTaskStartScheduler() will only return if an error occurs while the + idle task is being created. */ + for( ;; ); + + return 0; +} +/*-----------------------------------------------------------*/ + +static portBASE_TYPE prvCheckOtherTasksAreStillRunning( void ) { - /* Just to remove compiler warning. */ - ( void ) pvParameters; - - /* The first register test task as described at the top of this file. The - values used in the registers are different to those use in the second - register test task. Also, unlike the second register test task, this task - yields between setting the register values and subsequently checking the - register values. */ - asm volatile - ( - "RegTest1Start: \n\t" \ - " \n\t" \ - " li 0, 301 \n\t" \ - " mtspr 256, 0 #USPRG0 \n\t" \ - " li 0, 501 \n\t" \ - " mtspr 8, 0 #LR \n\t" \ - " li 0, 4 \n\t" \ - " mtspr 1, 0 #XER \n\t" \ - " \n\t" \ - " li 0, 1 \n\t" \ - " li 2, 2 \n\t" \ - " li 3, 3 \n\t" \ - " li 4, 4 \n\t" \ - " li 5, 5 \n\t" \ - " li 6, 6 \n\t" \ - " li 7, 7 \n\t" \ - " li 8, 8 \n\t" \ - " li 9, 9 \n\t" \ - " li 10, 10 \n\t" \ - " li 11, 11 \n\t" \ - " li 12, 12 \n\t" \ - " li 13, 13 \n\t" \ - " li 14, 14 \n\t" \ - " li 15, 15 \n\t" \ - " li 16, 16 \n\t" \ - " li 17, 17 \n\t" \ - " li 18, 18 \n\t" \ - " li 19, 19 \n\t" \ - " li 20, 20 \n\t" \ - " li 21, 21 \n\t" \ - " li 22, 22 \n\t" \ - " li 23, 23 \n\t" \ - " li 24, 24 \n\t" \ - " li 25, 25 \n\t" \ - " li 26, 26 \n\t" \ - " li 27, 27 \n\t" \ - " li 28, 28 \n\t" \ - " li 29, 29 \n\t" \ - " li 30, 30 \n\t" \ - " li 31, 31 \n\t" \ - " \n\t" \ - " sc \n\t" \ - " nop \n\t" \ - " \n\t" \ - " cmpwi 0, 1 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 2, 2 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 3, 3 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 4, 4 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 5, 5 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 6, 6 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 7, 7 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 8, 8 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 9, 9 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 10, 10 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 11, 11 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 12, 12 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 13, 13 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 14, 14 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 15, 15 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 16, 16 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 17, 17 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 18, 18 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 19, 19 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 20, 20 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 21, 21 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 22, 22 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 23, 23 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 24, 24 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 25, 25 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 26, 26 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 27, 27 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 28, 28 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 29, 29 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 30, 30 \n\t" \ - " bne RegTest1Fail \n\t" \ - " cmpwi 31, 31 \n\t" \ - " bne RegTest1Fail \n\t" \ - " \n\t" \ - " mfspr 0, 256 #USPRG0 \n\t" \ - " cmpwi 0, 301 \n\t" \ - " bne RegTest1Fail \n\t" \ - " mfspr 0, 8 #LR \n\t" \ - " cmpwi 0, 501 \n\t" \ - " bne RegTest1Fail \n\t" \ - " mfspr 0, 1 #XER \n\t" \ - " cmpwi 0, 4 \n\t" \ - " bne RegTest1Fail \n\t" \ - " \n\t" \ - " bl prvRegTest1Pass \n\t" \ - " b RegTest1Start \n\t" \ - " \n\t" \ - "RegTest1Fail: \n\t" \ - " \n\t" \ - " \n\t" \ - " bl prvRegTestFail \n\t" \ - " b RegTest1Start \n\t" \ - ); -} -/*-----------------------------------------------------------*/ - -static void prvRegTestTask2( void *pvParameters ) +portBASE_TYPE lReturn = pdPASS; +static unsigned portLONG ulLastRegTest1Counter= 0UL, ulLastRegTest2Counter = 0UL; + + /* The demo tasks maintain a count that increments every cycle of the task + provided that the task has never encountered an error. This function + checks the counts maintained by the tasks to ensure they are still being + incremented. A count remaining at the same value between calls therefore + indicates that an error has been detected. */ + + if( xAreIntegerMathsTaskStillRunning() != pdTRUE ) + { + lReturn = pdFAIL; + } + + if( xAreComTestTasksStillRunning() != pdTRUE ) + { + lReturn = pdFAIL; + } + + if( xAreSemaphoreTasksStillRunning() != pdTRUE ) + { + lReturn = pdFAIL; + } + + if( xAreBlockingQueuesStillRunning() != pdTRUE ) + { + lReturn = pdFAIL; + } + + if( xAreDynamicPriorityTasksStillRunning() != pdTRUE ) + { + lReturn = pdFAIL; + } + + if( xIsCreateTaskStillRunning() != pdTRUE ) + { + lReturn = pdFAIL; + } + + if( xAreBlockTimeTestTasksStillRunning() != pdTRUE ) + { + lReturn = pdFAIL; + } + + if( xAreGenericQueueTasksStillRunning() != pdTRUE ) + { + lReturn = pdFAIL; + } + + if( xAreQueuePeekTasksStillRunning() != pdTRUE ) + { + lReturn = pdFAIL; + } + + if( xAreCountingSemaphoreTasksStillRunning() != pdTRUE ) + { + lReturn = pdFAIL; + } + + if( xAreRecursiveMutexTasksStillRunning() != pdTRUE ) + { + lReturn = pdFAIL; + } + + #if ( configUSE_FPU == 1 ) + if( xAreMathsTaskStillRunning() != pdTRUE ) + { + lReturn = pdFAIL; + } + + if( xAreFlopRegisterTestsStillRunning() != pdTRUE ) + { + lReturn = pdFAIL; + } + #endif + + /* Have the register test tasks found any errors? */ + if( xRegTestStatus != pdPASS ) + { + lReturn = pdFAIL; + } + + /* Are the register test tasks still looping? */ + if( ulLastRegTest1Counter == ulRegTest1Counter ) + { + lReturn = pdFAIL; + } + else + { + ulLastRegTest1Counter = ulRegTest1Counter; + } + + if( ulLastRegTest2Counter == ulRegTest2Counter ) + { + lReturn = pdFAIL; + } + else + { + ulLastRegTest2Counter = ulRegTest2Counter; + } + + return lReturn; +} +/*-----------------------------------------------------------*/ + +static void prvErrorChecks( void *pvParameters ) +{ +portTickType xDelayPeriod = mainNO_ERROR_CHECK_DELAY, xLastExecutionTime; +volatile unsigned portBASE_TYPE uxFreeStack; + + /* Just to remove compiler warning. */ + ( void ) pvParameters; + + /* This call is just to demonstrate the use of the function - nothing is + done with the value. You would expect the stack high water mark to be + lower (the function to return a larger value) here at function entry than + later following calls to other functions. */ + uxFreeStack = uxTaskGetStackHighWaterMark( NULL ); + + /* Initialise xLastExecutionTime so the first call to vTaskDelayUntil() + works correctly. */ + xLastExecutionTime = xTaskGetTickCount(); + + /* Cycle for ever, delaying then checking all the other tasks are still + operating without error. */ + for( ;; ) + { + /* Again just for demo purposes - uxFreeStack should have a lower value + here than following the call to uxTaskGetStackHighWaterMark() on the + task entry. */ + uxFreeStack = uxTaskGetStackHighWaterMark( NULL ); + + /* Wait until it is time to check again. The time we wait here depends + on whether an error has been detected or not. When an error is + detected the time is shortened resulting in a faster LED flash rate. */ + vTaskDelayUntil( &xLastExecutionTime, xDelayPeriod ); + + /* See if the other tasks are all ok. */ + if( prvCheckOtherTasksAreStillRunning() != pdPASS ) + { + /* An error occurred in one of the tasks so shorten the delay + period - which has the effect of increasing the frequency of the + LED toggle. */ + xDelayPeriod = mainERROR_CHECK_DELAY; + } + + /* Flash! */ + vParTestToggleLED( mainCHECK_TEST_LED ); + } +} +/*-----------------------------------------------------------*/ + +static void prvSetupHardware( void ) +{ + XCache_EnableICache( 0x80000000 ); + XCache_EnableDCache( 0x80000000 ); + + /* Setup the IO port for use with the LED outputs. */ + vParTestInitialise(); +} +/*-----------------------------------------------------------*/ + +void prvRegTest1Pass( void ) +{ + /* Called from the inline assembler - this cannot be static + otherwise it can get optimised away. */ + ulRegTest1Counter++; +} +/*-----------------------------------------------------------*/ + +void prvRegTest2Pass( void ) +{ + /* Called from the inline assembler - this cannot be static + otherwise it can get optimised away. */ + ulRegTest2Counter++; +} +/*-----------------------------------------------------------*/ + +void prvRegTestFail( void ) +{ + /* Called from the inline assembler - this cannot be static + otherwise it can get optimised away. */ + xRegTestStatus = pdFAIL; +} +/*-----------------------------------------------------------*/ + +static void prvRegTestTask1( void *pvParameters ) +{ + /* Just to remove compiler warning. */ + ( void ) pvParameters; + + /* The first register test task as described at the top of this file. The + values used in the registers are different to those use in the second + register test task. Also, unlike the second register test task, this task + yields between setting the register values and subsequently checking the + register values. */ + asm volatile + ( + "RegTest1Start: \n\t" \ + " \n\t" \ + " li 0, 301 \n\t" \ + " mtspr 256, 0 #USPRG0 \n\t" \ + " li 0, 501 \n\t" \ + " mtspr 8, 0 #LR \n\t" \ + " li 0, 4 \n\t" \ + " mtspr 1, 0 #XER \n\t" \ + " \n\t" \ + " li 0, 1 \n\t" \ + " li 2, 2 \n\t" \ + " li 3, 3 \n\t" \ + " li 4, 4 \n\t" \ + " li 5, 5 \n\t" \ + " li 6, 6 \n\t" \ + " li 7, 7 \n\t" \ + " li 8, 8 \n\t" \ + " li 9, 9 \n\t" \ + " li 10, 10 \n\t" \ + " li 11, 11 \n\t" \ + " li 12, 12 \n\t" \ + " li 13, 13 \n\t" \ + " li 14, 14 \n\t" \ + " li 15, 15 \n\t" \ + " li 16, 16 \n\t" \ + " li 17, 17 \n\t" \ + " li 18, 18 \n\t" \ + " li 19, 19 \n\t" \ + " li 20, 20 \n\t" \ + " li 21, 21 \n\t" \ + " li 22, 22 \n\t" \ + " li 23, 23 \n\t" \ + " li 24, 24 \n\t" \ + " li 25, 25 \n\t" \ + " li 26, 26 \n\t" \ + " li 27, 27 \n\t" \ + " li 28, 28 \n\t" \ + " li 29, 29 \n\t" \ + " li 30, 30 \n\t" \ + " li 31, 31 \n\t" \ + " \n\t" \ + " sc \n\t" \ + " nop \n\t" \ + " \n\t" \ + " cmpwi 0, 1 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 2, 2 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 3, 3 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 4, 4 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 5, 5 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 6, 6 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 7, 7 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 8, 8 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 9, 9 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 10, 10 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 11, 11 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 12, 12 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 13, 13 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 14, 14 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 15, 15 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 16, 16 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 17, 17 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 18, 18 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 19, 19 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 20, 20 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 21, 21 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 22, 22 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 23, 23 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 24, 24 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 25, 25 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 26, 26 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 27, 27 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 28, 28 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 29, 29 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 30, 30 \n\t" \ + " bne RegTest1Fail \n\t" \ + " cmpwi 31, 31 \n\t" \ + " bne RegTest1Fail \n\t" \ + " \n\t" \ + " mfspr 0, 256 #USPRG0 \n\t" \ + " cmpwi 0, 301 \n\t" \ + " bne RegTest1Fail \n\t" \ + " mfspr 0, 8 #LR \n\t" \ + " cmpwi 0, 501 \n\t" \ + " bne RegTest1Fail \n\t" \ + " mfspr 0, 1 #XER \n\t" \ + " cmpwi 0, 4 \n\t" \ + " bne RegTest1Fail \n\t" \ + " \n\t" \ + " bl prvRegTest1Pass \n\t" \ + " b RegTest1Start \n\t" \ + " \n\t" \ + "RegTest1Fail: \n\t" \ + " \n\t" \ + " \n\t" \ + " bl prvRegTestFail \n\t" \ + " b RegTest1Start \n\t" \ + ); +} +/*-----------------------------------------------------------*/ + +static void prvRegTestTask2( void *pvParameters ) +{ + /* Just to remove compiler warning. */ + ( void ) pvParameters; + + /* The second register test task as described at the top of this file. + Note that this task fills the registers with different values to the + first register test task. */ + asm volatile + ( + "RegTest2Start: \n\t" \ + " \n\t" \ + " li 0, 300 \n\t" \ + " mtspr 256, 0 #USPRG0 \n\t" \ + " li 0, 500 \n\t" \ + " mtspr 8, 0 #LR \n\t" \ + " li 0, 4 \n\t" \ + " mtspr 1, 0 #XER \n\t" \ + " \n\t" \ + " li 0, 11 \n\t" \ + " li 2, 12 \n\t" \ + " li 3, 13 \n\t" \ + " li 4, 14 \n\t" \ + " li 5, 15 \n\t" \ + " li 6, 16 \n\t" \ + " li 7, 17 \n\t" \ + " li 8, 18 \n\t" \ + " li 9, 19 \n\t" \ + " li 10, 110 \n\t" \ + " li 11, 111 \n\t" \ + " li 12, 112 \n\t" \ + " li 13, 113 \n\t" \ + " li 14, 114 \n\t" \ + " li 15, 115 \n\t" \ + " li 16, 116 \n\t" \ + " li 17, 117 \n\t" \ + " li 18, 118 \n\t" \ + " li 19, 119 \n\t" \ + " li 20, 120 \n\t" \ + " li 21, 121 \n\t" \ + " li 22, 122 \n\t" \ + " li 23, 123 \n\t" \ + " li 24, 124 \n\t" \ + " li 25, 125 \n\t" \ + " li 26, 126 \n\t" \ + " li 27, 127 \n\t" \ + " li 28, 128 \n\t" \ + " li 29, 129 \n\t" \ + " li 30, 130 \n\t" \ + " li 31, 131 \n\t" \ + " \n\t" \ + " cmpwi 0, 11 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 2, 12 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 3, 13 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 4, 14 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 5, 15 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 6, 16 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 7, 17 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 8, 18 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 9, 19 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 10, 110 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 11, 111 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 12, 112 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 13, 113 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 14, 114 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 15, 115 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 16, 116 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 17, 117 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 18, 118 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 19, 119 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 20, 120 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 21, 121 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 22, 122 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 23, 123 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 24, 124 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 25, 125 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 26, 126 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 27, 127 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 28, 128 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 29, 129 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 30, 130 \n\t" \ + " bne RegTest2Fail \n\t" \ + " cmpwi 31, 131 \n\t" \ + " bne RegTest2Fail \n\t" \ + " \n\t" \ + " mfspr 0, 256 #USPRG0 \n\t" \ + " cmpwi 0, 300 \n\t" \ + " bne RegTest2Fail \n\t" \ + " mfspr 0, 8 #LR \n\t" \ + " cmpwi 0, 500 \n\t" \ + " bne RegTest2Fail \n\t" \ + " mfspr 0, 1 #XER \n\t" \ + " cmpwi 0, 4 \n\t" \ + " bne RegTest2Fail \n\t" \ + " \n\t" \ + " bl prvRegTest2Pass \n\t" \ + " b RegTest2Start \n\t" \ + " \n\t" \ + "RegTest2Fail: \n\t" \ + " \n\t" \ + " \n\t" \ + " bl prvRegTestFail \n\t" \ + " b RegTest2Start \n\t" \ + ); +} +/*-----------------------------------------------------------*/ + +/* This hook function will get called if there is a suspected stack overflow. +An overflow can cause the task name to be corrupted, in which case the task +handle needs to be used to determine the offending task. */ +void vApplicationStackOverflowHook( xTaskHandle xTask, signed portCHAR *pcTaskName ); +void vApplicationStackOverflowHook( xTaskHandle xTask, signed portCHAR *pcTaskName ) { - /* Just to remove compiler warning. */ - ( void ) pvParameters; - - /* The second register test task as described at the top of this file. - Note that this task fills the registers with different values to the - first register test task. */ - asm volatile - ( - "RegTest2Start: \n\t" \ - " \n\t" \ - " li 0, 300 \n\t" \ - " mtspr 256, 0 #USPRG0 \n\t" \ - " li 0, 500 \n\t" \ - " mtspr 8, 0 #LR \n\t" \ - " li 0, 4 \n\t" \ - " mtspr 1, 0 #XER \n\t" \ - " \n\t" \ - " li 0, 11 \n\t" \ - " li 2, 12 \n\t" \ - " li 3, 13 \n\t" \ - " li 4, 14 \n\t" \ - " li 5, 15 \n\t" \ - " li 6, 16 \n\t" \ - " li 7, 17 \n\t" \ - " li 8, 18 \n\t" \ - " li 9, 19 \n\t" \ - " li 10, 110 \n\t" \ - " li 11, 111 \n\t" \ - " li 12, 112 \n\t" \ - " li 13, 113 \n\t" \ - " li 14, 114 \n\t" \ - " li 15, 115 \n\t" \ - " li 16, 116 \n\t" \ - " li 17, 117 \n\t" \ - " li 18, 118 \n\t" \ - " li 19, 119 \n\t" \ - " li 20, 120 \n\t" \ - " li 21, 121 \n\t" \ - " li 22, 122 \n\t" \ - " li 23, 123 \n\t" \ - " li 24, 124 \n\t" \ - " li 25, 125 \n\t" \ - " li 26, 126 \n\t" \ - " li 27, 127 \n\t" \ - " li 28, 128 \n\t" \ - " li 29, 129 \n\t" \ - " li 30, 130 \n\t" \ - " li 31, 131 \n\t" \ - " \n\t" \ - " cmpwi 0, 11 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 2, 12 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 3, 13 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 4, 14 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 5, 15 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 6, 16 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 7, 17 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 8, 18 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 9, 19 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 10, 110 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 11, 111 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 12, 112 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 13, 113 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 14, 114 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 15, 115 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 16, 116 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 17, 117 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 18, 118 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 19, 119 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 20, 120 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 21, 121 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 22, 122 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 23, 123 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 24, 124 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 25, 125 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 26, 126 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 27, 127 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 28, 128 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 29, 129 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 30, 130 \n\t" \ - " bne RegTest2Fail \n\t" \ - " cmpwi 31, 131 \n\t" \ - " bne RegTest2Fail \n\t" \ - " \n\t" \ - " mfspr 0, 256 #USPRG0 \n\t" \ - " cmpwi 0, 300 \n\t" \ - " bne RegTest2Fail \n\t" \ - " mfspr 0, 8 #LR \n\t" \ - " cmpwi 0, 500 \n\t" \ - " bne RegTest2Fail \n\t" \ - " mfspr 0, 1 #XER \n\t" \ - " cmpwi 0, 4 \n\t" \ - " bne RegTest2Fail \n\t" \ - " \n\t" \ - " bl prvRegTest2Pass \n\t" \ - " b RegTest2Start \n\t" \ - " \n\t" \ - "RegTest2Fail: \n\t" \ - " \n\t" \ - " \n\t" \ - " bl prvRegTestFail \n\t" \ - " b RegTest2Start \n\t" \ - ); -} -/*-----------------------------------------------------------*/ - -/* This hook function will get called if there is a suspected stack overflow. -An overflow can cause the task name to be corrupted, in which case the task -handle needs to be used to determine the offending task. */ -void vApplicationStackOverflowHook( xTaskHandle xTask, signed portCHAR *pcTaskName ); -void vApplicationStackOverflowHook( xTaskHandle xTask, signed portCHAR *pcTaskName ) -{ -/* To prevent the optimiser removing the variables. */ -volatile xTaskHandle xTaskIn = xTask; -volatile signed portCHAR *pcTaskNameIn = pcTaskName; +/* To prevent the optimiser removing the variables. */ +volatile xTaskHandle xTaskIn = xTask; +volatile signed portCHAR *pcTaskNameIn = pcTaskName; /* Remove compiler warnings. */ ( void ) xTaskIn; ( void ) pcTaskNameIn; - - /* The following three calls are simply to stop compiler warnings about the - functions not being used - they are called from the inline assembly. */ - prvRegTest1Pass(); - prvRegTest2Pass(); - prvRegTestFail(); - - for( ;; ); -} - - - + + /* The following three calls are simply to stop compiler warnings about the + functions not being used - they are called from the inline assembly. */ + prvRegTest1Pass(); + prvRegTest2Pass(); + prvRegTestFail(); + + for( ;; ); +} + + + diff --git a/Demo/PPC405_Xilinx_Virtex4_GCC/RTOSDemo/partest/partest.c b/Demo/PPC405_Xilinx_Virtex4_GCC/RTOSDemo/partest/partest.c index ac575c096..5daf7cb79 100644 --- a/Demo/PPC405_Xilinx_Virtex4_GCC/RTOSDemo/partest/partest.c +++ b/Demo/PPC405_Xilinx_Virtex4_GCC/RTOSDemo/partest/partest.c @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/PPC405_Xilinx_Virtex4_GCC/RTOSDemo/serial/serial.c b/Demo/PPC405_Xilinx_Virtex4_GCC/RTOSDemo/serial/serial.c index 4c39973b4..c3d28150a 100644 --- a/Demo/PPC405_Xilinx_Virtex4_GCC/RTOSDemo/serial/serial.c +++ b/Demo/PPC405_Xilinx_Virtex4_GCC/RTOSDemo/serial/serial.c @@ -1,233 +1,233 @@ -/* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. - - This file is part of the FreeRTOS.org distribution. - - FreeRTOS.org is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - FreeRTOS.org is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with FreeRTOS.org; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - A special exception to the GPL can be applied should you wish to distribute - a combined work that includes FreeRTOS.org, without being obliged to provide - the source code for any proprietary components. See the licensing section - of http://www.FreeRTOS.org for full details of how and when the exception - can be applied. - - *************************************************************************** - *************************************************************************** - * * - * SAVE TIME AND MONEY! We can port FreeRTOS.org to your own hardware, * - * and even write all or part of your application on your behalf. * - * See http://www.OpenRTOS.com for details of the services we provide to * - * expedite your project. * - * * - *************************************************************************** - *************************************************************************** - - Please ensure to read the configuration and relevant port sections of the - online documentation. - - http://www.FreeRTOS.org - Documentation, latest information, license and - contact details. - - http://www.SafeRTOS.com - A version that is certified for use in safety - critical systems. - - http://www.OpenRTOS.com - Commercial support, development, porting, - licensing and training services. -*/ - - -/* - BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER FOR UART -*/ - -/* Scheduler includes. */ -#include "FreeRTOS.h" -#include "queue.h" -#include "task.h" - -/* Demo application includes. */ -#include "serial.h" - -/* Library includes. */ -#include "xparameters.h" -#include "xuartlite.h" -#include "xuartlite_l.h" - -/*-----------------------------------------------------------*/ - -/* Queues used to hold received characters, and characters waiting to be -transmitted. */ -static xQueueHandle xRxedChars; -static xQueueHandle xCharsForTx; - -/* Structure that maintains information on the UART being used. */ -static XUartLite xUART; - -/* - * Sample UART interrupt handler. Note this is used to demonstrate the kernel - * features and test the port - it is not intended to represent an efficient - * implementation. - */ -static void vSerialISR( XUartLite *pxUART ); - -/*-----------------------------------------------------------*/ - -xComPortHandle xSerialPortInitMinimal( unsigned portLONG ulWantedBaud, unsigned portBASE_TYPE uxQueueLength ) -{ - /* NOTE: The baud rate used by this driver is determined by the hardware - parameterization of the UART Lite peripheral, and the baud value passed to - this function has no effect. */ - ( void ) ulWantedBaud; - - /* Create the queues used to hold Rx and Tx characters. */ - xRxedChars = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed portCHAR ) ); - xCharsForTx = xQueueCreate( uxQueueLength + 1, ( unsigned portBASE_TYPE ) sizeof( signed portCHAR ) ); - - /* Only initialise the UART if the queues were created correctly. */ - if( ( xRxedChars != NULL ) && ( xCharsForTx != NULL ) ) - { - - XUartLite_Initialize( &xUART, XPAR_RS232_UART_DEVICE_ID ); - XUartLite_ResetFifos( &xUART ); - XUartLite_DisableInterrupt( &xUART ); - - if( xPortInstallInterruptHandler( XPAR_XPS_INTC_0_RS232_UART_INTERRUPT_INTR, ( XInterruptHandler )vSerialISR, (void *)&xUART ) == pdPASS ) - { - /* xPortInstallInterruptHandler() could fail if - vPortSetupInterruptController() has not been called prior to this - function. */ - XUartLite_EnableInterrupt( &xUART ); - } - } - - /* There is only one port so the handle is not used. */ - return ( xComPortHandle ) 0; -} -/*-----------------------------------------------------------*/ - -signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed portCHAR *pcRxedChar, portTickType xBlockTime ) -{ - /* The port handle is not required as this driver only supports one UART. */ - ( void ) pxPort; - - /* Get the next character from the buffer. Return false if no characters - are available, or arrive before xBlockTime expires. */ - if( xQueueReceive( xRxedChars, pcRxedChar, xBlockTime ) ) - { - return pdTRUE; - } - else - { - return pdFALSE; - } -} -/*-----------------------------------------------------------*/ - -signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed portCHAR cOutChar, portTickType xBlockTime ) -{ -portBASE_TYPE xReturn = pdTRUE; +/* + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. + + This file is part of the FreeRTOS.org distribution. + + FreeRTOS.org is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + FreeRTOS.org is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with FreeRTOS.org; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + A special exception to the GPL can be applied should you wish to distribute + a combined work that includes FreeRTOS.org, without being obliged to provide + the source code for any proprietary components. See the licensing section + of http://www.FreeRTOS.org for full details of how and when the exception + can be applied. + + *************************************************************************** + *************************************************************************** + * * + * SAVE TIME AND MONEY! We can port FreeRTOS.org to your own hardware, * + * and even write all or part of your application on your behalf. * + * See http://www.OpenRTOS.com for details of the services we provide to * + * expedite your project. * + * * + *************************************************************************** + *************************************************************************** + + Please ensure to read the configuration and relevant port sections of the + online documentation. + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + + +/* + BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER FOR UART +*/ + +/* Scheduler includes. */ +#include "FreeRTOS.h" +#include "queue.h" +#include "task.h" + +/* Demo application includes. */ +#include "serial.h" + +/* Library includes. */ +#include "xparameters.h" +#include "xuartlite.h" +#include "xuartlite_l.h" + +/*-----------------------------------------------------------*/ + +/* Queues used to hold received characters, and characters waiting to be +transmitted. */ +static xQueueHandle xRxedChars; +static xQueueHandle xCharsForTx; + +/* Structure that maintains information on the UART being used. */ +static XUartLite xUART; + +/* + * Sample UART interrupt handler. Note this is used to demonstrate the kernel + * features and test the port - it is not intended to represent an efficient + * implementation. + */ +static void vSerialISR( XUartLite *pxUART ); + +/*-----------------------------------------------------------*/ + +xComPortHandle xSerialPortInitMinimal( unsigned portLONG ulWantedBaud, unsigned portBASE_TYPE uxQueueLength ) +{ + /* NOTE: The baud rate used by this driver is determined by the hardware + parameterization of the UART Lite peripheral, and the baud value passed to + this function has no effect. */ + ( void ) ulWantedBaud; + + /* Create the queues used to hold Rx and Tx characters. */ + xRxedChars = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed portCHAR ) ); + xCharsForTx = xQueueCreate( uxQueueLength + 1, ( unsigned portBASE_TYPE ) sizeof( signed portCHAR ) ); + + /* Only initialise the UART if the queues were created correctly. */ + if( ( xRxedChars != NULL ) && ( xCharsForTx != NULL ) ) + { + + XUartLite_Initialize( &xUART, XPAR_RS232_UART_DEVICE_ID ); + XUartLite_ResetFifos( &xUART ); + XUartLite_DisableInterrupt( &xUART ); + + if( xPortInstallInterruptHandler( XPAR_XPS_INTC_0_RS232_UART_INTERRUPT_INTR, ( XInterruptHandler )vSerialISR, (void *)&xUART ) == pdPASS ) + { + /* xPortInstallInterruptHandler() could fail if + vPortSetupInterruptController() has not been called prior to this + function. */ + XUartLite_EnableInterrupt( &xUART ); + } + } + + /* There is only one port so the handle is not used. */ + return ( xComPortHandle ) 0; +} +/*-----------------------------------------------------------*/ + +signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed portCHAR *pcRxedChar, portTickType xBlockTime ) +{ + /* The port handle is not required as this driver only supports one UART. */ + ( void ) pxPort; + + /* Get the next character from the buffer. Return false if no characters + are available, or arrive before xBlockTime expires. */ + if( xQueueReceive( xRxedChars, pcRxedChar, xBlockTime ) ) + { + return pdTRUE; + } + else + { + return pdFALSE; + } +} +/*-----------------------------------------------------------*/ + +signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed portCHAR cOutChar, portTickType xBlockTime ) +{ +portBASE_TYPE xReturn = pdTRUE; /* Just to remove compiler warning. */ ( void ) pxPort; - - portENTER_CRITICAL(); - { - /* If the UART FIFO is full we can block posting the new data on the - Tx queue. */ - if( XUartLite_mIsTransmitFull( XPAR_RS232_UART_BASEADDR ) ) - { - if( xQueueSend( xCharsForTx, &cOutChar, xBlockTime ) != pdPASS ) - { - xReturn = pdFAIL; - } - } - /* Otherwise, if there is data already in the queue we should add the - new data to the back of the queue to ensure the sequencing is - maintained. */ - else if( uxQueueMessagesWaiting( xCharsForTx ) ) - { - if( xQueueSend( xCharsForTx, &cOutChar, xBlockTime ) != pdPASS ) - { - xReturn = pdFAIL; - } - } - /* If the UART FIFO is not full and there is no data already in the - queue we can write directly to the FIFO without disrupting the - sequence. */ - else - { - XIo_Out32( XPAR_RS232_UART_BASEADDR + XUL_TX_FIFO_OFFSET, cOutChar ); - } - } - portEXIT_CRITICAL(); - - return xReturn; -} -/*-----------------------------------------------------------*/ - -void vSerialClose( xComPortHandle xPort ) -{ - /* Not supported as not required by the demo application. */ - ( void ) xPort; -} -/*-----------------------------------------------------------*/ - -static void vSerialISR( XUartLite *pxUART ) -{ -unsigned portLONG ulISRStatus; -portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE, lDidSomething; -portCHAR cChar; + + portENTER_CRITICAL(); + { + /* If the UART FIFO is full we can block posting the new data on the + Tx queue. */ + if( XUartLite_mIsTransmitFull( XPAR_RS232_UART_BASEADDR ) ) + { + if( xQueueSend( xCharsForTx, &cOutChar, xBlockTime ) != pdPASS ) + { + xReturn = pdFAIL; + } + } + /* Otherwise, if there is data already in the queue we should add the + new data to the back of the queue to ensure the sequencing is + maintained. */ + else if( uxQueueMessagesWaiting( xCharsForTx ) ) + { + if( xQueueSend( xCharsForTx, &cOutChar, xBlockTime ) != pdPASS ) + { + xReturn = pdFAIL; + } + } + /* If the UART FIFO is not full and there is no data already in the + queue we can write directly to the FIFO without disrupting the + sequence. */ + else + { + XIo_Out32( XPAR_RS232_UART_BASEADDR + XUL_TX_FIFO_OFFSET, cOutChar ); + } + } + portEXIT_CRITICAL(); + + return xReturn; +} +/*-----------------------------------------------------------*/ + +void vSerialClose( xComPortHandle xPort ) +{ + /* Not supported as not required by the demo application. */ + ( void ) xPort; +} +/*-----------------------------------------------------------*/ + +static void vSerialISR( XUartLite *pxUART ) +{ +unsigned portLONG ulISRStatus; +portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE, lDidSomething; +portCHAR cChar; /* Just to remove compiler warning. */ ( void ) pxUART; - - do - { - lDidSomething = pdFALSE; - - ulISRStatus = XIo_In32( XPAR_RS232_UART_BASEADDR + XUL_STATUS_REG_OFFSET ); - - if( ( ulISRStatus & XUL_SR_RX_FIFO_VALID_DATA ) != 0 ) - { - /* A character is available - place it in the queue of received - characters. This might wake a task that was blocked waiting for - data. */ - cChar = ( portCHAR ) XIo_In32( XPAR_RS232_UART_BASEADDR + XUL_RX_FIFO_OFFSET ); - xQueueSendFromISR( xRxedChars, &cChar, &xHigherPriorityTaskWoken ); - lDidSomething = pdTRUE; - } - - if( ( ulISRStatus & XUL_SR_TX_FIFO_EMPTY ) != 0 ) - { - /* There is space in the FIFO - if there are any characters queue for - transmission they can be sent to the UART now. This might unblock a - task that was waiting for space to become available on the Tx queue. */ - if( xQueueReceiveFromISR( xCharsForTx, &cChar, &xHigherPriorityTaskWoken ) == pdTRUE ) - { - XIo_Out32( XPAR_RS232_UART_BASEADDR + XUL_TX_FIFO_OFFSET, cChar ); - lDidSomething = pdTRUE; - } - } - } while( lDidSomething == pdTRUE ); - - /* If we woke any tasks we may require a context switch. */ - if( xHigherPriorityTaskWoken ) - { - portYIELD_FROM_ISR(); - } -} - - - + + do + { + lDidSomething = pdFALSE; + + ulISRStatus = XIo_In32( XPAR_RS232_UART_BASEADDR + XUL_STATUS_REG_OFFSET ); + + if( ( ulISRStatus & XUL_SR_RX_FIFO_VALID_DATA ) != 0 ) + { + /* A character is available - place it in the queue of received + characters. This might wake a task that was blocked waiting for + data. */ + cChar = ( portCHAR ) XIo_In32( XPAR_RS232_UART_BASEADDR + XUL_RX_FIFO_OFFSET ); + xQueueSendFromISR( xRxedChars, &cChar, &xHigherPriorityTaskWoken ); + lDidSomething = pdTRUE; + } + + if( ( ulISRStatus & XUL_SR_TX_FIFO_EMPTY ) != 0 ) + { + /* There is space in the FIFO - if there are any characters queue for + transmission they can be sent to the UART now. This might unblock a + task that was waiting for space to become available on the Tx queue. */ + if( xQueueReceiveFromISR( xCharsForTx, &cChar, &xHigherPriorityTaskWoken ) == pdTRUE ) + { + XIo_Out32( XPAR_RS232_UART_BASEADDR + XUL_TX_FIFO_OFFSET, cChar ); + lDidSomething = pdTRUE; + } + } + } while( lDidSomething == pdTRUE ); + + /* If we woke any tasks we may require a context switch. */ + if( xHigherPriorityTaskWoken ) + { + portYIELD_FROM_ISR(); + } +} + + + diff --git a/Demo/WizNET_DEMO_GCC_ARM7/FreeRTOSConfig.h b/Demo/WizNET_DEMO_GCC_ARM7/FreeRTOSConfig.h index a782dd07f..570386f34 100644 --- a/Demo/WizNET_DEMO_GCC_ARM7/FreeRTOSConfig.h +++ b/Demo/WizNET_DEMO_GCC_ARM7/FreeRTOSConfig.h @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/WizNET_DEMO_GCC_ARM7/HTTP_Serv.c b/Demo/WizNET_DEMO_GCC_ARM7/HTTP_Serv.c index 4eea5b57f..bb929f880 100644 --- a/Demo/WizNET_DEMO_GCC_ARM7/HTTP_Serv.c +++ b/Demo/WizNET_DEMO_GCC_ARM7/HTTP_Serv.c @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/WizNET_DEMO_GCC_ARM7/HTTP_Serv.h b/Demo/WizNET_DEMO_GCC_ARM7/HTTP_Serv.h index 39577d97c..26d96b0ed 100644 --- a/Demo/WizNET_DEMO_GCC_ARM7/HTTP_Serv.h +++ b/Demo/WizNET_DEMO_GCC_ARM7/HTTP_Serv.h @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/WizNET_DEMO_GCC_ARM7/Makefile b/Demo/WizNET_DEMO_GCC_ARM7/Makefile index 47e9d8639..958976f9c 100644 --- a/Demo/WizNET_DEMO_GCC_ARM7/Makefile +++ b/Demo/WizNET_DEMO_GCC_ARM7/Makefile @@ -1,4 +1,4 @@ -# FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. +# FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. # # This file is part of the FreeRTOS.org distribution. # diff --git a/Demo/WizNET_DEMO_GCC_ARM7/TCP.c b/Demo/WizNET_DEMO_GCC_ARM7/TCP.c index 78cc17960..f60f0616c 100644 --- a/Demo/WizNET_DEMO_GCC_ARM7/TCP.c +++ b/Demo/WizNET_DEMO_GCC_ARM7/TCP.c @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/WizNET_DEMO_GCC_ARM7/TCP.h b/Demo/WizNET_DEMO_GCC_ARM7/TCP.h index c27c7642f..9b3c2648c 100644 --- a/Demo/WizNET_DEMO_GCC_ARM7/TCP.h +++ b/Demo/WizNET_DEMO_GCC_ARM7/TCP.h @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/WizNET_DEMO_GCC_ARM7/TCPISR.c b/Demo/WizNET_DEMO_GCC_ARM7/TCPISR.c index 42aab12e8..fe85ff16b 100644 --- a/Demo/WizNET_DEMO_GCC_ARM7/TCPISR.c +++ b/Demo/WizNET_DEMO_GCC_ARM7/TCPISR.c @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/WizNET_DEMO_GCC_ARM7/html_pages.h b/Demo/WizNET_DEMO_GCC_ARM7/html_pages.h index cb9263f09..da1d15567 100644 --- a/Demo/WizNET_DEMO_GCC_ARM7/html_pages.h +++ b/Demo/WizNET_DEMO_GCC_ARM7/html_pages.h @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/WizNET_DEMO_GCC_ARM7/i2c.c b/Demo/WizNET_DEMO_GCC_ARM7/i2c.c index a9acba839..37edf2753 100644 --- a/Demo/WizNET_DEMO_GCC_ARM7/i2c.c +++ b/Demo/WizNET_DEMO_GCC_ARM7/i2c.c @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/WizNET_DEMO_GCC_ARM7/i2c.h b/Demo/WizNET_DEMO_GCC_ARM7/i2c.h index bf1060007..bfdf51eb6 100644 --- a/Demo/WizNET_DEMO_GCC_ARM7/i2c.h +++ b/Demo/WizNET_DEMO_GCC_ARM7/i2c.h @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/WizNET_DEMO_GCC_ARM7/i2cISR.c b/Demo/WizNET_DEMO_GCC_ARM7/i2cISR.c index 8e0164032..a37f1119e 100644 --- a/Demo/WizNET_DEMO_GCC_ARM7/i2cISR.c +++ b/Demo/WizNET_DEMO_GCC_ARM7/i2cISR.c @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/WizNET_DEMO_GCC_ARM7/main.c b/Demo/WizNET_DEMO_GCC_ARM7/main.c index f3c7a5eb0..f201056ff 100644 --- a/Demo/WizNET_DEMO_GCC_ARM7/main.c +++ b/Demo/WizNET_DEMO_GCC_ARM7/main.c @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/WizNET_DEMO_TERN_186/FreeRTOSConfig.h b/Demo/WizNET_DEMO_TERN_186/FreeRTOSConfig.h index 27cbdc87a..55df0822d 100644 --- a/Demo/WizNET_DEMO_TERN_186/FreeRTOSConfig.h +++ b/Demo/WizNET_DEMO_TERN_186/FreeRTOSConfig.h @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/WizNET_DEMO_TERN_186/HTTPTask.c b/Demo/WizNET_DEMO_TERN_186/HTTPTask.c index b0400bcd1..579fc5645 100644 --- a/Demo/WizNET_DEMO_TERN_186/HTTPTask.c +++ b/Demo/WizNET_DEMO_TERN_186/HTTPTask.c @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/WizNET_DEMO_TERN_186/HTTPTask.h b/Demo/WizNET_DEMO_TERN_186/HTTPTask.h index 6525b26e5..e837c0ea4 100644 --- a/Demo/WizNET_DEMO_TERN_186/HTTPTask.h +++ b/Demo/WizNET_DEMO_TERN_186/HTTPTask.h @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/WizNET_DEMO_TERN_186/main.c b/Demo/WizNET_DEMO_TERN_186/main.c index a0836d393..71db86f8c 100644 --- a/Demo/WizNET_DEMO_TERN_186/main.c +++ b/Demo/WizNET_DEMO_TERN_186/main.c @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/WizNET_DEMO_TERN_186/serial/serial.c b/Demo/WizNET_DEMO_TERN_186/serial/serial.c index 388871fe9..88c620799 100644 --- a/Demo/WizNET_DEMO_TERN_186/serial/serial.c +++ b/Demo/WizNET_DEMO_TERN_186/serial/serial.c @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/uIP_Demo_IAR_ARM7/EMAC/EMAClISR.s79 b/Demo/uIP_Demo_IAR_ARM7/EMAC/EMAClISR.s79 index 576eb94a6..8a615743a 100644 --- a/Demo/uIP_Demo_IAR_ARM7/EMAC/EMAClISR.s79 +++ b/Demo/uIP_Demo_IAR_ARM7/EMAC/EMAClISR.s79 @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/uIP_Demo_IAR_ARM7/EMAC/SAM7_EMAC.c b/Demo/uIP_Demo_IAR_ARM7/EMAC/SAM7_EMAC.c index 418b08ec3..94beaec06 100644 --- a/Demo/uIP_Demo_IAR_ARM7/EMAC/SAM7_EMAC.c +++ b/Demo/uIP_Demo_IAR_ARM7/EMAC/SAM7_EMAC.c @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/uIP_Demo_IAR_ARM7/FreeRTOSConfig.h b/Demo/uIP_Demo_IAR_ARM7/FreeRTOSConfig.h index 976d6cc4c..7a7e8731f 100644 --- a/Demo/uIP_Demo_IAR_ARM7/FreeRTOSConfig.h +++ b/Demo/uIP_Demo_IAR_ARM7/FreeRTOSConfig.h @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/uIP_Demo_IAR_ARM7/ParTest/ParTest.c b/Demo/uIP_Demo_IAR_ARM7/ParTest/ParTest.c index 5a9fc163e..7dc335237 100644 --- a/Demo/uIP_Demo_IAR_ARM7/ParTest/ParTest.c +++ b/Demo/uIP_Demo_IAR_ARM7/ParTest/ParTest.c @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/uIP_Demo_IAR_ARM7/main.c b/Demo/uIP_Demo_IAR_ARM7/main.c index 5ed071ca7..3538a4b79 100644 --- a/Demo/uIP_Demo_IAR_ARM7/main.c +++ b/Demo/uIP_Demo_IAR_ARM7/main.c @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/uIP_Demo_Rowley_ARM7/FreeRTOSConfig.h b/Demo/uIP_Demo_Rowley_ARM7/FreeRTOSConfig.h index e669e85d9..444b436d4 100644 --- a/Demo/uIP_Demo_Rowley_ARM7/FreeRTOSConfig.h +++ b/Demo/uIP_Demo_Rowley_ARM7/FreeRTOSConfig.h @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. diff --git a/Demo/uIP_Demo_Rowley_ARM7/main.c b/Demo/uIP_Demo_Rowley_ARM7/main.c index 52d8f5a6f..681fd7a2b 100644 --- a/Demo/uIP_Demo_Rowley_ARM7/main.c +++ b/Demo/uIP_Demo_Rowley_ARM7/main.c @@ -1,5 +1,5 @@ /* - FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.2 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution.