From: Michal Sojka Date: Thu, 27 Aug 2015 09:15:21 +0000 (+0200) Subject: Remove possibility of undetected overruns X-Git-Tag: eaton-0.6~15 X-Git-Url: http://rtime.felk.cvut.cz/gitweb/jenkicar/rpp-simulink.git/commitdiff_plain/690137665086c19f9ef0cbe5cbb6c57b0d163be7 Remove possibility of undetected overruns 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. --- diff --git a/rpp/blocks/tlc_c/sfunction_tror.tlc b/rpp/blocks/tlc_c/sfunction_tror.tlc index 412165a..4f7241d 100644 --- a/rpp/blocks/tlc_c/sfunction_tror.tlc +++ b/rpp/blocks/tlc_c/sfunction_tror.tlc @@ -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 @@ % if (overrun_flag) { + overrun_flag = FALSE; %% Call a function subsystem %foreach callIdx = NumSFcnSysOutputCalls %if LibIsEqual(SFcnSystemOutputCall[callIdx].BlockToCall,"unconnected") diff --git a/rpp/rpp/rpp_mrmain.tlc b/rpp/rpp/rpp_mrmain.tlc index c93e9f4..b6b5e56 100644 --- a/rpp/rpp/rpp_mrmain.tlc +++ b/rpp/rpp/rpp_mrmain.tlc @@ -171,9 +171,6 @@ 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) ; diff --git a/rpp/rpp/rpp_srmain.tlc b/rpp/rpp/rpp_srmain.tlc index 9f61acb..5491f84 100644 --- a/rpp/rpp/rpp_srmain.tlc +++ b/rpp/rpp/rpp_srmain.tlc @@ -124,7 +124,6 @@ /* Overrun detected */ overrun_flag = TRUE; } else { - overrun_flag = FALSE; /* Release semaphore */ xSemaphoreGive(step_signal); }