See graph

Dependencies:   MCP23017 SDFileSystem WattBob_TextLCD mbed

Fork of Embedded_Software_Assignment_2 by Steven Kay

Revision:
8:7f3594882cec
Parent:
7:2973bf297f3d
Child:
9:46408a8dea0c
--- a/main.cpp	Wed Mar 02 00:51:17 2016 +0000
+++ b/main.cpp	Wed Mar 02 01:03:09 2016 +0000
@@ -236,7 +236,7 @@
        stampTime.start();
     }
     
-    if(cyclicTicks % 80 == 0)
+    if(cyclicTicks % 84 == 0)
     {
         task5t.stop();
         printf("T5 %1.2f\r\n",task5t.read());
@@ -249,7 +249,7 @@
         task5t.start();                   
     }
     
-    if(cyclicTicks % 40 == 0)
+    if(cyclicTicks % 38 == 0)
     {
         task1t.stop();
         printf("T1 %d\r\n",task1t.read_ms());
@@ -280,27 +280,29 @@
         task4t.start();
     }
     
-    if(cyclicTicks & 13 == 0)
+    if(cyclicTicks % 6 == 0)
     {
-        printf("IM IN TASK 3!!!!!!!!!!!!!!!!!!!!!");
-        task3t.stop();
-        printf("T3 %d\r\n",task3t.read_ms());
-        task3.OutputWatchdogPulse();
-        taskNum = 2;
-        task3t.reset();
-        task3t.start();
+        if(taskNum == 2)
+        {
+//            printf("IM IN TASK 2!!!!!!!!!!!!!!!!!!!!!\r\n");
+            task2t.stop();
+            printf("T2 %d\r\n",task2t.read_ms());
+            task2SwitchState = task2_switch1.digitalInState();
+            taskNum = 3;
+            task2t.reset();
+            task2t.start();
+        }
+        else if(taskNum == 3)
+        {
+//            printf("IM IN TASK 3!!!!!!!!!!!!!!!!!!!!!\r\n");
+            task3t.stop();
+            printf("T3 %d\r\n",task3t.read_ms());
+            task3.OutputWatchdogPulse();
+            taskNum = 2;
+            task3t.reset();
+            task3t.start();
+        }
     }
-    
-    if(cyclicTicks % 12 == 0)
-    {
-        printf("IM IN TASK 2!!!!!!!!!!!!!!!!!!!!!");
-        task2t.stop();
-        printf("T2 %d\r\n",task2t.read_ms());
-        task2SwitchState = task2_switch1.digitalInState();
-        taskNum = 3;
-        task2t.reset();
-        task2t.start();
-    }    
 
     if(SDRemoval == HIGH)
     {