]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/RL78_E2Studio_GCC/src/main_blinky.c
Update version number in readiness for V10.3.0 release. Sync SVN with reviewed releas...
[freertos] / FreeRTOS / Demo / RL78_E2Studio_GCC / src / main_blinky.c
diff --git a/FreeRTOS/Demo/RL78_E2Studio_GCC/src/main_blinky.c b/FreeRTOS/Demo/RL78_E2Studio_GCC/src/main_blinky.c
deleted file mode 100644 (file)
index eb2237e..0000000
+++ /dev/null
@@ -1,195 +0,0 @@
-/*\r
- * FreeRTOS Kernel V10.1.0\r
- * Copyright (C) 2018 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
- * project, and a more comprehensive test and demo application.  The\r
- * mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting in main.c is used to select\r
- * between the two.  See the notes on using mainCREATE_SIMPLE_BLINKY_DEMO_ONLY\r
- * in main.c.  This file implements the simply blinky style version.\r
- *\r
- * NOTE 2:  This file only contains the source code that is specific to the\r
- * basic demo.  Generic functions, such FreeRTOS hook functions, and functions\r
- * required to configure the hardware, along with an example interrupt service\r
- * routine, are defined in main.c.\r
- ******************************************************************************\r
- *\r
- * main_blinky() creates one queue, and two tasks.  It then starts the\r
- * scheduler.\r
- *\r
- * The Queue Send Task:\r
- * The queue send task is implemented by the prvQueueSendTask() function in\r
- * this file.  prvQueueSendTask() sits in a loop that causes it to repeatedly\r
- * block for 200 milliseconds, before sending the value 100 to the queue that\r
- * was created within main_blinky().  Once the value is sent, the task loops\r
- * back around to block for another 200 milliseconds.\r
- *\r
- * The Queue Receive Task:\r
- * The queue receive task is implemented by the prvQueueReceiveTask() function\r
- * in this file.  prvQueueReceiveTask() sits in a loop where it repeatedly\r
- * blocks on attempts to read data from the queue that was created within\r
- * main_blinky().  When data is received, the task checks the value of the\r
- * data, and if the value equals the expected 100, toggles the LED.  The 'block\r
- * time' parameter passed to the queue receive function specifies that the\r
- * task should be held in the Blocked state indefinitely to wait for data to\r
- * be available on the queue.  The queue receive task will only leave the\r
- * Blocked state when the queue send task writes to the queue.  As the queue\r
- * send task writes to the queue every 200 milliseconds, the queue receive\r
- * task leaves the Blocked state every 200 milliseconds, and therefore toggles\r
- * the LED every 200 milliseconds.\r
- */\r
-\r
-/* Standard includes. */\r
-#include <stdio.h>\r
-\r
-/* Kernel includes. */\r
-#include "FreeRTOS.h"\r
-#include "task.h"\r
-#include "semphr.h"\r
-\r
-/* Eval board specific definitions. */\r
-#include "demo_specific_io.h"\r
-\r
-/* Priorities at which the tasks are created. */\r
-#define mainQUEUE_RECEIVE_TASK_PRIORITY                ( tskIDLE_PRIORITY + 2 )\r
-#define        mainQUEUE_SEND_TASK_PRIORITY            ( tskIDLE_PRIORITY + 1 )\r
-\r
-/* The rate at which data is sent to the queue.  The 200ms value is converted\r
-to ticks using the portTICK_PERIOD_MS constant. */\r
-#define mainQUEUE_SEND_FREQUENCY_MS                    ( 200 / portTICK_PERIOD_MS )\r
-\r
-/* The number of items the queue can hold.  This is 1 as the receive task\r
-will remove items as they are added, meaning the send task should always find\r
-the queue empty. */\r
-#define mainQUEUE_LENGTH                                       ( 1 )\r
-\r
-/* Used to check the task parameter passing in both supported memory models. */\r
-#define mainQUEUE_SEND_PARAMETER       ( ( void * ) 0x1234U )\r
-#define mainQUEUE_RECEIVE_PARAMETER    ( ( void * ) 0x1122U )\r
-/*-----------------------------------------------------------*/\r
-\r
-/*\r
- * The tasks as described in the comments at the top of this file.\r
- */\r
-static void prvQueueReceiveTask( void *pvParameters );\r
-static void prvQueueSendTask( void *pvParameters );\r
-\r
-/*\r
- * Called by main() to create the simply blinky style application if\r
- * mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 1.\r
- */\r
-void main_blinky( void );\r
-\r
-/*-----------------------------------------------------------*/\r
-\r
-/* The queue used by both tasks. */\r
-static QueueHandle_t xQueue = NULL;\r
-\r
-/*-----------------------------------------------------------*/\r
-\r
-void main_blinky( void )\r
-{\r
-       /* Create the queue. */\r
-       xQueue = xQueueCreate( mainQUEUE_LENGTH, sizeof( unsigned long ) );\r
-\r
-       if( xQueue != NULL )\r
-       {\r
-               /* Start the two tasks as described in the comments at the top of this\r
-               file. */\r
-               xTaskCreate( prvQueueReceiveTask,                       /* The function that implements the task. */\r
-                                       "Rx",                                                   /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
-                                       configMINIMAL_STACK_SIZE,               /* The size of the stack to allocate to the task. */\r
-                                       mainQUEUE_RECEIVE_PARAMETER,    /* The parameter passed to the task - just used to check the port in this case. */\r
-                                       mainQUEUE_RECEIVE_TASK_PRIORITY,/* The priority assigned to the task. */\r
-                                       NULL );                                                 /* The task handle is not required, so NULL is passed. */\r
-\r
-               xTaskCreate( prvQueueSendTask, "TX", configMINIMAL_STACK_SIZE, mainQUEUE_SEND_PARAMETER, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
-\r
-               /* Start the tasks and timer running. */\r
-               vTaskStartScheduler();\r
-       }\r
-\r
-       /* If all is well, the scheduler will now be running, and the following\r
-       line will never be reached.  If the following line does execute, then\r
-       there was insufficient FreeRTOS heap memory available for the idle and/or\r
-       timer tasks     to be created.  See the memory management section on the\r
-       FreeRTOS web site for more details.  http://www.freertos.org/a00111.html. */\r
-       for( ;; );\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
-static void prvQueueSendTask( void *pvParameters )\r
-{\r
-TickType_t xNextWakeTime;\r
-const unsigned long ulValueToSend = 100UL;\r
-\r
-       /* Check the parameter was passed in correctly. */\r
-       configASSERT( pvParameters == mainQUEUE_SEND_PARAMETER )\r
-\r
-       /* Initialise xNextWakeTime - this only needs to be done once. */\r
-       xNextWakeTime = xTaskGetTickCount();\r
-\r
-       for( ;; )\r
-       {\r
-               /* Place this task in the blocked state until it is time to run again. */\r
-               vTaskDelayUntil( &xNextWakeTime, mainQUEUE_SEND_FREQUENCY_MS );\r
-\r
-               /* Send to the queue - causing the queue receive task to unblock and\r
-               toggle the LED.  0 is used as the block time so the sending operation\r
-               will not block - it shouldn't need to block as the queue should always\r
-               be empty at this point in the code. */\r
-               xQueueSend( xQueue, &ulValueToSend, 0U );\r
-       }\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
-static void prvQueueReceiveTask( void *pvParameters )\r
-{\r
-unsigned long ulReceivedValue;\r
-const unsigned long ulExpectedValue = 100UL;\r
-\r
-       /* Check the parameter was passed in correctly. */\r
-       configASSERT( pvParameters == mainQUEUE_RECEIVE_PARAMETER )\r
-\r
-       for( ;; )\r
-       {\r
-               /* Wait until something arrives in the queue - this task will block\r
-               indefinitely provided INCLUDE_vTaskSuspend is set to 1 in\r
-               FreeRTOSConfig.h. */\r
-               xQueueReceive( xQueue, &ulReceivedValue, portMAX_DELAY );\r
-\r
-               /*  To get here something must have been received from the queue, but\r
-               is it the expected value?  If it is, toggle the LED. */\r
-               if( ulReceivedValue == ulExpectedValue )\r
-               {\r
-                       LED_BIT = !LED_BIT;\r
-                       ulReceivedValue = 0U;\r
-               }\r
-       }\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r