]> rtime.felk.cvut.cz Git - jenkicar/rpp-simulink.git/commitdiff
Revert "Spawn FreeRTOS scheduler before initializing the model"
authorMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 13 Sep 2013 14:35:06 +0000 (16:35 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 13 Sep 2013 14:35:06 +0000 (16:35 +0200)
This reverts commit 59b528e047a650b153181df204d969b6f77a29d3.

Issue #371.

Conflicts:
rpp/lib

rpp/rpp/rpp_srmain.tlc

index 42b410ef0bc355a718eac9cf92feab567f9572da..d34c452c0d9cb8b8ddba034ffde462d981d21855 100644 (file)
@@ -83,8 +83,6 @@
     %%%%%%%%
     %openfile tmpBuf
 
-    void working_task(void* p);
-
     /**
      * Model step control and overrun detection task.
      */
         static const portTickType freq_ticks = STEP_SIZE_MILLIS / portTICK_RATE_MS;
         portTickType last_wake_time = xTaskGetTickCount();
 
-        %if rppPrintMeta
-        %assign model_info = SPRINTF("'%s' - %s (TLC %s)\\r\\n", LibGetMdlPubHdrBaseName(), TLC_TIME, TLC_VERSION)
-        rpp_sci_printf((const char*)
-                "%<model_info>"
-            );
-        %endif
-
-        /* Initialize model */
-        %<LibCallModelInitialize()>\
-
-        if(xTaskCreate(working_task, (const signed char*)"working_task",
-            %<rppModelTaskStack>, NULL, WORKING_PRIORITY, NULL) != pdPASS) {
-            #ifdef DEBUG
-            rpp_sci_printf((const char*)
-                "ERROR: Cannot spawn model task.\r\n"
-            );
-            #endif
-            while(TRUE) {
-                asm(" nop");
-            }
-        }
-
         while(!SHUTDOWN) {
 
             /* Wait until next step */
         // Speed up the SCI
         rpp_sci_setup(115200);
 
+        %if rppPrintMeta
+        %assign model_info = SPRINTF("'%s' - %s (TLC %s)\\r\\n", LibGetMdlPubHdrBaseName(), TLC_TIME, TLC_VERSION)
+        rpp_sci_printf((const char*)
+                "%<model_info>"
+            );
+        %endif
+
+        /* Initialize model */
+        %<LibCallModelInitialize()>\
+
         /* Create and lock semaphore */
         vSemaphoreCreateBinary(step_signal);
         xSemaphoreTake(step_signal, 0);
                 asm("nop");
             }
         }
+        if(xTaskCreate(working_task, (const signed char*)"working_task",
+            %<rppModelTaskStack>, NULL, WORKING_PRIORITY, NULL) != pdPASS) {
+            #ifdef DEBUG
+            rpp_sci_printf((const char*)
+                "ERROR: Cannot spawn model task.\r\n"
+            );
+            #endif
+            while(TRUE) {
+                asm(" nop");
+            }
+        }
 
         /* Start FreeRTOS Scheduler */
         vTaskStartScheduler();