%%%%%%%%
%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();