- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have created a function named "keypad". then I have placed the function in a header file called "keypad.h".
then I have used the keypad function all over the different ISRs. when I build the project I get this error:
Build error: multiple definition of `keypad'
I am quite sure that it is only defined once. so what is the problem?
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Maybe Bob can answer this but should not the f() be declared external
in other file usage ?
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you please post your project or at least the keypad.h and .c files.
Did you use the #ifndef-scheme in your .h -file
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
here is the project:
https://drive.google.com/file/d/0BwvX4pp-M0Kyb0FaUU5wRHVqZms/edit?usp=sharing
it is a simple keypad component, I have tried putting everything in main.c and it works flawlessly. the problem occured when I divided it among different sources.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@mahmoud
There is a function in creator named "Create workspace Bundle" which will create a .zip-file that you can attach here with your post when using internet explorer (chrome does NOT work).
I cannot download the folder using your provided link.
I am not interested in a working solution, but to see what the error is you have got.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Right, sorry here it is.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
or not?
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If all fails send to my email j.meier<at>jmeiersoftware.de
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
reuploading
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In the header file, just keep the definition of the function) e.g.
int funcname(int param);
and the define the body of the function in a .c file, e.g.
int funcname(int param) { return param*2; }
The you include the .h file whenever needed (just make sure to include it only once always).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I know this is a little late but thanks for everyone (especially Bob). I am really gratefull for your replies and the problem is solved.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are always welcome! Even when late
Bob