-
1. Re: Where does PSoC Creator expect to find function prototypes?
user_14586677 Sep 26, 2014 11:04 PM (in response to otto.hunt)Being a bit on the light side in C I put them before main() in
main.c
Maybe Bob can comment on this but I also think you can put them
in a .h file and #include that file before main() ?
Regards, Dana.
-
2. Re: Where does PSoC Creator expect to find function prototypes?
otto.hunt Sep 26, 2014 11:40 PM (in response to otto.hunt)That is where C expects to find prototype includes. PSoC Creator tells the compiler where to look for the included .h file which has to sit somewhere. Where?
-
3. Re: Where does PSoC Creator expect to find function prototypes?
user_1377889 Sep 27, 2014 12:13 AM (in response to otto.hunt)With freedom comes responsibility...
A .h-file (and a .c-file,too) can be put anywhere in windows file-system, even on a network drive. Creator remembers the place of the file, only the compiler has to be told where additionally to search for #included files.
When a new file is created for a project it is put into a default place regardless of its type. Best practice is to right click in workspace explorer on the file class (Header Files, Source Files etc) and under "New Item..." select the appropiate file type.
Although the workspace explorer shows something like a directory structure, this does not reflect the real world, it only shows containers Creator keeps for you.
Bob
-
4. Re: Where does PSoC Creator expect to find function prototypes?
user_1377889 Sep 27, 2014 12:28 AM (in response to otto.hunt)The CapSense prototypes are to be found in the container "Generated Files" and are physically a bit buried in the project's structure, but there is bo need to access any of them from the window's side, only from Creator.
Your error shows that the named function was not found. This error usually comes from different names used in schematic and main(). When a new component is placed, a "_n" where n is a number starting with 1, is appended to the name. This is done to allow placing multiple components of the same type. This name must match with the names of the APIs for the component, so it is quite common to change the component's name to something more appropiate.
Bob
-
5. Re: Where does PSoC Creator expect to find function prototypes?
otto.hunt Sep 27, 2014 7:43 AM (in response to otto.hunt)The compiler (or is it the IDE - I have not even compiled yet) is complaining about CapSense_CheckIsWidgetActive(). This complaint appeared even before I inserted a widget (pin) inside the partentheses. I'll fight the widget namng battle (if I must), when I get to it, which is not yet.
-
6. Re: Where does PSoC Creator expect to find function prototypes?
user_1377889 Sep 27, 2014 8:11 AM (in response to otto.hunt)When you haven't compiled yet, the component's files are not generated yet, so that will be one reason for the error hint in the IDE.
For more help, post your complete project here, so that we all can have a look at all of your settings. To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.Bob
-
7. Re: Where does PSoC Creator expect to find function prototypes?
otto.hunt Sep 27, 2014 8:56 AM (in response to otto.hunt)I got around that error by selecting the drop-down menu item which changed CapSense_CheckIsWidgetActive to CapSense_CSD_CheckIsWidgetActive (whatever CSD means). Same for the widget (pin) name. Now I have a similar problem setting the PWM duty cycle. This time the drop-down menu did not help me, but I did paste it in directly from the data sheet. So I archived and attached the project. For some reason it is missing (something).hex file, so it might not open as a project, but main.c is there.
-
8. Re: Where does PSoC Creator expect to find function prototypes?
user_1377889 Sep 27, 2014 9:29 AM (in response to otto.hunt)change #include <device.h> to #include <project.h>
your PWM is named LED_CONTROL, so change TCPWM_WriteCompare() to LED_CONTROL_WriteCompare()
Bob
-
9. Re: Where does PSoC Creator expect to find function prototypes?
otto.hunt Sep 27, 2014 1:15 PM (in response to otto.hunt)Thanks for your help, Bob. My project compiles now, and I learned a lot. Now I just need to get the buttons working, but I should start a separate thread for that. Until then, I am learning the debug functions PSoC Creator.
-
10. Re: Where does PSoC Creator expect to find function prototypes?
user_1377889 Sep 27, 2014 2:47 PM (in response to otto.hunt)Good idea!
See you in the next thread.
Bob