X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=FreeRTOS%2FDemo%2FAVR32_UC3%2Fmain.c;h=a13a45f779480340cd66ec000156456f40c1241b;hb=b15dfacb6026af3b0ba697e5753844923b468d2b;hp=830ef86a61b2f16f3efdc1361169157c06175528;hpb=90f4c3885b2e63f57a7172c148f67b96cf44eca2;p=freertos diff --git a/FreeRTOS/Demo/AVR32_UC3/main.c b/FreeRTOS/Demo/AVR32_UC3/main.c index 830ef86a6..a13a45f77 100644 --- a/FreeRTOS/Demo/AVR32_UC3/main.c +++ b/FreeRTOS/Demo/AVR32_UC3/main.c @@ -30,70 +30,31 @@ *****************************************************************************/ /* - FreeRTOS V7.1.1 - Copyright (C) 2012 Real Time Engineers Ltd. - - - *************************************************************************** - * * - * FreeRTOS tutorial books are available in pdf and paperback. * - * Complete, revised, and edited pdf reference manuals are also * - * available. * - * * - * Purchasing FreeRTOS documentation will not only help you, by * - * ensuring you get running as quickly as possible and with an * - * in-depth knowledge of how to use FreeRTOS, it will also help * - * the FreeRTOS project to continue with its mission of providing * - * professional grade, cross platform, de facto standard solutions * - * for microcontrollers - completely free of charge! * - * * - * >>> See http://www.FreeRTOS.org/Documentation for details. <<< * - * * - * Thank you for using FreeRTOS, and thank you for your support! * - * * - *************************************************************************** - - - 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. See the GNU General Public License for - more details. You should have received a copy of the GNU General Public - License and the FreeRTOS license exception along with FreeRTOS; if not it - can be viewed here: http://www.freertos.org/a00114.html and also obtained - by writing to Richard Barry, contact details for whom are available on the - FreeRTOS WEB site. - - 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, training, latest information, - license and contact details. - - http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, - including FreeRTOS+Trace - an indispensable productivity tool. - - Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell - the code with commercial support, indemnification, and middleware, under - the OpenRTOS brand: http://www.OpenRTOS.com. High Integrity Systems also - provide a safety engineered and independently SIL3 certified version under - the SafeRTOS brand: http://www.SafeRTOS.com. -*/ + * 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 @@ -134,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. @@ -149,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 ) //! @} @@ -224,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 @@ -245,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. */ @@ -289,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 ) @@ -395,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 @@ -410,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( ;; ) {