Advertisement
RobertBerger

Untitled

Jul 25th, 2024
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. void vTask2(void *pvParameters) {
  2. const char *pcTaskName = "Task 2 is running\n";
  3. int *pxPedestrianMessage;
  4. int pedestrianVal;
  5. current_state = STATE_0;
  6.  
  7. /* As per most tasks, this task is implemented in an infinite loop. */
  8. for (;;) {
  9. /* Print out the name of this task. */
  10. vPrintString(pcTaskName);
  11. /* here we are in STATE_0 */
  12. long_delay();
  13. FSM(EVENT_FOR_STATE_1);
  14. short_delay();
  15. FSM(EVENT_FOR_STATE_2);
  16. short_delay();
  17. FSM(EVENT_FOR_STATE_3);
  18. short_delay();
  19. FSM(EVENT_FOR_STATE_4);
  20. long_delay();
  21. FSM(EVENT_FOR_STATE_5);
  22. short_delay();
  23. FSM(EVENT_FOR_STATE_6);
  24. short_delay();
  25. /* don't block on message */
  26. if (xQueueReceive( xQPedestrian, &( pxPedestrianMessage ), ( portTickType ) 0 )) {
  27. /* pxPedestrianMessage either enables or disables
  28. * the pedestrian functionality
  29. */
  30. if ((int) pxPedestrianMessage == 1) {
  31. FSM(EVENT_FOR_STATE_8);
  32. long_delay();
  33. FSM(EVENT_FOR_STATE_9);
  34. short_delay();
  35. }
  36. }
  37.  
  38. FSM(EVENT_FOR_STATE_7);
  39. short_delay();
  40. FSM(EVENT_FOR_STATE_0);
  41. /* here we are back to STATE_0
  42. * let's re-enable the shell in case it was disabled before
  43. */
  44. if (GetUseInputVal() == 0) {
  45. SetUseInputVal(1);
  46. }
  47. }
  48. }
  49.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement