External Mode for a custom STF

4 次查看(过去 30 天)
Giorgi
Giorgi 2016-12-24
评论: Michael 2021-9-27
I'm trying to incorporate external mode for a custom target that I built. One of the files I include (ext_work.c) keeps giving me an error when I compile. This is just a snippet of the code that includes a full function:
void rtExtModePauseIfNeeded(RTWExtModeInfo *ei,
int_T numSampTimes,
boolean_T *stopReqPtr)
{
while((modelStatus == TARGET_STATUS_PAUSED) && !startModel && !(*stopReqPtr)) {
rt_ExtModeSleep(0L, 375000L);
rt_PktServerWork(ei,numSampTimes,stopReqPtr);
#ifndef EXTMODE_DISABLESIGNALMONITORING
rt_UploadServerWork(numSampTimes);
#endif
}
startModel = false; /* reset to false - if we were stepped we want to
* stop again next time we get
* back here.
*/
} /* end rtExtModePauseIfNeeded */
When I try to compile, I get the following error:
ext_work.c:127:8: error: expected identifier or '(' before '{' token
(line 127 refers to the 4th line of the sample code).
Can anyone help with what might be wrong?
Many thanks!
  1 个评论
Walter Roberson
Walter Roberson 2016-12-25
My suspicion is that the actual problem is just before that line, if it thinks that it is still inside a function definition.

请先登录,再进行评论。

回答(1 个)

John BG
John BG 2016-12-24
have you tried either
removing the ')' at the end of the previous line pointed by the error, the line ending with boolean_T *stopReqPtr
pairing the ')' of line boolean_T *stopReqPtr) with '('
if you find these lines useful would you please mark my answer as Accepted Answer?
To any other reader, please if you find this answer of any help, click on the thumbs-up vote link,
thanks in advance for time and attention
John BG
  5 个评论
John BG
John BG 2017-1-4
ok, thanks for explaining
Michael
Michael 2021-9-27
@Giorgi Did you ever resolve this issue. We are facing a similar problem.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Simulation 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by