Advertisement
steschm0712

Untitled

Nov 11th, 2015
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. void blinknext() {
  2. static uint32_t loop=0;
  3.  
  4. switch(loop) {
  5. case 0:
  6. ledonoff(1,0);
  7. ledonoff(2,0);
  8. ledonoff(3,0);
  9. ledonoff(4,1);
  10. break;
  11. case 1:
  12. ledonoff(1,0);
  13. ledonoff(2,0);
  14. ledonoff(3,1);
  15. ledonoff(4,0);
  16. break;
  17. case 2:
  18. ledonoff(1,0);
  19. ledonoff(2,1);
  20. ledonoff(3,0);
  21. ledonoff(4,0);
  22. break;
  23. case 3:
  24. ledonoff(1,1);
  25. ledonoff(2,0);
  26. ledonoff(3,0);
  27. ledonoff(4,0);
  28. break;
  29. }
  30. loop++;
  31. if (loop==4)
  32. loop=0;
  33. }
  34.  
  35.  
  36. void BlinkFxn(UArg arg0)
  37. {
  38. uint32_t wait_ticks = (uint32_t) arg0;
  39. /*gpio driverlib api uses same bit pattern for gpio mask and value*/
  40.  
  41. while(1) {
  42.  
  43. blinknext();
  44. Task_sleep(wait_ticks);
  45.  
  46. }
  47.  
  48.  
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement