X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=FreeRTOS%2FDemo%2FAVR32_UC3%2Fmain.c;h=a13a45f779480340cd66ec000156456f40c1241b;hb=b15dfacb6026af3b0ba697e5753844923b468d2b;hp=4ecb23c1a1d1bc57e925fe3e806aabb7c275138e;hpb=abf43e0ca4466819c7c77a7bb37d72aa9175e471;p=freertos diff --git a/FreeRTOS/Demo/AVR32_UC3/main.c b/FreeRTOS/Demo/AVR32_UC3/main.c index 4ecb23c1a..a13a45f77 100644 --- a/FreeRTOS/Demo/AVR32_UC3/main.c +++ b/FreeRTOS/Demo/AVR32_UC3/main.c @@ -30,69 +30,31 @@ *****************************************************************************/ /* - FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. - All rights reserved - - VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. - - *************************************************************************** - * * - * FreeRTOS provides completely free yet professionally developed, * - * robust, strictly quality controlled, supported, and cross * - * platform software that has become a de facto standard. * - * * - * Help yourself get started quickly and support the FreeRTOS * - * project by purchasing a FreeRTOS tutorial book, reference * - * manual, or both from: http://www.FreeRTOS.org/Documentation * - * * - * Thank you! * - * * - *************************************************************************** - - This file is part of the FreeRTOS distribution. - - FreeRTOS is free software; you can redistribute it and/or modify it under - the terms of the GNU General Public License (version 2) as published by the - Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception. - - >>! NOTE: The modification to the GPL is included to allow you to distribute - >>! a combined work that includes FreeRTOS without being obliged to provide - >>! the source code for proprietary components outside of the FreeRTOS - >>! kernel. - - FreeRTOS 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. Full license text is available from the following - link: http://www.freertos.org/a00114.html - - 1 tab == 4 spaces! - - *************************************************************************** - * * - * Having a problem? Start by reading the FAQ "My application does * - * not run, what could be wrong?" * - * * - * http://www.FreeRTOS.org/FAQHelp.html * - * * - *************************************************************************** - - http://www.FreeRTOS.org - Documentation, books, training, latest versions, - license and Real Time Engineers Ltd. contact details. - - http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, - including FreeRTOS+Trace - an indispensable productivity tool, a DOS - compatible FAT file system, and our tiny thread aware UDP/IP stack. - - http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High - Integrity Systems to sell under the OpenRTOS brand. Low cost OpenRTOS - licenses offer ticketed support, indemnification and middleware. - - http://www.SafeRTOS.com - High Integrity Systems also provide a safety - engineered and independently SIL3 certified version for use in safety and - mission critical applications that require provable dependability. - - 1 tab == 4 spaces! -*/ + * FreeRTOS Kernel V10.3.0 + * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * http://www.FreeRTOS.org + * http://aws.amazon.com/freertos + * + * 1 tab == 4 spaces! + */ #include @@ -133,7 +95,7 @@ //! @} //! Baud rate used by the serial port tasks. -#define mainCOM_TEST_BAUD_RATE ( ( unsigned portLONG ) 57600 ) +#define mainCOM_TEST_BAUD_RATE ( ( unsigned long ) 57600 ) //! LED used by the serial port tasks. This is toggled on each character Tx, //! and mainCOM_TEST_LED + 1 is toggled on each character Rx. @@ -148,16 +110,16 @@ #define mainERROR_LED ( 7 ) //! The period between executions of the check task. -#define mainCHECK_PERIOD ( ( portTickType ) 3000 / portTICK_RATE_MS ) +#define mainCHECK_PERIOD ( ( TickType_t ) 3000 / portTICK_PERIOD_MS ) //! If an error is detected in a task, the vErrorChecks task will enter in an //! infinite loop flashing the LED at this rate. -#define mainERROR_FLASH_RATE ( (portTickType) 500 / portTICK_RATE_MS ) +#define mainERROR_FLASH_RATE ( (TickType_t) 500 / portTICK_PERIOD_MS ) /*! \name Constants used by the vMemCheckTask() task. */ //! @{ -#define mainCOUNT_INITIAL_VALUE ( ( unsigned portLONG ) 0 ) +#define mainCOUNT_INITIAL_VALUE ( ( unsigned long ) 0 ) #define mainNO_TASK ( 0 ) //! @} @@ -223,7 +185,7 @@ int main( void ) task as described at the top of this file. */ xTaskCreate( vErrorChecks - , (const signed portCHAR *)"ErrCheck" + , "ErrCheck" , configMINIMAL_STACK_SIZE , NULL , mainCHECK_TASK_PRIORITY @@ -244,9 +206,9 @@ int main( void ) */ static void vErrorChecks( void *pvParameters ) { -static volatile unsigned portLONG ulDummyVariable = 3UL; -unsigned portLONG ulMemCheckTaskRunningCount; -xTaskHandle xCreatedTask; +static volatile unsigned long ulDummyVariable = 3UL; +unsigned long ulMemCheckTaskRunningCount; +TaskHandle_t xCreatedTask; portBASE_TYPE bSuicidalTask = 0; /* The parameters are not used. Prevent compiler warnings. */ @@ -288,7 +250,7 @@ portBASE_TYPE bSuicidalTask = 0; ulMemCheckTaskRunningCount = mainCOUNT_INITIAL_VALUE; if( xTaskCreate( vMemCheckTask, - ( signed portCHAR * ) "MEM_CHECK", + "MEM_CHECK", configMINIMAL_STACK_SIZE, ( void * ) &ulMemCheckTaskRunningCount, tskIDLE_PRIORITY, &xCreatedTask ) != pdPASS ) @@ -394,9 +356,9 @@ static portBASE_TYPE xErrorHasOccurred = pdFALSE; */ static void vMemCheckTask( void *pvParameters ) { -unsigned portLONG *pulMemCheckTaskRunningCounter; +unsigned long *pulMemCheckTaskRunningCounter; void *pvMem1, *pvMem2, *pvMem3; -static portLONG lErrorOccurred = pdFALSE; +static long lErrorOccurred = pdFALSE; /* This task is dynamically created then deleted during each cycle of the vErrorChecks task to check the operation of the memory allocator. Each time @@ -409,7 +371,7 @@ static portLONG lErrorOccurred = pdFALSE; pulMemCheckTaskRunningCounter is incremented each cycle to indicate to the vErrorChecks() task that this task is still executing without error. */ - pulMemCheckTaskRunningCounter = ( unsigned portLONG * ) pvParameters; + pulMemCheckTaskRunningCounter = ( unsigned long * ) pvParameters; for( ;; ) {