CLib

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
Request group membership
By: Dave Hein, created: 2010-04-02 | updated: 2013-05-02

 

CLib - Standard C library functions written in Spin. Contains string, formatted I/O and memory allocation routines such as strcpy, strcat, printf, scanf, malloc and free. Includes a serial I/O driver that allows multiple instances and multi-cog access. Also contains routines that convert between floating point and strings without additional floating point objects.
 
Version 1.0.1 fixes a bug in the memcpy and memfill routines. It also improves the efficiency of these routines when the byte count is around 200 or less.
 
Original File Upload
AttachmentSize
clib101.zip25.03 KB

Comments

[originally posted by Anonymous on 2011-10-25 21:15:00] A very useful function library! Thanks a lot.

I have tried many ways to get the strtofloat method to run.  I run it as a method in the cfloatstr.spin library from the OBEX. Nothing works, although I know I correctly pass the starting address for an array that holds ASCII characters for -12345.  The array ends with a $0 value (zero value, not ASCII 0). I always get 0 as an answer.  An example of how to use the strtofloat method with a real value would be appreciated. I don't see any dependencies in the code, but perhaps I need something else running to get the strtofloat method to work.  Thanks. --Jon