]> 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 79729e884357378ac65dd9988ad711bb11e13361..5491f846af1ad57bc18411a192769acf17d61de2 100644 (file)
@@ -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);
             }
      */
     void working_task(void* p)
     {
-      %if LibNumSynchronousSampleTimes() > 1
-        static  int_T taskCounter[%<FcnNumST()>] = %<FcnInitializeTaskCounter()>;
-      %endif
-
         /* Initialize model */
         %<LibCallModelInitialize()>\
         /* Step the model for any subrate */
         while (1) {
             if (xSemaphoreTake(step_signal, portMAX_DELAY)) {
                 working = TRUE;
-
                 %<LibCallModelStep(0)>\
-
-                %if LibNumSynchronousSampleTimes() > 1
-                  %foreach idx = LibGetNumSyncPeriodicTasks() - 1
-                    %assign tid = 1 + idx + tid01Eq
-                    /* Task %<tid> handling */
-                    if (taskCounter[%<tid>] == 0) {
-                      %<LibCallModelStep(tid)>\
-                    }
-                    if (++taskCounter[%<tid>] == %< FcnComputeTaskTickLimit(tid)>)
-                      taskCounter[%<tid>]=0;
-                  %endforeach
-                %endif
-                       steps_working++;
-                       working = FALSE;
-                       }
+                steps_working++;
+                working = FALSE;
+            }
         }
 
        %% /* In case of shutdown, delete this task */
         %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();