mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-20 21:41:59 -04:00
Prepare for release.
This commit is contained in:
parent
079f9f4ee2
commit
9dace4de75
|
@ -59,7 +59,7 @@
|
||||||
#define partstFIO2_BITS ( ( unsigned long ) 0x0000007C )
|
#define partstFIO2_BITS ( ( unsigned long ) 0x0000007C )
|
||||||
#define partstFIO1_BITS ( ( unsigned long ) 0xB0000000 )
|
#define partstFIO1_BITS ( ( unsigned long ) 0xB0000000 )
|
||||||
#define partstNUM_LEDS ( 5 )
|
#define partstNUM_LEDS ( 5 )
|
||||||
#define partstALL_OUTPUTS_OFF ( ( unsigned portLONG ) 0xff )
|
#define partstALL_OUTPUTS_OFF ( ( unsigned long ) 0xff )
|
||||||
|
|
||||||
/*-----------------------------------------------------------
|
/*-----------------------------------------------------------
|
||||||
* Simple parallel port IO routines.
|
* Simple parallel port IO routines.
|
||||||
|
@ -77,14 +77,16 @@ void vParTestInitialise( void )
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue )
|
void vParTestSetLED( unsigned long ulLEDIn, signed long xValue )
|
||||||
{
|
{
|
||||||
unsigned portLONG ulLED = partstFIRST_IO;
|
unsigned long ulLED = partstFIRST_IO;
|
||||||
|
|
||||||
if( uxLED < partstNUM_LEDS )
|
/* Used to set and clear LEDs on FIO2. */
|
||||||
|
|
||||||
|
if( ulLEDIn < partstNUM_LEDS )
|
||||||
{
|
{
|
||||||
/* Rotate to the wanted bit of port */
|
/* Rotate to the wanted bit of port */
|
||||||
ulLED <<= ( unsigned portLONG ) uxLED;
|
ulLED <<= ( unsigned long ) ulLEDIn;
|
||||||
|
|
||||||
/* Set of clear the output. */
|
/* Set of clear the output. */
|
||||||
if( xValue )
|
if( xValue )
|
||||||
|
@ -99,15 +101,17 @@ unsigned portLONG ulLED = partstFIRST_IO;
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
void vParTestToggleLED( unsigned portBASE_TYPE uxLED )
|
void vParTestToggleLED( unsigned long ulLEDIn )
|
||||||
{
|
{
|
||||||
unsigned portLONG ulLED = partstFIRST_IO, ulCurrentState;
|
unsigned long ulLED = partstFIRST_IO, ulCurrentState;
|
||||||
|
|
||||||
if( uxLED < partstNUM_LEDS )
|
/* Used to toggle LEDs on FIO2. */
|
||||||
|
|
||||||
|
if( ulLEDIn < partstNUM_LEDS )
|
||||||
{
|
{
|
||||||
/* Rotate to the wanted bit of port 0. Only P10 to P13 have an LED
|
/* Rotate to the wanted bit of port 0. Only P10 to P13 have an LED
|
||||||
attached. */
|
attached. */
|
||||||
ulLED <<= ( unsigned portLONG ) uxLED;
|
ulLED <<= ( unsigned long ) ulLEDIn;
|
||||||
|
|
||||||
/* If this bit is already set, clear it, and visa versa. */
|
/* If this bit is already set, clear it, and visa versa. */
|
||||||
ulCurrentState = GPIO2->FIOPIN;
|
ulCurrentState = GPIO2->FIOPIN;
|
||||||
|
@ -123,19 +127,31 @@ unsigned portLONG ulLED = partstFIRST_IO, ulCurrentState;
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
unsigned portBASE_TYPE uxParTextGetLED( unsigned portBASE_TYPE uxLED )
|
long lParTestGetLEDState( void )
|
||||||
{
|
{
|
||||||
unsigned portLONG ulLED = partstFIRST_IO;
|
/* Returns the state of the LEDs on FIO1. */
|
||||||
|
if( ( GPIO1->FIOPIN & partstFIO1_BITS ) != 0 )
|
||||||
ulLED <<= ( unsigned portLONG ) uxLED;
|
{
|
||||||
|
return pdFALSE;
|
||||||
return ( GPIO2->FIOPIN & ulLED );
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return pdTRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
long lParTestGetLEDState( unsigned portBASE_TYPE uxLED )
|
void vParTestSetLEDState( long lState )
|
||||||
{
|
{
|
||||||
return 0;
|
/* Used to set and clear the LEDs on FIO1. */
|
||||||
|
if( lState != pdFALSE )
|
||||||
|
{
|
||||||
|
GPIO1->FIOSET = partstFIO1_BITS;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GPIO1->FIOCLR = partstFIO1_BITS;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
<session>
|
<session>
|
||||||
<Bookmarks/>
|
<Bookmarks/>
|
||||||
<Breakpoints>
|
<Breakpoints>
|
||||||
<BreakpointListItem line="184" action="" hardwareBreakpoint="" trigger="" useHWbreakpoint="false" group="Breakpoints" type="Breakpoint" state="2" counter="0" isFunctionBreakpoint="false" filename="C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\CORTEX_LPC1768_GCC_Rowley\UsbHost\Host\usbhost_lpc17xx.c" expression="" />
|
<BreakpointListItem line="184" action="" hardwareBreakpoint="" trigger="" useHWbreakpoint="false" group="Breakpoints" type="Breakpoint" state="4" counter="0" isFunctionBreakpoint="false" filename="C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\CORTEX_LPC1768_GCC_Rowley\UsbHost\Host\usbhost_lpc17xx.c" expression="" />
|
||||||
<BreakpointListItem line="46" action="" hardwareBreakpoint="" trigger="" useHWbreakpoint="false" group="Breakpoints" type="Breakpoint" state="2" counter="0" isFunctionBreakpoint="false" filename="C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\CORTEX_LPC1768_GCC_Rowley\UsbHost\Main\usbhost_task.c" expression="" />
|
<BreakpointListItem line="46" action="" hardwareBreakpoint="" trigger="" useHWbreakpoint="false" group="Breakpoints" type="Breakpoint" state="4" counter="0" isFunctionBreakpoint="false" filename="C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\CORTEX_LPC1768_GCC_Rowley\UsbHost\Main\usbhost_task.c" expression="" />
|
||||||
</Breakpoints>
|
</Breakpoints>
|
||||||
<ExecutionCountWindow/>
|
<ExecutionCountWindow/>
|
||||||
<Memory1>
|
<Memory1>
|
||||||
|
@ -22,7 +22,6 @@
|
||||||
<ProjectSessionItem path="RTOSDemo" name="unnamed" />
|
<ProjectSessionItem path="RTOSDemo" name="unnamed" />
|
||||||
<ProjectSessionItem path="RTOSDemo;RTOSDemo" name="unnamed" />
|
<ProjectSessionItem path="RTOSDemo;RTOSDemo" name="unnamed" />
|
||||||
<ProjectSessionItem path="RTOSDemo;RTOSDemo;Source Files" name="unnamed" />
|
<ProjectSessionItem path="RTOSDemo;RTOSDemo;Source Files" name="unnamed" />
|
||||||
<ProjectSessionItem path="RTOSDemo;RTOSDemo;Source Files;NXPUSBHostLite" name="unnamed" />
|
|
||||||
</Project>
|
</Project>
|
||||||
<Register1>
|
<Register1>
|
||||||
<RegisterWindow openNodes="CPU;CPU/xPSR;CPU/CFBP;CPU/CFBP/CONTROL[0];CPU/CFBP/CONTROL[1]" binaryNodes="" unsignedNodes="" visibleGroups="CPU" decimalNodes="" octalNodes="" asciiNodes="" />
|
<RegisterWindow openNodes="CPU;CPU/xPSR;CPU/CFBP;CPU/CFBP/CONTROL[0];CPU/CFBP/CONTROL[1]" binaryNodes="" unsignedNodes="" visibleGroups="CPU" decimalNodes="" octalNodes="" asciiNodes="" />
|
||||||
|
@ -53,12 +52,7 @@
|
||||||
<Watches active="0" update="Never" />
|
<Watches active="0" update="Never" />
|
||||||
</Watch4>
|
</Watch4>
|
||||||
<Files>
|
<Files>
|
||||||
<SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\CORTEX_LPC1768_GCC_Rowley\main.c" y="96" path="C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\CORTEX_LPC1768_GCC_Rowley\main.c" left="0" selected="0" name="unnamed" top="82" />
|
<SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="10" debugPath="C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\CORTEX_LPC1768_GCC_Rowley\main.c" y="304" path="C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\CORTEX_LPC1768_GCC_Rowley\main.c" left="0" selected="1" name="unnamed" top="0" />
|
||||||
<SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\CORTEX_LPC1768_GCC_Rowley\UsbHost\Main\usbhost_task.c" y="45" path="C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\CORTEX_LPC1768_GCC_Rowley\UsbHost\Main\usbhost_task.c" left="0" selected="0" name="unnamed" top="21" />
|
|
||||||
<SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\CORTEX_LPC1768_GCC_Rowley\UsbHost\Host\usbhost_lpc17xx.c" y="332" path="C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\CORTEX_LPC1768_GCC_Rowley\UsbHost\Host\usbhost_lpc17xx.c" left="0" selected="0" name="unnamed" top="172" />
|
|
||||||
<SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\CORTEX_LPC1768_GCC_Rowley\FreeRTOSConfig.h" y="55" path="C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\CORTEX_LPC1768_GCC_Rowley\FreeRTOSConfig.h" left="0" selected="0" name="unnamed" top="40" />
|
|
||||||
<SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\CORTEX_LPC1768_GCC_Rowley\webserver\emac.c" y="59" path="C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\CORTEX_LPC1768_GCC_Rowley\webserver\emac.c" left="0" selected="0" name="unnamed" top="44" />
|
|
||||||
<SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\CORTEX_LPC1768_GCC_Rowley\UsbHost\Fat\usbhost_fat.c" y="0" path="C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\CORTEX_LPC1768_GCC_Rowley\UsbHost\Fat\usbhost_fat.c" left="0" selected="0" name="unnamed" top="0" />
|
|
||||||
</Files>
|
</Files>
|
||||||
<ARMCrossStudioWindow activeProject="RTOSDemo" autoConnectTarget="USB CrossConnect for ARM" debugSearchFileMap="" fileDialogInitialDirectory="C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\CORTEX_LPC1768_GCC_Rowley\UsbHost\Uart" fileDialogDefaultFilter="*.*" autoConnectCapabilities="388991" debugSearchPath="" buildConfiguration="THUMB Flash Debug" />
|
<ARMCrossStudioWindow activeProject="RTOSDemo" autoConnectTarget="USB CrossConnect for ARM" debugSearchFileMap="" fileDialogInitialDirectory="C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\CORTEX_LPC1768_GCC_Rowley\UsbHost\Uart" fileDialogDefaultFilter="*.*" autoConnectCapabilities="388991" debugSearchPath="" buildConfiguration="THUMB Flash Debug" />
|
||||||
</session>
|
</session>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
FreeRTOS.org V5.3.1 - Copyright (C) 2003-2009 Richard Barry.
|
FreeRTOS.org V5.4.0 - Copyright (C) 2003-2009 Richard Barry.
|
||||||
|
|
||||||
This file is part of the FreeRTOS.org distribution.
|
This file is part of the FreeRTOS.org distribution.
|
||||||
|
|
||||||
|
@ -59,40 +59,18 @@
|
||||||
* In addition to the standard demo tasks, the following tasks and tests are
|
* In addition to the standard demo tasks, the following tasks and tests are
|
||||||
* defined and/or created within this file:
|
* defined and/or created within this 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
|
|
||||||
* accessing the LCD themselves. The LCD task just blocks on the queue waiting
|
|
||||||
* for messages - waking and displaying the messages as they arrive. The use
|
|
||||||
* of a gatekeeper in this manner permits both tasks and interrupts to write to
|
|
||||||
* the LCD without worrying about mutual exclusion. This is demonstrated by the
|
|
||||||
* check hook (see below) which sends messages to the display even though it
|
|
||||||
* executes from an interrupt context.
|
|
||||||
*
|
|
||||||
* "Check" hook - This only executes fully every five seconds from the tick
|
* "Check" hook - This only executes fully every five seconds from the tick
|
||||||
* hook. Its main function is to check that all the standard demo tasks are
|
* hook. Its main function is to check that all the standard demo tasks are
|
||||||
* still operational. Should any unexpected behaviour be discovered within a
|
* still operational. The status can be viewed using on the Task Stats page
|
||||||
* demo task then the tick hook will write an error to the LCD (via the LCD task).
|
* served by the WEB server.
|
||||||
* If all the demo tasks are executing with their expected behaviour then the
|
|
||||||
* check hook writes PASS to the LCD (again via the LCD task), as described above.
|
|
||||||
* The check hook also toggles LED 4 each time it executes.
|
|
||||||
*
|
|
||||||
* LED tasks - These just demonstrate how multiple instances of a single task
|
|
||||||
* definition can be created. Each LED task simply toggles an LED. The task
|
|
||||||
* parameter is used to pass the number of the LED to be toggled into the task.
|
|
||||||
*
|
*
|
||||||
* "uIP" task - This is the task that handles the uIP stack. All TCP/IP
|
* "uIP" task - This is the task that handles the uIP stack. All TCP/IP
|
||||||
* processing is performed in this task.
|
* processing is performed in this task.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Standard includes. */
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
/* Scheduler includes. */
|
/* Scheduler includes. */
|
||||||
#include "FreeRTOS.h"
|
#include "FreeRTOS.h"
|
||||||
#include "task.h"
|
#include "task.h"
|
||||||
#include "queue.h"
|
|
||||||
#include "semphr.h"
|
|
||||||
|
|
||||||
/* Demo app includes. */
|
/* Demo app includes. */
|
||||||
#include "BlockQ.h"
|
#include "BlockQ.h"
|
||||||
|
@ -108,11 +86,8 @@
|
||||||
|
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
/* The number of LED tasks that will be created. */
|
|
||||||
#define mainNUM_LED_TASKS ( 6 )
|
|
||||||
|
|
||||||
/* The time between cycles of the 'check' functionality (defined within the
|
/* The time between cycles of the 'check' functionality (defined within the
|
||||||
tick hook. */
|
tick hook). */
|
||||||
#define mainCHECK_DELAY ( ( portTickType ) 5000 / portTICK_RATE_MS )
|
#define mainCHECK_DELAY ( ( portTickType ) 5000 / portTICK_RATE_MS )
|
||||||
|
|
||||||
/* Task priorities. */
|
/* Task priorities. */
|
||||||
|
@ -120,7 +95,6 @@ tick hook. */
|
||||||
#define mainSEM_TEST_PRIORITY ( tskIDLE_PRIORITY + 1 )
|
#define mainSEM_TEST_PRIORITY ( tskIDLE_PRIORITY + 1 )
|
||||||
#define mainBLOCK_Q_PRIORITY ( tskIDLE_PRIORITY + 2 )
|
#define mainBLOCK_Q_PRIORITY ( tskIDLE_PRIORITY + 2 )
|
||||||
#define mainUIP_TASK_PRIORITY ( tskIDLE_PRIORITY + 3 )
|
#define mainUIP_TASK_PRIORITY ( tskIDLE_PRIORITY + 3 )
|
||||||
#define mainLCD_TASK_PRIORITY ( tskIDLE_PRIORITY + 2 )
|
|
||||||
#define mainINTEGER_TASK_PRIORITY ( tskIDLE_PRIORITY )
|
#define mainINTEGER_TASK_PRIORITY ( tskIDLE_PRIORITY )
|
||||||
#define mainGEN_QUEUE_TASK_PRIORITY ( tskIDLE_PRIORITY )
|
#define mainGEN_QUEUE_TASK_PRIORITY ( tskIDLE_PRIORITY )
|
||||||
#define mainFLASH_TASK_PRIORITY ( tskIDLE_PRIORITY + 2 )
|
#define mainFLASH_TASK_PRIORITY ( tskIDLE_PRIORITY + 2 )
|
||||||
|
@ -129,11 +103,10 @@ tick hook. */
|
||||||
handling library calls. */
|
handling library calls. */
|
||||||
#define mainBASIC_WEB_STACK_SIZE ( configMINIMAL_STACK_SIZE * 4 )
|
#define mainBASIC_WEB_STACK_SIZE ( configMINIMAL_STACK_SIZE * 4 )
|
||||||
|
|
||||||
/* The length of the queue used to send messages to the LCD task. */
|
/* The message displayed by the WEB server when all tasks are executing
|
||||||
#define mainQUEUE_SIZE ( 3 )
|
without an error being reported. */
|
||||||
|
#define mainPASS_STATUS_MESSAGE "All tasks are executing without error."
|
||||||
|
|
||||||
/* The task that is toggled by the check task. */
|
|
||||||
#define mainCHECK_TASK_LED ( 4 )
|
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -141,11 +114,6 @@ handling library calls. */
|
||||||
*/
|
*/
|
||||||
static void prvSetupHardware( void );
|
static void prvSetupHardware( void );
|
||||||
|
|
||||||
/*
|
|
||||||
* Very simple task that toggles an LED.
|
|
||||||
*/
|
|
||||||
static void vLEDTask( void *pvParameters );
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The task that handles the uIP stack. All TCP/IP processing is performed in
|
* The task that handles the uIP stack. All TCP/IP processing is performed in
|
||||||
* this task.
|
* this task.
|
||||||
|
@ -153,14 +121,14 @@ static void vLEDTask( void *pvParameters );
|
||||||
extern void vuIP_Task( void *pvParameters );
|
extern void vuIP_Task( void *pvParameters );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The LCD gatekeeper task as described in the comments at the top of this file.
|
* Simply returns the current status message for display on served WEB pages.
|
||||||
* */
|
*/
|
||||||
static void vLCDTask( void *pvParameters );
|
char *pcGetTaskStatusMessage( void );
|
||||||
|
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
/* The queue used to send messages to the LCD task. */
|
/* Holds the status message displayed by the WEB server. */
|
||||||
xQueueHandle xLCDQueue;
|
static char *pcStatusMessage = mainPASS_STATUS_MESSAGE;
|
||||||
|
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
@ -184,14 +152,6 @@ int main( void )
|
||||||
/* Create the uIP task. The WEB server runs in this task. */
|
/* Create the uIP task. The WEB server runs in this task. */
|
||||||
xTaskCreate( vuIP_Task, ( signed char * ) "uIP", mainBASIC_WEB_STACK_SIZE, ( void * ) NULL, mainUIP_TASK_PRIORITY, NULL );
|
xTaskCreate( vuIP_Task, ( signed char * ) "uIP", mainBASIC_WEB_STACK_SIZE, ( void * ) NULL, mainUIP_TASK_PRIORITY, NULL );
|
||||||
|
|
||||||
/* Create the queue used by the LCD task. Messages for display on the LCD
|
|
||||||
are received via this queue. */
|
|
||||||
xLCDQueue = xQueueCreate( mainQUEUE_SIZE, sizeof( xLCDMessage ) );
|
|
||||||
|
|
||||||
/* Start the LCD gatekeeper task - as described in the comments at the top
|
|
||||||
of this file. */
|
|
||||||
xTaskCreate( vLCDTask, ( signed portCHAR * ) "LCD", configMINIMAL_STACK_SIZE * 2, NULL, mainLCD_TASK_PRIORITY, NULL );
|
|
||||||
|
|
||||||
/* Start the scheduler. */
|
/* Start the scheduler. */
|
||||||
vTaskStartScheduler();
|
vTaskStartScheduler();
|
||||||
|
|
||||||
|
@ -201,35 +161,9 @@ int main( void )
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
void vLCDTask( void *pvParameters )
|
|
||||||
{
|
|
||||||
xLCDMessage xMessage;
|
|
||||||
unsigned long ulRow = 0;
|
|
||||||
char cIPAddr[ 17 ]; /* To fit max IP address length of xxx.xxx.xxx.xxx\0 */
|
|
||||||
|
|
||||||
( void ) pvParameters;
|
|
||||||
|
|
||||||
/* The LCD gatekeeper task as described in the comments at the top of this
|
|
||||||
file. */
|
|
||||||
|
|
||||||
/* Initialise the LCD and display a startup message that includes the
|
|
||||||
configured IP address. */
|
|
||||||
sprintf( cIPAddr, "%d.%d.%d.%d", configIP_ADDR0, configIP_ADDR1, configIP_ADDR2, configIP_ADDR3 );
|
|
||||||
|
|
||||||
for( ;; )
|
|
||||||
{
|
|
||||||
/* Wait for a message to arrive to be displayed. */
|
|
||||||
while( xQueueReceive( xLCDQueue, &xMessage, portMAX_DELAY ) != pdPASS );
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*-----------------------------------------------------------*/
|
|
||||||
|
|
||||||
void vApplicationTickHook( void )
|
void vApplicationTickHook( void )
|
||||||
{
|
{
|
||||||
static xLCDMessage xMessage = { "PASS" };
|
|
||||||
static unsigned portLONG ulTicksSinceLastDisplay = 0;
|
static unsigned portLONG ulTicksSinceLastDisplay = 0;
|
||||||
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
|
||||||
|
|
||||||
/* Called from every tick interrupt as described in the comments at the top
|
/* Called from every tick interrupt as described in the comments at the top
|
||||||
of this file.
|
of this file.
|
||||||
|
@ -246,51 +180,47 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
||||||
/* Has an error been found in any task? */
|
/* Has an error been found in any task? */
|
||||||
if( xAreGenericQueueTasksStillRunning() != pdTRUE )
|
if( xAreGenericQueueTasksStillRunning() != pdTRUE )
|
||||||
{
|
{
|
||||||
xMessage.pcMessage = "ERROR: GEN Q";
|
pcStatusMessage = "An error has been detected in the Generic Queue test/demo.";
|
||||||
}
|
}
|
||||||
else if( xAreQueuePeekTasksStillRunning() != pdTRUE )
|
else if( xAreQueuePeekTasksStillRunning() != pdTRUE )
|
||||||
{
|
{
|
||||||
xMessage.pcMessage = "ERROR: PEEK Q";
|
pcStatusMessage = "An error has been detected in the Peek Queue test/demo.";
|
||||||
}
|
}
|
||||||
else if( xAreBlockingQueuesStillRunning() != pdTRUE )
|
else if( xAreBlockingQueuesStillRunning() != pdTRUE )
|
||||||
{
|
{
|
||||||
xMessage.pcMessage = "ERROR: BLOCK Q";
|
pcStatusMessage = "An error has been detected in the Block Queue test/demo.";
|
||||||
}
|
}
|
||||||
else if( xAreBlockTimeTestTasksStillRunning() != pdTRUE )
|
else if( xAreBlockTimeTestTasksStillRunning() != pdTRUE )
|
||||||
{
|
{
|
||||||
xMessage.pcMessage = "ERROR: BLOCK TIME";
|
pcStatusMessage = "An error has been detected in the Block Time test/demo.";
|
||||||
}
|
}
|
||||||
else if( xAreSemaphoreTasksStillRunning() != pdTRUE )
|
else if( xAreSemaphoreTasksStillRunning() != pdTRUE )
|
||||||
{
|
{
|
||||||
xMessage.pcMessage = "ERROR: SEMAPHR";
|
pcStatusMessage = "An error has been detected in the Semaphore test/demo.";
|
||||||
}
|
}
|
||||||
else if( xArePollingQueuesStillRunning() != pdTRUE )
|
else if( xArePollingQueuesStillRunning() != pdTRUE )
|
||||||
{
|
{
|
||||||
xMessage.pcMessage = "ERROR: POLL Q";
|
pcStatusMessage = "An error has been detected in the Poll Queue test/demo.";
|
||||||
}
|
}
|
||||||
else if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
|
else if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
|
||||||
{
|
{
|
||||||
xMessage.pcMessage = "ERROR: INT MATH";
|
pcStatusMessage = "An error has been detected in the Int Math test/demo.";
|
||||||
}
|
}
|
||||||
else if( xAreRecursiveMutexTasksStillRunning() != pdTRUE )
|
else if( xAreRecursiveMutexTasksStillRunning() != pdTRUE )
|
||||||
{
|
{
|
||||||
xMessage.pcMessage = "ERROR: REC MUTEX";
|
pcStatusMessage = "An error has been detected in the Mutex test/demo.";
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Send the message to the OLED gatekeeper for display. The
|
|
||||||
xHigherPriorityTaskWoken parameter is not actually used here
|
|
||||||
as this function is running in the tick interrupt anyway - but
|
|
||||||
it must still be supplied. */
|
|
||||||
xHigherPriorityTaskWoken = pdFALSE;
|
|
||||||
xQueueSendFromISR( xLCDQueue, &xMessage, &xHigherPriorityTaskWoken );
|
|
||||||
|
|
||||||
/* Also toggle and LED. This can be done from here because in this port
|
|
||||||
the LED toggling functions don't use critical sections. */
|
|
||||||
vParTestToggleLED( mainCHECK_TASK_LED );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
char *pcGetTaskStatusMessage( void )
|
||||||
|
{
|
||||||
|
/* Not bothered about a critical section here. */
|
||||||
|
return pcStatusMessage;
|
||||||
|
}
|
||||||
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
void prvSetupHardware( void )
|
void prvSetupHardware( void )
|
||||||
{
|
{
|
||||||
/* Disable peripherals power. */
|
/* Disable peripherals power. */
|
||||||
|
@ -372,7 +302,7 @@ const unsigned long TCR_COUNT_RESET = 2, CTCR_CTM_TIMER = 0x00, TCR_COUNT_ENABLE
|
||||||
collecting run time statistical information - basically the percentage
|
collecting run time statistical information - basically the percentage
|
||||||
of CPU time that each task is utilising. It is called automatically when
|
of CPU time that each task is utilising. It is called automatically when
|
||||||
the scheduler is started (assuming configGENERATE_RUN_TIME_STATS is set
|
the scheduler is started (assuming configGENERATE_RUN_TIME_STATS is set
|
||||||
to 1. */
|
to 1). */
|
||||||
|
|
||||||
/* Power up and feed the timer. */
|
/* Power up and feed the timer. */
|
||||||
SC->PCONP |= 0x02UL;
|
SC->PCONP |= 0x02UL;
|
||||||
|
|
|
@ -269,7 +269,7 @@ long x, lNextBuffer = 0;
|
||||||
used. */
|
used. */
|
||||||
for( x = 0; x < NUM_TX_FRAG; x++ )
|
for( x = 0; x < NUM_TX_FRAG; x++ )
|
||||||
{
|
{
|
||||||
TX_DESC_PACKET( x ) = NULL;
|
TX_DESC_PACKET( x ) = ( unsigned long ) NULL;
|
||||||
TX_DESC_CTRL( x ) = 0;
|
TX_DESC_CTRL( x ) = 0;
|
||||||
TX_STAT_INFO( x ) = 0;
|
TX_STAT_INFO( x ) = 0;
|
||||||
}
|
}
|
||||||
|
@ -418,7 +418,7 @@ static void prvReturnBuffer( unsigned char *pucBuffer )
|
||||||
{
|
{
|
||||||
unsigned long ul;
|
unsigned long ul;
|
||||||
|
|
||||||
/* Mark a buffer as free for use. */
|
/* Return a buffer to the pool of free buffers. */
|
||||||
for( ul = 0; ul < ETH_NUM_BUFFERS; ul++ )
|
for( ul = 0; ul < ETH_NUM_BUFFERS; ul++ )
|
||||||
{
|
{
|
||||||
if( ETH_BUF( ul ) == ( unsigned long ) pucBuffer )
|
if( ETH_BUF( ul ) == ( unsigned long ) pucBuffer )
|
||||||
|
@ -470,7 +470,7 @@ unsigned long ulAttempts = 0UL;
|
||||||
|
|
||||||
/* Check to see if the Tx descriptor is free, indicated by its buffer being
|
/* Check to see if the Tx descriptor is free, indicated by its buffer being
|
||||||
NULL. */
|
NULL. */
|
||||||
while( TX_DESC_PACKET( emacTX_DESC_INDEX ) != NULL )
|
while( TX_DESC_PACKET( emacTX_DESC_INDEX ) != ( unsigned long ) NULL )
|
||||||
{
|
{
|
||||||
/* Wait for the Tx descriptor to become available. */
|
/* Wait for the Tx descriptor to become available. */
|
||||||
vTaskDelay( emacBUFFER_WAIT_DELAY );
|
vTaskDelay( emacBUFFER_WAIT_DELAY );
|
||||||
|
@ -594,7 +594,7 @@ long lHigherPriorityTaskWoken = pdFALSE;
|
||||||
{
|
{
|
||||||
/* The Tx buffer is no longer required. */
|
/* The Tx buffer is no longer required. */
|
||||||
prvReturnBuffer( ( unsigned char * ) TX_DESC_PACKET( emacTX_DESC_INDEX ) );
|
prvReturnBuffer( ( unsigned char * ) TX_DESC_PACKET( emacTX_DESC_INDEX ) );
|
||||||
TX_DESC_PACKET( emacTX_DESC_INDEX ) = NULL;
|
TX_DESC_PACKET( emacTX_DESC_INDEX ) = ( unsigned long ) NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -208,14 +208,15 @@ PT_THREAD(net_stats(struct httpd_state *s, char *ptr))
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
extern void vTaskList( signed char *pcWriteBuffer );
|
extern void vTaskList( signed char *pcWriteBuffer );
|
||||||
static char cCountBuf[ 32 ];
|
extern char *pcGetTaskStatusMessage( void );
|
||||||
|
static char cCountBuf[ 128 ];
|
||||||
long lRefreshCount = 0;
|
long lRefreshCount = 0;
|
||||||
static unsigned short
|
static unsigned short
|
||||||
generate_rtos_stats(void *arg)
|
generate_rtos_stats(void *arg)
|
||||||
{
|
{
|
||||||
( void ) arg;
|
( void ) arg;
|
||||||
lRefreshCount++;
|
lRefreshCount++;
|
||||||
sprintf( cCountBuf, "<p><br>Refresh count = %d", (int)lRefreshCount );
|
sprintf( cCountBuf, "<p><br>Refresh count = %d<p><br>%s", (int)lRefreshCount, pcGetTaskStatusMessage() );
|
||||||
vTaskList( uip_appdata );
|
vTaskList( uip_appdata );
|
||||||
strcat( uip_appdata, cCountBuf );
|
strcat( uip_appdata, cCountBuf );
|
||||||
|
|
||||||
|
@ -239,11 +240,12 @@ unsigned long ulString;
|
||||||
|
|
||||||
static unsigned short generate_io_state( void *arg )
|
static unsigned short generate_io_state( void *arg )
|
||||||
{
|
{
|
||||||
extern long lParTestGetLEDState( unsigned long ulLED );
|
extern long lParTestGetLEDState( void );
|
||||||
|
|
||||||
( void ) arg;
|
( void ) arg;
|
||||||
|
|
||||||
if( lParTestGetLEDState( 1 << 7 ) == 0 )
|
/* Get the state of the LEDs that are on the FIO1 port. */
|
||||||
|
if( lParTestGetLEDState() )
|
||||||
{
|
{
|
||||||
pcStatus = "";
|
pcStatus = "";
|
||||||
}
|
}
|
||||||
|
@ -253,10 +255,7 @@ extern long lParTestGetLEDState( unsigned long ulLED );
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf( uip_appdata,
|
sprintf( uip_appdata,
|
||||||
"<input type=\"checkbox\" name=\"LED0\" value=\"1\" %s>LED 7"\
|
"<input type=\"checkbox\" name=\"LED0\" value=\"1\" %s>LED<p><p>", pcStatus );
|
||||||
"<p>"\
|
|
||||||
"<input type=\"text\" name=\"LCD\" value=\"Enter LCD text\" size=\"16\">",
|
|
||||||
pcStatus );
|
|
||||||
|
|
||||||
return strlen( uip_appdata );
|
return strlen( uip_appdata );
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,12 +69,10 @@
|
||||||
#include "EthDev.h"
|
#include "EthDev.h"
|
||||||
#include "ParTest.h"
|
#include "ParTest.h"
|
||||||
|
|
||||||
#include "LPC17xx.h"
|
|
||||||
#include "core_cm3.h"
|
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
/* How long to wait before attempting to connect the MAC again. */
|
/* How long to wait before attempting to connect the MAC again. */
|
||||||
#define uipINIT_WAIT 100
|
#define uipINIT_WAIT ( 100 / portTICK_RATE_MS )
|
||||||
|
|
||||||
/* Shortcut to the header within the Rx buffer. */
|
/* Shortcut to the header within the Rx buffer. */
|
||||||
#define xHeader ((struct uip_eth_hdr *) &uip_buf[ 0 ])
|
#define xHeader ((struct uip_eth_hdr *) &uip_buf[ 0 ])
|
||||||
|
@ -145,9 +143,12 @@ extern void ( vEMAC_ISR_Wrapper )( void );
|
||||||
portENTER_CRITICAL();
|
portENTER_CRITICAL();
|
||||||
{
|
{
|
||||||
EMAC->IntEnable = ( INT_RX_DONE | INT_TX_DONE );
|
EMAC->IntEnable = ( INT_RX_DONE | INT_TX_DONE );
|
||||||
/* set the interrupt priority */
|
|
||||||
|
/* Set the interrupt priority to the max permissible to cause some
|
||||||
|
interrupt nesting. */
|
||||||
NVIC_SetPriority( ENET_IRQn, configMAX_SYSCALL_INTERRUPT_PRIORITY );
|
NVIC_SetPriority( ENET_IRQn, configMAX_SYSCALL_INTERRUPT_PRIORITY );
|
||||||
/* enable the interrupt */
|
|
||||||
|
/* Enable the interrupt. */
|
||||||
NVIC_EnableIRQ( ENET_IRQn );
|
NVIC_EnableIRQ( ENET_IRQn );
|
||||||
prvSetMACAddress();
|
prvSetMACAddress();
|
||||||
}
|
}
|
||||||
|
@ -245,52 +246,23 @@ struct uip_eth_addr xAddr;
|
||||||
|
|
||||||
void vApplicationProcessFormInput( portCHAR *pcInputString )
|
void vApplicationProcessFormInput( portCHAR *pcInputString )
|
||||||
{
|
{
|
||||||
char *c, *pcText;
|
char *c;
|
||||||
static portCHAR cMessageForDisplay[ 32 ];
|
extern void vParTestSetLEDState( long lState );
|
||||||
extern xQueueHandle xLCDQueue;
|
|
||||||
xLCDMessage xLCDMessage;
|
|
||||||
|
|
||||||
/* Process the form input sent by the IO page of the served HTML. */
|
/* Process the form input sent by the IO page of the served HTML. */
|
||||||
|
|
||||||
c = strstr( pcInputString, "?" );
|
c = strstr( pcInputString, "?" );
|
||||||
if( c )
|
if( c )
|
||||||
{
|
{
|
||||||
/* Turn LED's on or off in accordance with the check box status. */
|
/* Turn the FIO1 LED's on or off in accordance with the check box status. */
|
||||||
if( strstr( c, "LED0=1" ) != NULL )
|
if( strstr( c, "LED0=1" ) != NULL )
|
||||||
{
|
{
|
||||||
/* Set LED7. */
|
vParTestSetLEDState( pdTRUE );
|
||||||
vParTestSetLED( 1 << 7, 1 );
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Clear LED7. */
|
vParTestSetLEDState( pdFALSE );
|
||||||
vParTestSetLED( 1 << 7, 0 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Find the start of the text to be displayed on the LCD. */
|
|
||||||
pcText = strstr( c, "LCD=" );
|
|
||||||
pcText += strlen( "LCD=" );
|
|
||||||
|
|
||||||
/* Terminate the file name for further processing within uIP. */
|
|
||||||
*c = 0x00;
|
|
||||||
|
|
||||||
/* Terminate the LCD string. */
|
|
||||||
c = strstr( pcText, " " );
|
|
||||||
if( c != NULL )
|
|
||||||
{
|
|
||||||
*c = 0x00;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Add required spaces. */
|
|
||||||
while( ( c = strstr( pcText, "+" ) ) != NULL )
|
|
||||||
{
|
|
||||||
*c = ' ';
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Write the message to the LCD. */
|
|
||||||
strcpy( cMessageForDisplay, pcText );
|
|
||||||
xLCDMessage.pcMessage = cMessageForDisplay;
|
|
||||||
xQueueSend( xLCDQueue, &xLCDMessage, portMAX_DELAY );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue