]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/PIC32MX_MPLAB/main_full.c
commit 9f316c246baafa15c542a5aea81a94f26e3d6507
[freertos] / FreeRTOS / Demo / PIC32MX_MPLAB / main_full.c
index 16d7de2ca95f5a225be90253c1c1b1f44e535a01..2828710c65c4173c8fb73b9626d0b93fa37d8b8a 100644 (file)
@@ -1,71 +1,29 @@
 /*\r
-    FreeRTOS V9.0.0rc2 - Copyright (C) 2016 Real Time Engineers Ltd.\r
-    All rights reserved\r
-\r
-    VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\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
-    ***************************************************************************\r
-    >>!   NOTE: The modification to the GPL is included to allow you to     !<<\r
-    >>!   distribute a combined work that includes FreeRTOS without being   !<<\r
-    >>!   obliged to provide the source code for proprietary components     !<<\r
-    >>!   outside of the FreeRTOS kernel.                                   !<<\r
-    ***************************************************************************\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 on the following\r
-    link: http://www.freertos.org/a00114.html\r
-\r
-    ***************************************************************************\r
-     *                                                                       *\r
-     *    FreeRTOS provides completely free yet professionally developed,    *\r
-     *    robust, strictly quality controlled, supported, and cross          *\r
-     *    platform software that is more than just the market leader, it     *\r
-     *    is the industry's de facto standard.                               *\r
-     *                                                                       *\r
-     *    Help yourself get started quickly while simultaneously helping     *\r
-     *    to support the FreeRTOS project by purchasing a FreeRTOS           *\r
-     *    tutorial book, reference manual, or both:                          *\r
-     *    http://www.FreeRTOS.org/Documentation                              *\r
-     *                                                                       *\r
-    ***************************************************************************\r
-\r
-    http://www.FreeRTOS.org/FAQHelp.html - Having a problem?  Start by reading\r
-    the FAQ page "My application does not run, what could be wrong?".  Have you\r
-    defined configASSERT()?\r
-\r
-    http://www.FreeRTOS.org/support - In return for receiving this top quality\r
-    embedded software for free we request you assist our global community by\r
-    participating in the support forum.\r
-\r
-    http://www.FreeRTOS.org/training - Investing in training allows your team to\r
-    be as productive as possible as early as possible.  Now you can receive\r
-    FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers\r
-    Ltd, and the world's leading authority on the world's leading RTOS.\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.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.\r
-    Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.\r
-\r
-    http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High\r
-    Integrity Systems ltd. to sell under the OpenRTOS brand.  Low cost OpenRTOS\r
-    licenses offer ticketed support, indemnification and commercial 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.3.0\r
+ * Copyright (C) 2020 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
  * NOTE 1:  This project provides two demo applications.  A simple blinky style\r
@@ -89,6 +47,9 @@
  * message to the LCD send the message on a queue to the LCD task instead of\r
  * accessing the LCD themselves.  The LCD task just blocks on the queue waiting\r
  * for messages - waking and displaying the messages as they arrive.\r
+ * **NOTE** The LCD driver has a dependency on the PLIB library, which is no\r
+ * longer provided by Microchip, so LCD functionality has been removed from this\r
+ * demo - however the source files remain in the distribution.\r
  *\r
  * "Check" timer - The check software timer period is initially set to three\r
  * seconds.  The callback function associated with the check software timer\r
  *\r
  *     + The UART is allocated a priority of 2. This means it can interrupt the\r
  *    RTOS tick, and can also safely use queues.\r
+ *    **NOTE** The UART driver has a dependency on the PLIB library, which is no\r
+ *    longer provided by Microchip, so UART functionality has been removed from\r
+ *    this demo - however the source files remain in the distribution.\r
+ *\r
  *  + Two timers are configured to generate interrupts just to test the nesting\r
  *    and queue access mechanisms. These timers are allocated priorities 2 and 3\r
  *    respectively. Even though they both access the same two queues, the\r
 #include "GenQTest.h"\r
 #include "QPeek.h"\r
 #include "lcd.h"\r
-#include "comtest2.h"\r
 #include "timertest.h"\r
 #include "IntQueue.h"\r
 \r
@@ -170,13 +134,6 @@ in ticks using the portTICK_PERIOD_MS constant. */
 #define mainINTEGER_TASK_PRIORITY           ( tskIDLE_PRIORITY )\r
 #define mainGEN_QUEUE_TASK_PRIORITY                    ( tskIDLE_PRIORITY )\r
 \r
