Hello,
I'm trying to integrate C-code into MATLAB Simulink. This code, along with the other components of the Simulink project, are being auto-code generated and sent to CCS v3.3. I have code that accesses an RDC's position and velocity registers, but unfortunately, I had to directly manipulate GPIO registers instead of going through the TI bit-structure for GPIO. My code is not readable to the untrained eye, but it works. I'd like to move back to using the TI bit-structure in these Simulink blocks, but I am running into problems when I #include "DSP2833x_Device.h". At first, MATLAB tells me that it can't find all the other files called by the DSP2833x_Device.h file; these problems go away after I move all DSP2833x header files to my current Matlab folder. Then, the next set of problems seem to be correlated to how the TI header files are written in contrast to how MATLAB but compile/interpret them.
Here are my errors:
Error RDCRead.c: .\DSP2833x_Device.h: 36 syntax error; found `volatile' expecting `;'
Error RDCRead.c: .\DSP2833x_Device.h: 37 syntax error; found `volatile' expecting `;'
Error RDCRead.c: .\DSP2833x_PieVect.h: 28 syntax error; found `void' expecting `;'
Error RDCRead.c: .\DSP2833x_PieVect.h: 37 invalid struct field declarations
Error RDCRead.c: .\DSP2833x_PieVect.h: 37 syntax error; found `PINT' expecting `}'
Error RDCRead.c: .\DSP2833x_PieVect.h: 37 skipping `PINT' `PIE1_RESERVED'
Error RDCRead.c: .\DSP2833x_PieVect.h: 38 redeclaration of `PINT' previously declared at .\DSP2833x_PieVect.h 28
Error RDCRead.c: .\DSP2833x_PieVect.h: 38 syntax error; found `PIE2_RESERVED' expecting `;'
...
Error RDCRead.c: .\DSP2833x_PieVect.h: 53 too many errors
Here are my questions:
1) Has anyone ever successfully integrated GPIO bit-strucutre code into an S-function block or the Legacy Code Tool?
2) Does anyone know why MATLAB might think that these are errors when the files were provided by TI in the first place? Shouldn't this integration just "work"?
3) Does anyone have any ideas for work arounds for this problem?
Thanks for the help!