arpruss / USBComposite_stm32f1

USB Composite library for STM32F1 (HID, Serial, MIDI and XBox360 controller)
Other
382 stars 76 forks source link

Problem when compiling with new arduino ide #18

Closed michalelektryk closed 5 years ago

michalelektryk commented 5 years ago

No meter which example i try i get this error message:

static_assert(sizeof(JoystickReport_t)==13, "Wrong endianness/packing!");

arpruss commented 5 years ago

Can you delete the static assert line from the code (I think it's in USBHID.h), and see if the SimpleJoystick example works?

michalelektryk commented 5 years ago

After removing static_assert I've got even more mistakes: error: 'for' loop initial declarations are only allowed in C99 mode for (unsigned i = 0 ; i < numParts ; i++) {

arpruss commented 5 years ago

You're going to have a lot of trouble if your IDE is configured not to have C99 mode on by default. Are you using Roger's core?

michalelektryk commented 5 years ago

Yes, I'm using Rogers core with Arduino IDE 1.8.5

arpruss commented 5 years ago

Can you turn on C99 support?

michalelektryk commented 5 years ago

So i forced -std=c99 in compiler flags and i could get it to compile, i don't know why support isn't turned on by default. Thanks for your help and sorry for taking your time.