Calling coder.ceval with external variable as one of the arguments

2 次查看(过去 30 天)
I have a model with a MATLAB system block used for generating custom c-code. In my external C-code, I have a global variable called "buffer", which is an array of 8 bytes. In the step function I want to be able to copy a portion of the data from "buffer" to the output of the function (see below). Is there a way to declare the fact that "buffer" is an external variable?
function y = stepImpl(obj)
y = uint32(0)
if( coder.target('Rtw') )
coder.ceval('memcpy', coder.ref(y), coder.ref(buffer(2)), uint8(4))
end
end

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 External Code Integration 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by