You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am having an issue with the build flags when trying to configure the USB descriptors for the Teensy 3.1 board. Specifically I want to access the HID Keyboard/Mouse/Joystick functionality included in the Teensy libraries. These are contained within a preprocessor #if/#elif/#elif block determined by which value is defined during the compiler invocation. E.g.
#if defined(USB_SERIAL)
<Setupo as CDC serial device>
#elif defined(USB_HID)
<Setup as HID keyboard/mouse/joystick>
#endif
For the Teensy framework, you have defined USB_SERIAL within the teensy base platform and this is passed to the compiler during the run command. As per the platformio instructions to use build_flags rather than create new platforms, I tried using the following platformio.ini setup.
With the intent to un-define the included USB_SERIAL value and define USB_HID to enable that portion of the USB code. The problem I have encountered is the order which the build_flags are passed to the compiler. The above configuration fails to compile (due to undeclared functions which are declared within the USB_HID conditional code block). The console output after platformio run is:
The '-UUSB_SERAL' option I declared is passed before the platform inherent '-DUSB_SERIAL' option, and as such does not clear it. I have not found a way to alter this order and this is preventing me from clearing the value and compiling my code. Note: If I manually rearrange the flags so the -U command follows, it will successfully compile as expected.
Should the platformio.ini build flags be passed last to rectify this issue?
Thanks for the great work so far!
-Patrick
The text was updated successfully, but these errors were encountered:
Hermiedapwdrman
changed the title
Confusing order for passing the platformio.ini build_flags are passed to respective toolchains?
Confusing order in which the platformio.ini build_flags are passed to respective toolchains?
May 5, 2015
PlatformIO passes all build_flags to Scons env.MergeFlags(flags). Looks like it doesn't support -U name option. I will contact with Scons developers and discuss it. If they say that env.MergeFlags doesn't parse -U, then I will implement own mechanism for this option.
Hello,
I am having an issue with the build flags when trying to configure the USB descriptors for the Teensy 3.1 board. Specifically I want to access the HID Keyboard/Mouse/Joystick functionality included in the Teensy libraries. These are contained within a preprocessor #if/#elif/#elif block determined by which value is defined during the compiler invocation. E.g.
For the Teensy framework, you have defined USB_SERIAL within the teensy base platform and this is passed to the compiler during the run command. As per the platformio instructions to use build_flags rather than create new platforms, I tried using the following platformio.ini setup.
With the intent to un-define the included USB_SERIAL value and define USB_HID to enable that portion of the USB code. The problem I have encountered is the order which the build_flags are passed to the compiler. The above configuration fails to compile (due to undeclared functions which are declared within the USB_HID conditional code block). The console output after platformio run is:
The '-UUSB_SERAL' option I declared is passed before the platform inherent '-DUSB_SERIAL' option, and as such does not clear it. I have not found a way to alter this order and this is preventing me from clearing the value and compiling my code. Note: If I manually rearrange the flags so the -U command follows, it will successfully compile as expected.
Should the platformio.ini build flags be passed last to rectify this issue?
Thanks for the great work so far!
-Patrick
The text was updated successfully, but these errors were encountered: