]> rtime.felk.cvut.cz Git - jenkicar/rpp-simulink.git/commitdiff
Remove possibility of undetected overruns
authorMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 27 Aug 2015 09:15:21 +0000 (11:15 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 28 Aug 2015 14:15:02 +0000 (16:15 +0200)
If control task clears the overrun flag, the overrun detection block may
not see it, because it can run at different rate in a working task.

This is now changed so that control task only sets the flag and only
overrun detection block clears it.

rpp/blocks/tlc_c/sfunction_tror.tlc
rpp/rpp/rpp_mrmain.tlc
rpp/rpp/rpp_srmain.tlc

index 412165a3c8b8163870045bdf94090f294b1eaaf7..4f7241d83c66a730b5da352faff5e8bd38b7e295 100644 (file)
@@ -1,4 +1,4 @@
-%% Copyright (C) 2013, 2014 Czech Technical University in Prague
+%% Copyright (C) 2013, 2014, 2015 Czech Technical University in Prague
 %%
 %% Authors:
 %%
@@ -49,6 +49,7 @@
         %<LibAddToCommonIncludes("rpp_simulink_runtime.h")>
 
         if (overrun_flag) {
+            overrun_flag = FALSE;
                        %% Call a function subsystem
                        %foreach callIdx = NumSFcnSysOutputCalls
                          %if LibIsEqual(SFcnSystemOutputCall[callIdx].BlockToCall,"unconnected")
index c93e9f4ba921430d8bebcfffc17cd0036cec1d1f..b6b5e56f206fbd77abc32dab44ffe791cfcf2931 100644 (file)
                         overrun_flag = TRUE;
                         break;
                     }
-                    else {
-                        overrun_flag = FALSE;
-                    }
                     if (xSemaphoreGive(sub_rate[i].sem) == pdFALSE) {
                         rpp_sci_printk("ERROR: Task %d semaphore 1 give.\n", i);
                         while (1) ;
index 9f61acb5cedcb8952500f8b8c1606977a663aeea..5491f846af1ad57bc18411a192769acf17d61de2 100644 (file)
                 /* Overrun detected */
                 overrun_flag = TRUE;
             } else {
-                overrun_flag = FALSE;
                 /* Release semaphore */
                 xSemaphoreGive(step_signal);
             }