Skip to content

Commit

Permalink
Add default clock period to C runtime, ticket:3752
Browse files Browse the repository at this point in the history
  • Loading branch information
rfranke committed Apr 10, 2016
1 parent 0182b27 commit 4832d7a
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions Compiler/Template/CodegenC.tpl
Expand Up @@ -340,10 +340,19 @@ match baseClock
>>
else
let &preExp = buffer ""
let intvl = daeExp(getClockInterval(baseClock), contextOther, &preExp, &varDecls, &auxFunction)
let intvl = match baseClock
case REAL_CLOCK()
case INTEGER_CLOCK()
case BOOLEAN_CLOCK() then
daeExp(getClockInterval(baseClock), contextOther, &preExp, &varDecls, &auxFunction)
else "unspecified"
let interval = match intvl case "unspecified" then '1.0' else intvl
let warning = match intvl case "unspecified" then
'ModelicaMessage("Using default Clock(1.0)!");'
<<
<%preExp%>
data->simulationInfo->clocksData[i].interval = <%intvl%>;
data->simulationInfo->clocksData[i].interval = <%interval%>;
<%warning%>
>>
end updatePartition;

Expand Down

0 comments on commit 4832d7a

Please sign in to comment.