I'm wondering what are the data type replacements for these parameters, which are used in Arduino C;
IMPORT uint32_t get_color(byte r, byte g, byte b)
How do you import this function:? :bed:
uint32_t Color(byte r, byte g, byte b) {
uint32_t c;
c = r;
c <<= 8;
c |= g;
c <<= 8;
c |= b;
return c;
}
Try...
IMPORT "C" int Color(char r, char g, char b)
untested though.
Oh, and remember your REQUIRE if your not using command line stuff/inlines.
byte is usually either signed or unsigned char
uint32_t is unsigned int
I could be wrong here but I think you are limited to the type of Types(:S) that IMPORT can use though? So, although these types are not ideal(you have to ignore the sign) I think they should still be usable with GLB.
I actually tried unsigned int and char and it compiles but it's when it get's called I get an error: :'(
undefined reference to `__GLBASIC__::Color(char, char, char)
Ouch, could you post your test code? :whistle:
BTW, I would just convert that little bit of code to inline or GLB syntax but you may be using this function as a template for a more complicated one I assume?
Alright I am using the ASL command now as it's really the only bitwise operation.