Shop OBEX P1 Docs P2 Docs Learn Events
Spin to C/C++ converter version 0.98 - Page 2 — Parallax Forums

Spin to C/C++ converter version 0.98

2»

Comments

  • ersmithersmith Posts: 5,914
    edited 2012-09-26 04:50
    Rsadeika wrote: »
    I just did a spin2cpp --ccode on IR_Remote.spin, a program by Tom Doyle, and it comes up with an error:
    "Unknown identifier used in function call" and lists waitpne, and waitpeq as the culprits. These are listed as legal commands in the manual, and it looks like they are being used correctly in the program. Any ideas?

    This is a bug in spin2cpp. It's missing the definitions for waitpne and waitpeq. It will be fixed in the next version.

    Thanks for the bug report!

    Eric
  • RsadeikaRsadeika Posts: 3,824
    edited 2012-09-26 12:45
    I just did a spin2cpp --ccode on XBee_Object_2.spin, by Martin Hebel. I am a little confused as to how to use the resulting .c, and .h files. In the .h file it has an #include <FullDuplexSerial.h> , when I compiled, it brought up an error. In the .c file it has things like FullDuplexSerial_start(), FullDuplexSerial_Tx(), ..., and so on. I am not sure as to how that should be handled since I have an extern _Driver _FullDuplexSerialDriver, and supporting code in a program. Since spin2cpp did not provide a FullDuplexSerial.c program, when I did the conversion on XBee_Oject_2.spin, I am assuming that you have to use the FullDuplexSerialDriver that now exits in PropGCC. This is very confusing, any extra help would be appreciated.

    Ray
  • Dave HeinDave Hein Posts: 6,347
    edited 2012-09-26 13:46
    When you did the "spin2cpp --ccode XBee_Object_2.spin" you must have had a copy of FullDuplexSerial.spin in the same directory, otherwise it would have failed. It should have generated FullDuplexSerial.c and FullDuplexSerial.h. If you are using pins 31 and 30 to talk to the XBee you should specify a null driver list so the standard C serial driver doesn't get loaded.
  • RsadeikaRsadeika Posts: 3,824
    edited 2012-09-26 14:12
    I just tried it again, when I do a "spin2cpp --elf --ccode -O XBee_Object_2.spin", I get the .c, and .h files, but no FullDuplexSerial.c file. So I am not sure what is going on here.

    Ray
  • ersmithersmith Posts: 5,914
    edited 2012-09-27 09:44
    Rsadeika wrote: »
    I just tried it again, when I do a "spin2cpp --elf --ccode -O XBee_Object_2.spin", I get the .c, and .h files, but no FullDuplexSerial.c file. So I am not sure what is going on here.

    I just tried "spin2cpp --ccode XBee_Object_2.spin" and got both XBee_Object_2.c and FullDuplexSerial.c. Trying "spin2cpp --elf --ccode -O XBee_Object_2.spin" gets an error (default method of XBee_Object_2 expects parameters) which is expected because XBee_Object_2.spin isn't a stand-alone program.
Sign In or Register to comment.