/*\r
- FreeRTOS V8.2.2 - Copyright (C) 2015 Real Time Engineers Ltd.\r
+ FreeRTOS V9.0.0 - 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
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
+ 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
*\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...and so on.\r
+ * this file. It sends the value 100 to the queue every 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 an 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
+ * in this file. It blocks on the queue to wait for data to arrive from the\r
+ * queue send task - toggling the LED each time it receives the value 100. The\r
+ * queue send task writes to the queue every 200ms, so the LED should toggle\r
+ * every 200ms.\r
*/\r
\r
/* Kernel includes. */\r
#include "task.h"\r
#include "semphr.h"\r
\r
+/* Renesas includes. */\r
+#include "rskrx231def.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
+#define mainQUEUE_SEND_FREQUENCY_MS ( pdMS_TO_TICKS( 200UL ) )\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
\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 either insufficient FreeRTOS heap memory available for the idle\r
- and/or timer tasks to be created, or vTaskStartScheduler() was called from\r
- User mode. See the memory management section on the FreeRTOS web site for\r
- more details on the FreeRTOS heap http://www.freertos.org/a00111.html. The\r
- mode from which main() is called is set in the C start up code and must be\r
- a privileged mode (not user mode). */\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 on the FreeRTOS heap\r
+ http://www.freertos.org/a00111.html. */\r
for( ;; );\r
}\r
/*-----------------------------------------------------------*/\r
is it the expected value? If it is, toggle the LED. */\r
if( ulReceivedValue == ulExpectedValue )\r
{\r
-//_RB_ LED0 = !LED0;\r
+ LED0 = !LED0;\r
ulReceivedValue = 0U;\r
}\r
}\r