Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. #include <stdint.h>
  2. #include "kernel/os.h"
  3. #include "kernel/bsp.h"
  4.  
  5. uint32_t stack_blinky1[40];
  6. Task blinky1;
  7. void main_blinky1() {
  8. while (1) {
  9. BSP_led0On();
  10. BSP_delay(BSP_TICKS_PER_SEC);
  11. BSP_led0Off();
  12. BSP_delay(BSP_TICKS_PER_SEC);
  13. }
  14. }
  15.  
  16. uint32_t stack_blinky2[40];
  17. Task blinky2;
  18. void main_blinky2() {
  19. while (1) {
  20. BSP_led1On();
  21. BSP_delay(BSP_TICKS_PER_SEC);
  22. BSP_led1Off();
  23. BSP_delay(BSP_TICKS_PER_SEC);
  24. }
  25. }
  26.  
  27.  
  28. int main()
  29. {
  30. BSP_init();
  31. OS_init();
  32.  
  33. Task_start(
  34. &blinky1,
  35. &main_blinky1,
  36. stack_blinky1,
  37. sizeof(stack_blinky1));
  38.  
  39. Task_start(
  40. &blinky2,
  41. &main_blinky2,
  42. stack_blinky2,
  43. sizeof(stack_blinky2));
  44.  
  45. while (1) {
  46. BSP_delay(BSP_TICKS_PER_SEC / 2U);
  47. }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement