Page 1 of 1

Issue using <stdlib.h> in CrazyFlie Custom-Deck Driver

Posted: Wed Oct 19, 2016 10:02 am
by flo
Hi,

I'm currently writing a custom deck-driver to implement some rudimentary collision-avoidance on CrazyFlie using SiliconRadar's Radar-Sensor PCB v2.

I have already written another deck driver before to drive a prototype of a motion-flow sensor for indoor position hold. I found it very simple to get started with the CrazyFlie VM , and got that first deck-driver quickly implemented. So thanks for that! :)

Unfortunately, I do now have some issue, which I do not quite understand.

I've created a siliconradar.h and siliconradar.c file, the .h file includes the <stdlib.h>, and the c. files includes the siliconradar.h file...

When I'm trying to parse a hex-value from a string using strol(), I do get a compiler-error, which outputs an implicit declaration of the strol() function.

If I click on <stdlib.h> and select "Open Delclaration" it references to an pretty much empty stdlib.h file:

Code: Select all

#ifndef _MACHSTDLIB_H_
#define _MACHSTDLIB_H_

/* place holder so platforms may add stdlib.h extensions */

#endif /*_MACHSTDLIB_H_*/
Maybe you have some idea? I'm not really that used to Eclipse + GCC, so any hint is very appreciated :D
Thank you!

Florian

Re: Issue using <stdlib.h> in CrazyFlie Custom-Deck Driver

Posted: Thu Oct 20, 2016 11:10 am
by arnaud
Hi Florian,

The Crazyflie is compiled against newlib so this function should exists, though it is very possible that our configuration of Eclipse get confused when it comes to system header.

Do you mean strtol() instead of "strol()" ? just tested and strtol passes the compilation (I have not tested it though).

/Arnaud

Re: Issue using <stdlib.h> in CrazyFlie Custom-Deck Driver

Posted: Thu Oct 20, 2016 1:39 pm
by flo
Hi Arnaud,

yes off course strtol()... shame on me. Now it's working as supposed. Sorry for that!

Thanks for trying/checking!

Florian