/*\r
- FreeRTOS V7.5.2 - Copyright (C) 2013 Real Time Engineers Ltd.\r
-\r
- VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
-\r
- ***************************************************************************\r
- * *\r
- * FreeRTOS provides completely free yet professionally developed, *\r
- * robust, strictly quality controlled, supported, and cross *\r
- * platform software that has become a de facto standard. *\r
- * *\r
- * Help yourself get started quickly and support the FreeRTOS *\r
- * project by purchasing a FreeRTOS tutorial book, reference *\r
- * manual, or both from: http://www.FreeRTOS.org/Documentation *\r
- * *\r
- * Thank you! *\r
- * *\r
- ***************************************************************************\r
-\r
- This file is part of the FreeRTOS distribution.\r
-\r
- FreeRTOS is free software; you can redistribute it and/or modify it under\r
- the terms of the GNU General Public License (version 2) as published by the\r
- Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.\r
-\r
- >>! NOTE: The modification to the GPL is included to allow you to distribute\r
- >>! a combined work that includes FreeRTOS without being obliged to provide\r
- >>! the source code for proprietary components outside of the FreeRTOS\r
- >>! kernel.\r
-\r
- FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
- FOR A PARTICULAR PURPOSE. Full license text is available from the following\r
- link: http://www.freertos.org/a00114.html\r
-\r
- 1 tab == 4 spaces!\r
-\r
- ***************************************************************************\r
- * *\r
- * Having a problem? Start by reading the FAQ "My application does *\r
- * not run, what could be wrong?" *\r
- * *\r
- * http://www.FreeRTOS.org/FAQHelp.html *\r
- * *\r
- ***************************************************************************\r
-\r
- http://www.FreeRTOS.org - Documentation, books, training, latest versions,\r
- license and Real Time Engineers Ltd. contact details.\r
-\r
- http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
- including FreeRTOS+Trace - an indispensable productivity tool, a DOS\r
- compatible FAT file system, and our tiny thread aware UDP/IP stack.\r
-\r
- http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High\r
- Integrity Systems to sell under the OpenRTOS brand. Low cost OpenRTOS\r
- licenses offer ticketed support, indemnification and middleware.\r
-\r
- http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
- engineered and independently SIL3 certified version for use in safety and\r
- mission critical applications that require provable dependability.\r
-\r
- 1 tab == 4 spaces!\r
-*/\r
+ * FreeRTOS Kernel V10.2.1\r
+ * Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.\r
+ *\r
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of\r
+ * this software and associated documentation files (the "Software"), to deal in\r
+ * the Software without restriction, including without limitation the rights to\r
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\r
+ * the Software, and to permit persons to whom the Software is furnished to do so,\r
+ * subject to the following conditions:\r
+ *\r
+ * The above copyright notice and this permission notice shall be included in all\r
+ * copies or substantial portions of the Software.\r
+ *\r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\r
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\r
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
+ *\r
+ * http://www.FreeRTOS.org\r
+ * http://aws.amazon.com/freertos\r
+ *\r
+ * 1 tab == 4 spaces!\r
+ */\r
\r
/*\r
* main-blinky.c is included when the "Blinky" build configuration is used.\r
* main-full.c (this file) defines a comprehensive demo that creates many\r
* tasks, queues, semaphores and timers. It also demonstrates how Cortex-M3\r
* interrupts can interact with FreeRTOS tasks/timers, a simple web server, and\r
- * run time statistics gathering functionality. ***IF YOU ARE LOOKING FOR A \r
+ * run time statistics gathering functionality. ***IF YOU ARE LOOKING FOR A\r
* SIMPLER STARTING POINT THEN USE THE "BLINKY" BUILD CONFIGURATION FIRST.***\r
*\r
- * If the Ethernet functionality is excluded, then this demo will run 'stand \r
- * alone' (without the rest of the tower system) on the TWR-K60N512 tower \r
+ * If the Ethernet functionality is excluded, then this demo will run 'stand\r
+ * alone' (without the rest of the tower system) on the TWR-K60N512 tower\r
* module. If the Ethernet functionality is included, then the full Freescale\r
- * K60 tower kit, including both the TWR-K60N512 and TWR-SER modules, is \r
- * required (as the Ethernet connector is on the TWR-SER). The TWR-K60N512 is \r
+ * K60 tower kit, including both the TWR-K60N512 and TWR-SER modules, is\r
+ * required (as the Ethernet connector is on the TWR-SER). The TWR-K60N512 is\r
* populated with a K60N512 Cortex-M4 microcontroller.\r
*\r
* The main() Function:\r
* main() creates four demo specific software timers, and one demo specific\r
* task (the web server task). It also creates a whole host of 'standard\r
- * demo' tasks/queues/semaphores/timers, before starting the scheduler. The \r
- * demo specific tasks and timers are described in the comments here. The \r
+ * demo' tasks/queues/semaphores/timers, before starting the scheduler. The\r
+ * demo specific tasks and timers are described in the comments here. The\r
* standard demo tasks are described on the FreeRTOS.org web site.\r
*\r
* The standard demo tasks provide no specific functionality. They are\r
*\r
* The Demo Specific "LED" Timers and Callback Function:\r
* Two very simple LED timers are created. All they do is toggle an LED each\r
- * when the timer callback function is executed. The two timers share a \r
- * callback function, so the callback function parameter is used to determine \r
- * which timer actually expired, and therefore, which LED to toggle. Both \r
- * timers use a different frequency, one toggles the blue LED and the other the \r
+ * when the timer callback function is executed. The two timers share a\r
+ * callback function, so the callback function parameter is used to determine\r
+ * which timer actually expired, and therefore, which LED to toggle. Both\r
+ * timers use a different frequency, one toggles the blue LED and the other the\r
* green LED.\r
*\r
* The LED/Button Software Timer and the Button Interrupt:\r
* The user button SW2 is configured to generate an interrupt each time it is\r
- * pressed. The interrupt service routine switches the orange/yellow LED on, \r
- * and resets the LED software timer. The LED timer has a 5000 millisecond (5 \r
- * second) period, and uses a callback function that is defined to just turn the \r
- * LED off again. Therefore, pressing the user button will turn the LED on, and \r
- * the LED will remain on until a full five seconds pass without the button \r
+ * pressed. The interrupt service routine switches the orange/yellow LED on,\r
+ * and resets the LED software timer. The LED timer has a 5000 millisecond (5\r
+ * second) period, and uses a callback function that is defined to just turn the\r
+ * LED off again. Therefore, pressing the user button will turn the LED on, and\r
+ * the LED will remain on until a full five seconds pass without the button\r
* being pressed.\r
*\r
* The Demo Specific "Check" Timer and Callback Function:\r
- * The check timer period is initially set to three seconds. The check timer \r
- * callback function checks that all the standard demo tasks are not only still \r
- * executing, but are executing without reporting any errors. If the check \r
- * timer discovers that a task has either stalled, or reported an error, then it \r
- * changes its own period from the initial three seconds, to just 200ms. The \r
- * check timer callback function also toggles the orange/red LED each time it is \r
- * called. This provides a visual indication of the system status: If the LED \r
- * toggles every three seconds, then no issues have been discovered. If the LED \r
- * toggles every 200ms, then an issue has been discovered with at least one \r
- * task. The last reported issue is latched into the pcStatusMessage variable, \r
- * and displayed at the bottom of the "task stats" web page served by the \r
+ * The check timer period is initially set to three seconds. The check timer\r
+ * callback function checks that all the standard demo tasks are not only still\r
+ * executing, but are executing without reporting any errors. If the check\r
+ * timer discovers that a task has either stalled, or reported an error, then it\r
+ * changes its own period from the initial three seconds, to just 200ms. The\r
+ * check timer callback function also toggles the orange/red LED each time it is\r
+ * called. This provides a visual indication of the system status: If the LED\r
+ * toggles every three seconds, then no issues have been discovered. If the LED\r
+ * toggles every 200ms, then an issue has been discovered with at least one\r
+ * task. The last reported issue is latched into the pcStatusMessage variable,\r
+ * and displayed at the bottom of the "task stats" web page served by the\r
* embedded web server task.\r
*\r
* The web server task:\r
* The Demo Specific Tick Hook Function:\r
* The tick hook function is used to test the interrupt safe software timer\r
* functionality.\r
- * \r
+ *\r
*/\r
\r
/* Kernel includes. */\r
\r
/* The period at which the check timer will expire, in ms, provided no errors\r
have been reported by any of the standard demo tasks. ms are converted to the\r
-equivalent in ticks using the portTICK_RATE_MS constant. */\r
-#define mainCHECK_TIMER_PERIOD_MS ( 3000UL / portTICK_RATE_MS )\r
+equivalent in ticks using the portTICK_PERIOD_MS constant. */\r
+#define mainCHECK_TIMER_PERIOD_MS ( 3000UL / portTICK_PERIOD_MS )\r
\r
/* The period at which the check timer will expire, in ms, if an error has been\r
reported in one of the standard demo tasks. ms are converted to the equivalent\r
-in ticks using the portTICK_RATE_MS constant. */\r
-#define mainERROR_CHECK_TIMER_PERIOD_MS ( 200UL / portTICK_RATE_MS )\r
+in ticks using the portTICK_PERIOD_MS constant. */\r
+#define mainERROR_CHECK_TIMER_PERIOD_MS ( 200UL / portTICK_PERIOD_MS )\r
\r
-/* The LED that is turned on by pressing SW2 remains on until the button has not \r
+/* The LED that is turned on by pressing SW2 remains on until the button has not\r
been pushed for a full 5000ms. */\r
-#define mainBUTTON_LED_TIMER_PERIOD_MS ( 5000UL / portTICK_RATE_MS )\r
+#define mainBUTTON_LED_TIMER_PERIOD_MS ( 5000UL / portTICK_PERIOD_MS )\r
\r
/* The period at which the two simple LED flash timers will execute their\r
callback functions. */\r
-#define mainLED1_TIMER_PERIOD_MS ( 200UL / portTICK_RATE_MS )\r
-#define mainLED2_TIMER_PERIOD_MS ( 600UL / portTICK_RATE_MS )\r
+#define mainLED1_TIMER_PERIOD_MS ( 200UL / portTICK_PERIOD_MS )\r
+#define mainLED2_TIMER_PERIOD_MS ( 600UL / portTICK_PERIOD_MS )\r
\r
/* A block time of zero simply means "don't block". */\r
#define mainDONT_BLOCK ( 0UL )\r
static void prvCreateDemoSpecificTimers( void );\r
\r
/*\r
- * The LED/button timer callback function. This does nothing but switch an LED \r
+ * The LED/button timer callback function. This does nothing but switch an LED\r
* off.\r
*/\r
-static void prvButtonLEDTimerCallback( xTimerHandle xTimer );\r
+static void prvButtonLEDTimerCallback( TimerHandle_t xTimer );\r
\r
/*\r
* The callback function used by both simple LED flash timers. Both timers use\r
* the same callback, so the function parameter is used to determine which LED\r
* should be flashed (effectively to determine which timer has expired).\r
*/\r
-static void prvLEDTimerCallback( xTimerHandle xTimer );\r
+static void prvLEDTimerCallback( TimerHandle_t xTimer );\r
\r
/*\r
* The check timer callback function, as described at the top of this file.\r
*/\r
-static void prvCheckTimerCallback( xTimerHandle xTimer );\r
+static void prvCheckTimerCallback( TimerHandle_t xTimer );\r
\r
/*\r
* Contains the implementation of the web server.\r
\r
/*-----------------------------------------------------------*/\r
\r
-/* The LED/Button software timer. This uses prvButtonLEDTimerCallback() as it's \r
+/* The LED/Button software timer. This uses prvButtonLEDTimerCallback() as it's\r
callback function. */\r
-static xTimerHandle xLEDButtonTimer = NULL;\r
+static TimerHandle_t xLEDButtonTimer = NULL;\r
\r
/* The check timer. This uses prvCheckTimerCallback() as its callback\r
function. */\r
-static xTimerHandle xCheckTimer = NULL;\r
+static TimerHandle_t xCheckTimer = NULL;\r
\r
/* LED timers - these simply flash LEDs, each using a different frequency. Both\r
use the same prvLEDTimerCallback() callback function. */\r
-static xTimerHandle xLED1Timer = NULL, xLED2Timer = NULL;\r
+static TimerHandle_t xLED1Timer = NULL, xLED2Timer = NULL;\r
\r
/* If an error is detected in a standard demo task, then pcStatusMessage will\r
be set to point to a string that identifies the offending task. This is just\r
vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );\r
vStartCountingSemaphoreTasks();\r
vStartDynamicPriorityTasks();\r
- \r
+\r
/* The web server task. */\r
xTaskCreate( vuIP_Task, "uIP", mainuIP_STACK_SIZE, NULL, mainuIP_TASK_PRIORITY, NULL );\r
\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static void prvCheckTimerCallback( xTimerHandle xTimer )\r
+static void prvCheckTimerCallback( TimerHandle_t xTimer )\r
{\r
static long lChangedTimerPeriodAlready = pdFALSE;\r
\r
{\r
pcStatusMessage = "Error: CountSem\n";\r
}\r
- \r
+\r
if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )\r
{\r
pcStatusMessage = "Error: DynamicPriority\n";\r
}\r
- \r
+\r
/* Toggle the check LED to give an indication of the system status. If\r
the LED toggles every mainCHECK_TIMER_PERIOD_MS milliseconds then\r
everything is ok. A faster toggle indicates an error. */\r
if( lChangedTimerPeriodAlready == pdFALSE )\r
{\r
lChangedTimerPeriodAlready = pdTRUE;\r
- \r
- /* This call to xTimerChangePeriod() uses a zero block time. \r
- Functions called from inside of a timer callback function must \r
+\r
+ /* This call to xTimerChangePeriod() uses a zero block time.\r
+ Functions called from inside of a timer callback function must\r
*never* attempt to block. */\r
xTimerChangePeriod( xCheckTimer, ( mainERROR_CHECK_TIMER_PERIOD_MS ), mainDONT_BLOCK );\r
}\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static void prvButtonLEDTimerCallback( xTimerHandle xTimer )\r
+static void prvButtonLEDTimerCallback( TimerHandle_t xTimer )\r
{\r
/* The timer has expired - so no button pushes have occurred in the last\r
five seconds - turn the LED off. */\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static void prvLEDTimerCallback( xTimerHandle xTimer )\r
+static void prvLEDTimerCallback( TimerHandle_t xTimer )\r
{\r
unsigned long ulLED;\r
\r
taskDISABLE_INTERRUPTS();\r
PORTE_PCR26 = PORT_PCR_MUX( 1 ) | PORT_PCR_IRQC( 0xA ) | PORT_PCR_PE_MASK | PORT_PCR_PS_MASK;\r
enable_irq( mainGPIO_E_VECTOR );\r
- \r
+\r
/* The interrupt calls an interrupt safe API function - so its priority must\r
be equal to or lower than configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY. */\r
set_irq_priority( mainGPIO_E_VECTOR, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );\r
- \r
+\r
/* Configure the LED outputs. */\r
vParTestInitialise();\r
}\r
static void prvCreateDemoSpecificTimers( void )\r
{\r
/* This function creates the timers, but does not start them. This is\r
- because the standard demo timer test is started from main(), after this \r
- function is called. The standard demo timer test will deliberately fill the \r
- timer command queue - and will fail the test if the command queue already \r
- holds start commands for the timers created here. Instead, the timers \r
- created in this function are started from the idle task, at which time, the \r
- timer service/daemon task will be running, and will have drained the timer \r
+ because the standard demo timer test is started from main(), after this\r
+ function is called. The standard demo timer test will deliberately fill the\r
+ timer command queue - and will fail the test if the command queue already\r
+ holds start commands for the timers created here. Instead, the timers\r
+ created in this function are started from the idle task, at which time, the\r
+ timer service/daemon task will be running, and will have drained the timer\r
command queue. */\r
- \r
+\r
/* Create the software timer that is responsible for turning off the LED\r
if the button is not pushed within 5000ms, as described at the top of\r
this file. */\r
- xLEDButtonTimer = xTimerCreate( ( const signed char * ) "ButtonLEDTimer", /* A text name, purely to help debugging. */\r
- ( mainBUTTON_LED_TIMER_PERIOD_MS ), /* The timer period, in this case 5000ms (5s). */\r
- pdFALSE, /* This is a one shot timer, so xAutoReload is set to pdFALSE. */\r
- ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
- prvButtonLEDTimerCallback /* The callback function that switches the LED off. */\r
+ xLEDButtonTimer = xTimerCreate( "ButtonLEDTimer", /* A text name, purely to help debugging. */\r
+ ( mainBUTTON_LED_TIMER_PERIOD_MS ), /* The timer period, in this case 5000ms (5s). */\r
+ pdFALSE, /* This is a one-shot timer, so xAutoReload is set to pdFALSE. */\r
+ ( void * ) 0, /* The ID is not used, so can be set to anything. */\r
+ prvButtonLEDTimerCallback /* The callback function that switches the LED off. */\r
);\r
\r
/* Create the software timer that performs the 'check' functionality,\r
as described at the top of this file. */\r
- xCheckTimer = xTimerCreate( ( const signed char * ) "CheckTimer",/* A text name, purely to help debugging. */\r
+ xCheckTimer = xTimerCreate( "CheckTimer", /* A text name, purely to help debugging. */\r
( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
( void * ) 0, /* The ID is not used, so can be set to anything. */\r
prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */\r
);\r
- \r
+\r
/* Create the software timers used to simply flash LEDs. These two timers\r
share a callback function, so the callback parameter is used to pass in the\r
LED that should be toggled. */\r
- xLED1Timer = xTimerCreate( ( const signed char * ) "LED1Timer",/* A text name, purely to help debugging. */\r
- ( mainLED1_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
- pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
- ( void * ) mainLED0, /* The ID is used to pass in the number of the LED to be toggled. */\r
- prvLEDTimerCallback /* The callback function simply toggles the LED specified by its parameter. */\r
+ xLED1Timer = xTimerCreate( "LED1Timer", /* A text name, purely to help debugging. */\r
+ ( mainLED1_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
+ pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
+ ( void * ) mainLED0, /* The ID is used to pass in the number of the LED to be toggled. */\r
+ prvLEDTimerCallback /* The callback function simply toggles the LED specified by its parameter. */\r
);\r
\r
- xLED2Timer = xTimerCreate( ( const signed char * ) "LED2Timer",/* A text name, purely to help debugging. */\r
- ( mainLED2_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
- pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
- ( void * ) mainLED1, /* The ID is used to pass in the number of the LED to be toggled. */\r
- prvLEDTimerCallback /* The callback function simply toggles the LED specified by its parameter. */\r
+ xLED2Timer = xTimerCreate( "LED2Timer", /* A text name, purely to help debugging. */\r
+ ( mainLED2_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */\r
+ pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
+ ( void * ) mainLED1, /* The ID is used to pass in the number of the LED to be toggled. */\r
+ prvLEDTimerCallback /* The callback function simply toggles the LED specified by its parameter. */\r
);\r
}\r
/*-----------------------------------------------------------*/\r
}\r
/*-----------------------------------------------------------*/\r
\r
-void vApplicationStackOverflowHook( xTaskHandle pxTask, signed char *pcTaskName )\r
+void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName )\r
{\r
( void ) pcTaskName;\r
( void ) pxTask;\r
xTimerStart( xCheckTimer, portMAX_DELAY );\r
xTimerStart( xLED1Timer, portMAX_DELAY );\r
xTimerStart( xLED2Timer, portMAX_DELAY );\r
- \r
+\r
xFreeHeapSpace = xPortGetFreeHeapSize();\r
- \r
+\r
if( xFreeHeapSpace > 100 )\r
{\r
/* By now, the kernel has allocated everything it is going to, so\r
/* Call the periodic timer test, which tests the timer API functions that\r
can be called from an ISR. */\r
vTimerPeriodicISRTests();\r
-} \r
+}\r
/*-----------------------------------------------------------*/\r
\r
char *pcGetTaskStatusMessage( void )\r
{\r
- /* A simple GET function used by a CGI script so it can display the \r
+ /* A simple GET function used by a CGI script so it can display the\r
execution status at the bottom of the task stats web page served by the\r
embedded web server. */\r
if( pcStatusMessage == NULL )\r
/* The SysTick is a down counter. How many clocks have passed since it was\r
last reloaded? */\r
ulSysTickCounts = ulSysTickReloadValue - *pulCurrentSysTickCount;\r
- \r
+\r
/* How many times has it overflowed? */\r
ulTickCount = xTaskGetTickCountFromISR();\r
\r
section, and the ISR safe critical sections are not designed to nest,\r
so reset the critical section. */\r
portSET_INTERRUPT_MASK_FROM_ISR();\r
- \r
+\r
/* Is there a SysTick interrupt pending? */\r
if( ( *pulInterruptCTRLState & ulSysTickPendingBit ) != 0UL )\r
{\r
/* There is a SysTick interrupt pending, so the SysTick has overflowed\r
but the tick count not yet incremented. */\r
ulTickCount++;\r
- \r
+\r
/* Read the SysTick again, as the overflow might have occurred since\r
it was read last. */\r
ulSysTickCounts = ulSysTickReloadValue - *pulCurrentSysTickCount;\r
- } \r
- \r
+ }\r
+\r
/* Convert the tick count into tenths of a millisecond. THIS ASSUMES\r
configTICK_RATE_HZ is 1000! */\r
ulReturn = ( ulTickCount * 10UL ) ;\r
- \r
+\r
/* Add on the number of tenths of a millisecond that have passed since the\r
tick count last got updated. */\r
ulReturn += ( ulSysTickCounts / ulClocksPer10thOfAMilliSecond );\r
- \r
- return ulReturn; \r
+\r
+ return ulReturn;\r
}\r
/*-----------------------------------------------------------*/\r
\r