Skip to content

Commit 36d8f52

Browse files
authored
Add workaround to permit to take in input const signal in Simulink autogenerated code (#85)
1 parent dc9c91a commit 36d8f52

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

matlab/BlockFactory.tlc

+2-1
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,10 @@
202202
%endif
203203
%%assign width = LibBlockInputSignalWidth(i)
204204
%assign address = LibBlockInputSignalAddr(i, "", "", 0)
205+
// The const_cast is a workaround to solve https://github.com/robotology/blockfactory/issues/81
205206
blockInfo->setInputPort(
206207
{%<i>, {%<rows>, %<cols>}, blockfactory::core::Port::DataType::DOUBLE},
207-
static_cast<void*>(%<address>));
208+
const_cast<void*>(static_cast<const void*>(%<address>)));
208209
%endforeach
209210

210211
// Outputs

0 commit comments

Comments
 (0)