]> rtime.felk.cvut.cz Git - jenkicar/rpp-simulink.git/commitdiff
Initialization of extmode moved from main to extmode thread
authorJakub NejedlĂ˝ <nejedjak@fel.cvut.cz>
Wed, 28 Aug 2019 07:29:34 +0000 (09:29 +0200)
committerMichal Sojka <michal.sojka@cvut.cz>
Sun, 8 Sep 2019 23:57:48 +0000 (01:57 +0200)
Function rtParseArgsForExtMode() call LwIP thread when opening
TCP/IP connection. That causes fault if is initialization called
before starting scheduler. Problem is solved by moving initialization
of communication to extmode thread.

rpp/rpp/rpp_mrmain.tlc

index cd3585e660f3861d12b42436a2a50ec09dfce86d..ba40052b662261a668ee55c287b7504fccd3b9ad 100644 (file)
         void ext_mode_comm_task(void* p)
         {
             drv_sci_set_crlf_conv_en(FALSE); /* Disable CR->CRLF conversion */
+            rtParseArgsForExtMode(0, NULL);
 
             %<SLibGenERTExtModeInit()>
             xSemaphoreGive(ext_mode_ready);
 
         %if extMode == 1
           /* External mode */
-          rtParseArgsForExtMode(0, NULL);
 
           if (xTaskCreate(ext_mode_comm_task, "ext_mode_comm_task", 1024, NULL, EXTMODE_PRIORITY, NULL) != pdPASS) {
             rpp_sci_printk("ERROR: Cannot spawn model task.\r\n");