user-tasks.cpp 672 B

1234567891011121314151617181920212223242526272829303132
  1. #include "all-headers.h"
  2. static uint64_t gStack1 [64] ;
  3. static uint32_t gDisplayTime = 0 ;
  4. static void task1 (USER_MODE) {
  5. int counter(0);
  6. while (counter < 4) {
  7. if (gDisplayTime <= millis (MODE)) {
  8. const uint32_t s = systick (MODE) ;
  9. gotoLineColumn (MODE_ 1, 0) ;
  10. printUnsigned (MODE_ s) ;
  11. gotoLineColumn (MODE_ 2, 0) ;
  12. printUnsigned (MODE_ millis (MODE)) ;
  13. gotoLineColumn (MODE_ 3, 0) ;
  14. printUnsigned64 (MODE_ micros (MODE)) ;
  15. gDisplayTime += 1000 ;
  16. counter ++;
  17. }
  18. }
  19. taskSelfTerminates (MODE);
  20. }
  21. static void initTasks (INIT_MODE) {
  22. kernel_createTask (MODE_ gStack1, sizeof (gStack1), task1) ;
  23. }
  24. MACRO_INIT_ROUTINE (initTasks) ;