+ /* Wait for a button push. This task will enter the Blocked state\r
+ (will not run again) until after a button has been pushed. */\r
+ prvButtonHit( ucIndex, portMAX_DELAY );\r
+ \r
+ /* The next line will only execute after a button has been pushed -\r
+ initialise the variable used to shake the dice. */\r
+ ulDiceRunTime = diceRUN_TIME;; \r
+\r
+ /* Suspend the flash tasks so this task has exclusive access to the\r
+ display. */\r
+ vSuspendFlashTasks( ucIndex, pdTRUE );\r
+\r
+ while( ulDiceRunTime > 0 )\r
+ {\r
+ ulDiceRunTime--;\r
+\r
+ /* Generate and display a random number. */\r
+ ucDiceValue = rand() % 6 + 1;\r
+ dice7SEG_Value( ucIndex ) = ( dice7SEG_Value( ucIndex ) | 0xf7 ) & cDisplaySegments[ ucIndex ][ ucDiceValue ];\r
+\r
+ /* Block/sleep for a very short time before generating the next\r
+ random number. */\r
+ vTaskDelay( diceDELAY_BETWEEN_RANDOM_NUMBERS_ms / portTICK_RATE_MS );\r
+ }\r
+\r
+ /* Wait for a short time before resuming (un-suspending) the flash \r
+ task. The flash tasks are only restarted if a button is not pushed\r
+ during this delay - if a button is pushed then the dice are shaken\r
+ again. \r
+\r
+ First...clear any button pushes that are already pending. Again a\r
+ block time of zero is used so the function does not wait for any \r
+ pushes. */\r
+ prvButtonHit( ucIndex, 0 );\r
+\r
+ /* Second...peek the semaphore. This task will block/sleep until a\r
+ button is pushed again, but because the peek function is used a \r
+ button being pushed will unblock the task but remain pending. */\r
+ if( xQueuePeek( xSemaphores[ ucIndex ], NULL, diceEND_DELAY ) == pdFALSE )\r