Several errors when trying to build test
Looks like a great and useful project! Thank you!
When I try to build HID_TEST_SIMPLE I get numerous errors: this operator is not allowed in a constant expression function call is not allowed in a constant expression syntax error: identifier 'HID_DATA2'
There are also several warnings like: not enough arguments for function-like macro invocation 'HID_USAGE_PAGE2' not enough arguments for function-like macro invocation 'HID_USAGE2'
Digging a bit, I get to a use of a GLOBAL constant, but it is not defined. Is it supposed to be HID_TYPE_GLOBAL which is defined beforehand ?
Attaching a picture, thought maybe you'd have a quick solution
Thanks!!! Oded
My hunch (based on BYTE_ORDER macro) is that it works with GCC, but probably not from Visual Studio (I'm testing on 2017). Can you confirm? Thanks!
Of course, this project GCC-targeted for now, because many toolchains for embedded platforms is GCC-based too. But if you find way to get some macroses work with you preferred compiler it will be great and I would like to add support for that.
Thanks for confirming!
In the meantime I've continued without these macros. I hope to get back to them some time, but it's not pressing any more, so the odds are low to be honest.
Still a great project for anyone using gcc! Kodus!!
I changed endianness detection macros.
Now you can define HID_ENDIAN macro yourself with your target endian (like #define HID_ENDIAN HID_ENDIAN_LITTLE before including hid_def.h or using comand-line arguments of compiler).
Also I set it to little endian when msvc compiler is used with win32 platform.
And of course, I continue support automatic detection of endianness for gcc and clang.
Thanks Katyo for this addition. Unfortunately it still doesn't compile on Visual Studio. I guess it needs more testing/dev on VS until everything is ironed out. I apologize I don't have the bandwidth to support this right now.
Thanks again for the project though, it seems very useful!