GIU\ZF

Dependencies:   MCP23017 WattBob_TextLCD mbed-rtos mbed

Fork of rtos_basic by mbed official

Revision:
14:8a6c20435523
Parent:
13:ab52f46c98ab
Child:
15:524de2b2ef8e
--- a/tasks/task_group1.cpp	Tue Mar 27 15:56:27 2018 +0000
+++ b/tasks/task_group1.cpp	Tue Mar 27 16:11:18 2018 +0000
@@ -13,7 +13,7 @@
         
         const int const_delay = int((1000.0f/freq)+0.5f);
         int dynamic_delay = const_delay;
-        
+        int tick = 0;
         while(true){
             sleepTimer.stop();
             executionTimer.start();
@@ -28,15 +28,22 @@
             display::hotLoop();
             
             
+            tick++;
             executionTimer.stop();
             int exec_time = executionTimer.read_ms();
             
             #if DEBUG_MODE
             runTimeParams::liveAccess.lock();
-            //runTimeParams::debugLog += "GROUP_1," + to_string(executionTimer.read_ms()) + ","
-//                        + to_string(sleepTimer.read_ms()) + ", \n";
-            runTimeParams::odometer = float(sleepTime);
-            runTimeParams::avgSpeed = float(exec_time);
+            const int debug_log_interval = int(freq/dequeueMail::freq);
+            if (!(tick%debug_log_interval)){
+                runTimeParams::liveAccess.lock();
+                runTimeParams::debugLog += "task_group_1," + to_string(exec_time) + ","
+                            + to_string(sleepTime) + ","
+                            + to_string(drift) + "\n\r";
+                runTimeParams::liveAccess.unlock();
+                
+            }
+            if (tick==debug_log_interval*1) tick=0;
             runTimeParams::liveAccess.unlock();
             #endif