spin2cpp really works!!!, though I wonder....
Invent-O-Doc
Posts: 768
After playing around with Propeller C and Simple IDE for a few weeks now, I've finally converted an obex object to C++.
The first object that I converted was the PWM32 driver (mix of assembly and SPIN). I use C++ anyway instead of C because I
like to have multiple class object instances and like addressing attributes of those objects. I did a couple of stock spin to C++ conversion
and things worked perfectly except for figuring out a bit of syntax and making the global variables into volatile ones.
Anyhow, I've got two questions about spin2cpp:
1) Should this be included as a feature in Simple IDE?
It seems to work pretty well, why not?
2) Can we make it so it defaults to adding the 'volatile' statement for globally declared variables (outside a function)???
I know that they have it so volatiles are added manually to make optimization more efficient, but having it to default to volatiles included would make more objects convert without human intervention.
Thoughts?
The first object that I converted was the PWM32 driver (mix of assembly and SPIN). I use C++ anyway instead of C because I
like to have multiple class object instances and like addressing attributes of those objects. I did a couple of stock spin to C++ conversion
and things worked perfectly except for figuring out a bit of syntax and making the global variables into volatile ones.
Anyhow, I've got two questions about spin2cpp:
1) Should this be included as a feature in Simple IDE?
It seems to work pretty well, why not?
2) Can we make it so it defaults to adding the 'volatile' statement for globally declared variables (outside a function)???
I know that they have it so volatiles are added manually to make optimization more efficient, but having it to default to volatiles included would make more objects convert without human intervention.
Thoughts?
Comments
I agree: spin2cpp is a great tool. Just be aware that if you try to convert PWM32's PASM code to GAS you'll need to fix all the relative addressing.