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

Firmware/software/electronics/mechanics
Post Reply
flo
Beginner
Posts: 5
Joined: Wed Oct 19, 2016 9:09 am

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

Post 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
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

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

Post 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
flo
Beginner
Posts: 5
Joined: Wed Oct 19, 2016 9:09 am

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

Post 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
Post Reply