Moving Common function to a new file

4 replies [Last post]
brada
Title: NooBot
Joined: 03/23/2012
Posts:
BotPoints: 36
User offline. Last seen 8 years 24 weeks ago.

We are trying to move our common functions into common files to use with each robot.

Last year we created a header file to include in the other files. Under Kiss 4.0.5, we get an error "failed to extract KISS Archive".

How do you do multiple file compiles under KISS 4?

Thanks
Brad August

Brad A.
Team 13-0624
Fairfield, IL

Marty Rand
Marty Rand's picture
Title: Botball Youth Advisory Council
Joined: 07/04/2009
Posts:
BotPoints: 253
User offline. Last seen 8 years 6 weeks ago.

I don't know about KISS IDE, but we have compiled libraries on the Link. You may still have to put:

  1. #include "/kovan/media/sda1/**insert path to file on flash drive here** "

instead of just:

  1. #include " **insert path to file on flash drive here** "

I don't know if KIPR ever fixed that.

Try the top one and compile it from a flash drive on the Link.

NOTE: That will not ONLY compile on the Link. Not KISS IDE. You should get an error in KISS IDE saying that the file wasn't found.

-Marty Rand
{
Senior programmer at Norman Advanced Robotics

Former senior programmer at Whittier Middle School

Youth Advisory Council

All around nerd
}

Marty Rand
Marty Rand's picture
Title: Botball Youth Advisory Council
Joined: 07/04/2009
Posts:
BotPoints: 253
User offline. Last seen 8 years 6 weeks ago.

Now that I think of it you could put:

  1. #ifdef __arm__
  2. #include "/kovan/media/sda1/**insert path to file on flash drive here** "
  3. #else
  4. #include " **insert path to file on flash drive here** "
  5. #endif

That should work on both. This code is untested so it may have a bug.

-Marty Rand
{
Senior programmer at Norman Advanced Robotics

Former senior programmer at Whittier Middle School

Youth Advisory Council

All around nerd
}

brada
Title: NooBot
Joined: 03/23/2012
Posts:
BotPoints: 36
User offline. Last seen 8 years 24 weeks ago.

Just wanted to add to the thread what we finally got working for compiling Library functions

this is what our team discovered after talking to someone from Kipr.

If you are compiling with with a usb or wifi target. Not sure about using a flash drive

  1. put all functions and prototypes in a ".h" file
  2. Compile the ".h" file to the with the usb/wifi
  3. The compile should complete with a message of "error: No terminals detected from compilation".
  4. include the ".h" file with a #include "file.h" directive in your C program
  5. Now compile the ".c" file

Hope this helps others

Brad A.
Team 13-0624
Fairfield, IL

Bryce
Title: NooBot
Joined: 05/02/2013
Posts:
BotPoints: 5
User offline. Last seen 9 years 20 weeks ago.

In previous versions the .c file could work. Thank you so very much.