user-tasks.cpp 643 B

123456789101112131415161718192021222324252627282930
  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. }
  20. static void initTasks (INIT_MODE) {
  21. kernel_createTask (MODE_ gStack1, sizeof (gStack1), task1) ;
  22. }
  23. MACRO_INIT_ROUTINE (initTasks) ;