]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/RX600_RX63N-RSK_Renesas/RTOSDemo/main-blinky.c
Update version number in readiness for V10.3.0 release. Sync SVN with reviewed releas...
[freertos] / FreeRTOS / Demo / RX600_RX63N-RSK_Renesas / RTOSDemo / main-blinky.c
diff --git a/FreeRTOS/Demo/RX600_RX63N-RSK_Renesas/RTOSDemo/main-blinky.c b/FreeRTOS/Demo/RX600_RX63N-RSK_Renesas/RTOSDemo/main-blinky.c
deleted file mode 100644 (file)
index f6fd5f4..0000000
+++ /dev/null
@@ -1,238 +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
- * This is a very simple demo that creates two tasks, one queue, and one \r
- * software timer.  For a much more complete and complex example select either \r
- * the Debug or Debug_with_optimisation build configurations within the HEW,\r
- * which build main_full.c in place of this file.\r
- * \r
- * One task (the queue receive task) blocks on the queue to wait for data to \r
- * arrive, toggling LED0 each time '100' is received.  The other task (the \r
- * queue send task) repeatedly blocks for a fixed period before sending '100' \r
- * to the queue (causing the first task to toggle the LED). \r
- *\r
- * The software timer is configured to auto-reload.  The timer callback \r
- * function periodically toggles LED1.\r
- */\r
-\r
-/* Hardware specific includes. */\r
-#include "iodefine.h"\r
-\r
-/* Kernel includes. */\r
-#include "FreeRTOS.h"\r
-#include "task.h"\r
-#include "timers.h"\r
-#include "queue.h"\r
-\r
-/* Priorities at which the tasks are created. */\r
-#define configQUEUE_RECEIVE_TASK_PRIORITY      ( tskIDLE_PRIORITY + 1 )\r
-#define        configQUEUE_SEND_TASK_PRIORITY          ( tskIDLE_PRIORITY + 2 )\r
-\r
-/* The rate at which data is sent to the queue, specified in milliseconds. */\r
-#define mainQUEUE_SEND_PERIOD_MS                       ( 500 / portTICK_PERIOD_MS )\r
-\r
-/* The period of the software timer, specified in milliseconds. */\r
-#define mainSOFTWARE_TIMER_PERIOD_MS           ( 150 / 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 so the send task should always find the\r
-queue empty. */\r
-#define mainQUEUE_LENGTH                                       ( 1 )\r
-\r
-/* The LEDs toggle by the task and timer respectively. */\r
-#define mainTASK_LED                                           ( 0 )\r
-#define mainTIMER_LED                                          ( 1 )\r
-\r
-/*\r
- * The tasks as defined at the top of this file.\r
- */\r
-static void prvQueueReceiveTask( void *pvParameters );\r
-static void prvQueueSendTask( void *pvParameters );\r
-\r
-/*\r
- * The callback function used by the software timer.\r
- */\r
-static void prvBlinkyTimerCallback( TimerHandle_t xTimer );\r
-\r
-/* The queue used by both tasks. */\r
-static QueueHandle_t xQueue = NULL;\r
-\r
-/* This variable is not used by this simple Blinky example.  It is defined \r
-purely to allow the project to link as it is used by the full project. */\r
-volatile unsigned long ulHighFrequencyTickCount = 0UL;\r
-/*-----------------------------------------------------------*/\r
-\r
-void main(void)\r
-{\r
-TimerHandle_t xTimer;\r
-\r
-       /* Turn all LEDs off. */\r
-       vParTestInitialise();\r
-       \r
-       /* Create the queue. */\r
-       xQueue = xQueueCreate( mainQUEUE_LENGTH, sizeof( unsigned long ) );\r
-\r
-       /* Create the software timer, as described at the top of this file. */\r
-       xTimer = xTimerCreate( "BlinkyTimer",                                   /* Just a text name to make debugging easier - not used by the scheduler. */\r
-                                                       mainSOFTWARE_TIMER_PERIOD_MS,   /* The timer period. */\r
-                                                       pdTRUE,                                                 /* Set to pdTRUE for periodic timer, or pdFALSE for one-shot timer. */\r
-                                                       NULL,                                                   /* The timer ID is not required. */\r
-                                                       prvBlinkyTimerCallback );               /* The function executed when the timer expires. */\r
-                                                       \r
-       if( xTimer != NULL )\r
-       {\r
-               /* Start the timer - it will not actually start running until the\r
-               scheduler has started.  The block time is set to 0, although, because\r
-               xTimerStart() is being called before the scheduler has been started,\r
-               the any block time specified would be ignored anyway. */\r
-               xTimerStart( xTimer, 0UL );\r
-       }\r
-       \r
-       if( xQueue != NULL )\r
-       {\r
-               /* Start the two tasks as described at the top of this file. */\r
-               xTaskCreate( prvQueueReceiveTask,                                       /* The function that implements the task. */\r
-                                        "Rx",                                                                  /* Just a text name to make debugging easier - not used by the scheduler. */\r
-                                        configMINIMAL_STACK_SIZE,                              /* The size of the task stack, in words. */\r
-                                        NULL,                                                                  /* The task parameter is not used. */\r
-                                        configQUEUE_RECEIVE_TASK_PRIORITY,     /* The priority assigned to the task when it is created. */\r
-                                        NULL );                                                                /* The task handle is not used. */\r
-                                        \r
-               xTaskCreate( prvQueueSendTask, "TX", configMINIMAL_STACK_SIZE, NULL, configQUEUE_SEND_TASK_PRIORITY, NULL );\r
-\r
-               /* Start the tasks running. */\r
-               vTaskStartScheduler();\r
-       }\r
-       \r
-       /* If all is well we will never reach here as the scheduler will now be\r
-       running.  If we do reach here then it is likely that there was insufficient\r
-       heap available for the idle task to be created. */\r
-       for( ;; );\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
-static void prvQueueSendTask( void *pvParameters )\r
-{\r
-TickType_t xNextWakeTime;\r
-const unsigned long ulValueToSend = 100UL;\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
-               The block state is specified in ticks, the constant used converts ticks\r
-               to ms. */\r
-               vTaskDelayUntil( &xNextWakeTime, mainQUEUE_SEND_PERIOD_MS );\r
-\r
-               /* Send to the queue - causing the queue receive task to flash its LED.  0\r
-               is used so the send does not block - it shouldn't need to as the queue\r
-               should always be empty here. */\r
-               xQueueSend( xQueue, &ulValueToSend, 0 );\r
-       }\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
-static void prvQueueReceiveTask( void *pvParameters )\r
-{\r
-unsigned long ulReceivedValue;\r
-\r
-       for( ;; )\r
-       {\r
-               /* Wait until something arives in the queue - this 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 arrived, but is it the expected\r
-               value?  If it is, toggle the LED. */\r
-               if( ulReceivedValue == 100UL )\r
-               {\r
-                       vParTestToggleLED( mainTASK_LED );\r
-               }\r
-       }\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
-static void prvBlinkyTimerCallback( TimerHandle_t xTimer )\r
-{\r
-       /* The software timer does nothing but toggle an LED. */\r
-       vParTestToggleLED( mainTIMER_LED );\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
-void vApplicationSetupTimerInterrupt( void )\r
-{\r
-       /* Enable compare match timer 0. */\r
-       MSTP( CMT0 ) = 0;\r
-       \r
-       /* Interrupt on compare match. */\r
-       CMT0.CMCR.BIT.CMIE = 1;\r
-       \r
-       /* Set the compare match value. */\r
-       CMT0.CMCOR = ( unsigned short ) ( ( ( configPERIPHERAL_CLOCK_HZ / configTICK_RATE_HZ ) -1 ) / 8 );\r
-       \r
-       /* Divide the PCLK by 8. */\r
-       CMT0.CMCR.BIT.CKS = 0;\r
-       \r
-       /* Enable the interrupt... */\r
-       _IEN( _CMT0_CMI0 ) = 1;\r
-       \r
-       /* ...and set its priority to the application defined kernel priority. */\r
-       _IPR( _CMT0_CMI0 ) = configKERNEL_INTERRUPT_PRIORITY;\r
-       \r
-       /* Start the timer. */\r
-       CMT.CMSTR0.BIT.STR0 = 1;\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
-/* This function is explained by the comments above its prototype at the top\r
-of this file. */\r
-void vApplicationMallocFailedHook( void )\r
-{\r
-       for( ;; );\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
-/* This function is explained by the comments above its prototype at the top\r
-of this file. */\r
-void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName )\r
-{\r
-       for( ;; );\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
-/* This function is explained by the comments above its prototype at the top\r
-of this file. */\r
-void vApplicationIdleHook( void )\r
-{\r
-       /* Just to prevent the variable getting optimised away. */\r
-       ( void ) ulHighFrequencyTickCount;\r
-}\r
-/*-----------------------------------------------------------*/\r