]> rtime.felk.cvut.cz Git - jenkicar/rpp-simulink.git/blobdiff - rpp/rpp/rpp_srmain.tlc
demo: Uncheck "Download to RPP"
[jenkicar/rpp-simulink.git] / rpp / rpp / rpp_srmain.tlc
index 93051f608c315d146619f7d0fefc5955c6d7cb85..5491f846af1ad57bc18411a192769acf17d61de2 100644 (file)
@@ -1,4 +1,4 @@
-%% Copyright (C) 2013-2014 Czech Technical University in Prague
+%% Copyright (C) 2013-2015 Czech Technical University in Prague
 %%
 %% Authors:
 %%     - Carlos Jenkins <carlos@jenkins.co.cr>
@@ -59,7 +59,7 @@
     %openfile tmpBuf
 
     /* Definitions */
-    #define STEP_SIZE_MILLIS %<CompiledModel.FundamentalStepSize>*1000.0
+    #define STEP_SIZE_MILLIS (%<CompiledModel.FundamentalStepSize>*1000.0)
     #define CONTROL_PRIORITY 3
     #define WORKING_PRIORITY 2
     #define EXTMODE_PRIORITY 1
                 /* Overrun detected */
                 overrun_flag = TRUE;
             } else {
-                overrun_flag = FALSE;
                 /* Release semaphore */
                 xSemaphoreGive(step_signal);
             }
     {
         /* Initialize model */
         %<LibCallModelInitialize()>\
-
+        /* Step the model for any subrate */
         xSemaphoreGive(initialized_signal);
 
         while (1) {
-
-            /* Lock semaphore */
             if (xSemaphoreTake(step_signal, portMAX_DELAY)) {
                 working = TRUE;
                 %<LibCallModelStep(0)>\
         %if EXISTS(::rpp_ain_present)
             rpp_adc_init();
         %endif
-        %if EXISTS(::rpp_din_present) || EXISTS(::rpp_dout_present)
+        %if EXISTS(::rpp_aout_present)
+            rpp_dac_init();
+        %endif
+        %if EXISTS(::rpp_din_present)
+            rpp_din_init();
+        %endif
+        %if EXISTS(::rpp_hbr_present)
+            rpp_hbr_init();
+        %endif
+        %if EXISTS(::rpp_irc_present)
+            rpp_irc_init();
+        %endif
+        %if EXISTS(::rpp_lout_present)
+            rpp_lout_init();
+        %endif
+        %if EXISTS(::rpp_mout_present)
+            rpp_mout_init();
+        %endif
+        %if EXISTS(::rpp_sdr_present)
+            rpp_sdr_init();
+        %endif
+        %if EXISTS(::rpp_gio_in_present) || EXISTS(::rpp_gio_out_present)
             rpp_gio_init(RPP_GIO_PORT_ALL);
         %endif
         rpp_sci_init();