-/** 
- *  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.
+/**
+    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

  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]);


StatusRequest measure;

Scheduler ts, hts;

// Callback methods prototypes
void CycleCallback();
