This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
I know this problem has been posted before, but I still don't know how to fix it.
I'm declaring the following in my proj_lab13b_test.c file
struct ECAN_REGS EcanaShadow;
volatile struct ECAN_REGS EcanaRegs;
and when I try to compile the project, before trying to include the ecan.h file, which is where the ECAN_REGS structure is defined, I get the following message
Description Resource Path Location Type
#237 variable "EcanaRegs" was declared with a never-completed type proj_lab13b_test.c /proj_lab13b_test line 80 C/C++ Problem.
I don't understand what this means, nor do I understand why this declaration isn't found, as the ecan.c file is in the Includes file structure in the project tree.
I then tried to #include ecan.c in this file (tried <ecan.c> and "ecan.c" for the include) and that's when I got the "#1965 cannot open source file "ecan.h" message.
I'm a bit stuck now, not knowing what to do next, so I hope someone can help
Thanks
You have to include something like: #include "sw/drivers/can/src/32b/f28x/f2806x/ecan.h" into your proj_lab13b_test.c
But it's not a good idea to have those hardware related stuff in the main program. It belongs to DRV or IFACE stuff if you follow the software architecture.
Thanks for the advice, which does fix the problem.
As you said it would be better to create an ecan.c file ( which currently isn't provided as part of the motorware files I believe) and do the setup of this peripheral in that.
That would follow the overall structure better, so I'll try doing that rather than it going in the main file.