 #define _TASK_STATUS_REQUEST    // Compile with support for StatusRequest functionality - triggering tasks on status change events in addition to time only
 #define _TASK_WDT_IDS           // Compile with support for wdt control points and task ids
 #define _TASK_LTS_POINTER       // Compile with support for local task storage pointer
-// #define _TASK_PRIORITY          // Support for layered scheduling priority
+#define _TASK_PRIORITY          // Support for layered scheduling priority
 // #define _TASK_MICRO_RES         // Support for microsecond resolution
 // #define _TASK_STD_FUNCTION      // Support for std::function (ESP8266 and ESP32 ONLY)
-// #define _TASK_DEBUG             // Make all methods and variables public for debug purposes
+#define _TASK_DEBUG             // Make all methods and variables public for debug purposes
 #define _TASK_INLINE       // Make all methods "inline" - needed to support some multi-tab, multi-file implementations
 #define _TASK_TIMEOUT           // Support for overall task timeout 
 

  Serial.print("SCallback: TaskID=");
  Serial.println(i);
  Serial.print("Emulating measurement. d=");
  
  d[i] = random(501); // pick a value from 0 to 500 "centimeters" simulating a measurement
  int *pd = (int*) t.getLtsPointer();
  *pd = d[i];
  
  measure.signal();

  Serial.print(d[i]);

/**
    This is example 5 rewritten with Timeout, LTS and WDT functioanlity:
    - 1 second timeout is set for the main calculation task
    - LTS is used to address individual array elements for each sensor sinlce the callback code is shared
    - WDT is used to set the Task ID and use that as an index for array of distances (alternative to LTS)

    Original description:
    ====================
      This test emulates querying 3 sensors once every 10 seconds, each could respond with a different delay
      (ultrasonic sensors for instance) and printing a min value of the three when all three have reported their values.
      The overall timeout of 1 second is setup as well.
      An error message needs to be printed if a timeout occurred instead of a value.

      Example5:
       Sketch uses 6066 bytes (18%) of program storage space. Maximum is 32256 bytes.
       Global variables use 1039 bytes (50%) of dynamic memory, leaving 1009 bytes for local variables. Maximum is 2048 bytes.
      Example 18:
       Sketch uses 5142 bytes (15%) of program storage space. Maximum is 32256 bytes.
       Global variables use 878 bytes (42%) of dynamic memory, leaving 1170 bytes for local variables. Maximum is 2048 bytes.
*/

// #define _TASK_TIMECRITICAL      // Enable monitoring scheduling overruns
