]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/RX200_RX231-RSK_GCC_e2studio_IAR/src/Blinky_Demo/main_blinky.c
Check in RX231 IAR demo.
[freertos] / FreeRTOS / Demo / RX200_RX231-RSK_GCC_e2studio_IAR / src / Blinky_Demo / main_blinky.c
index 39c267b98c2a4308a8a6e4d5dd3eacec43f15768..749c8576ae021785cf3a6367f776a205175da180 100644 (file)
  *\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
 \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