-/* The LED used by the comtest tasks.  mainCOM_TEST_LED + 1 is also used.\r
-See the comtest.c file for more information. */\r
-#define mainCOM_TEST_LED                                       ( 4 )\r
-\r
-/* Baud rate used by the comtest tasks. */\r
-#define mainCOM_TEST_BAUD_RATE                         ( 115200 )\r
-\r
 /* Misc. */\r
 #define mainDONT_BLOCK                                         ( 0 )\r
 \r
@@ -251,10 +208,6 @@ int main_full( void )
 {\r
 TimerHandle_t xTimer = NULL;\r
 \r
-       /* Create the LCD task - this returns the queue to use when writing\r
-       messages to the LCD. */\r
-       xLCDQueue = xStartLCDTask();\r
-\r
        /* Create all the other standard demo tasks. */\r
        vStartLEDFlashTimers( mainNUM_FLASH_TIMER_LEDS );\r
     vCreateBlockTimeTasks();\r
@@ -267,13 +220,6 @@ TimerHandle_t xTimer = NULL;
        xTaskCreate( prvRegTestTask1, "Reg1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
        xTaskCreate( prvRegTestTask2, "Reg2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
 \r
-    /* The PIC32MX795 uses an 8 deep fifo where TX interrupts are asserted\r
-       whilst the TX buffer is empty.  This causes an issue with the test driver so\r
-       it is not used in this demo */\r
-       #if !defined(__32MX795F512L__)\r
-               vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED );\r
-       #endif\r
-\r
        /* Create the software timer that performs the 'check' functionality, as\r
        described at the top of this file. */\r
        xTimer = xTimerCreate(  "CheckTimer",/* A text name, purely to help debugging. */\r
@@ -290,7 +236,7 @@ TimerHandle_t xTimer = NULL;
 \r
        /* A software timer is also used to start the high frequency timer test.\r
        This is to ensure the test does not start before the kernel.  This time a\r
-       one shot software timer is used. */\r
+       one-shot software timer is used. */\r
        xTimer = xTimerCreate( "HighHzTimerSetup", 1, pdFALSE, ( void * ) 0, prvSetupHighFrequencyTimerTest );\r
        if( xTimer != NULL )\r
        {\r
@@ -391,19 +337,12 @@ static xLCDMessage xMessage = { ( 200 / portTICK_PERIOD_MS ), cStringBuffer };
        {\r
                xMessage.pcMessage = "Error: Int queue";\r
        }\r
-       #if !defined(__32MX795F512L__)\r
-               else if( xAreComTestTasksStillRunning() != pdTRUE )\r
-               {\r
-                       xMessage.pcMessage = "Error: COM test";\r
-               }\r
-       #endif\r
 \r
        if( xMessage.pcMessage != cStringBuffer )\r
        {\r
                /* An error string has been logged.  If the timer period has not yet\r
                been changed it should be changed now.  Increasing the frequency of the\r
-               LED gives visual feedback of the error status (although it is written\r
-               to the LCD too!). */\r
+               LED gives visual feedback of the error status. */\r
                if( lChangedTimerPeriodAlready == pdFALSE )\r
                {\r
                        lChangedTimerPeriodAlready = pdTRUE;\r
@@ -422,9 +361,6 @@ static xLCDMessage xMessage = { ( 200 / portTICK_PERIOD_MS ), cStringBuffer };
                sprintf( cStringBuffer, "Pass %u", ( unsigned int ) ulHighFrequencyTimerInterrupts );\r
        }\r
 \r
-       /* Send the status message to the LCD task for display on the LCD.  This is\r
-       a timer callback function, so the queue send function *must not* block. */\r
-       xQueueSend( xLCDQueue, &xMessage, mainDONT_BLOCK );\r
        vParTestToggleLED( mainCHECK_LED );\r
 }\r
 /*-----------------------------------------------------------*/\r
@@ -433,7 +369,7 @@ static void prvSetupHighFrequencyTimerTest( TimerHandle_t xTimer )
 {\r
        /* Setup the high frequency, high priority, timer test.  It is setup in this\r
        software timer callback to ensure it does not start before the kernel does.\r
-       This is a one shot timer - so the setup routine will only be executed once. */\r
+       This is a one-shot timer - so the setup routine will only be executed once. */\r
        vSetupTimerTest( mainTEST_INTERRUPT_FREQUENCY );\r
 }\r
 \r