Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Help needed for project defines for Teensy 3.1 serial + keyboard + mouse + joystck (Read 5497 times)
tristan
Newbies
*
Offline


Posts: 3
Joined: May 24th, 2014
Help needed for project defines for Teensy 3.1 serial + keyboard + mouse + joystck
May 25th, 2014 at 7:43pm
Print Post  
Hi,

I'm using Visual Micro with Visual Studio and a Teensy 3.1. I've managed to get it generally working using the guidelines for Teensy for Microsoft Visual Studio http://www.visualmicro.com/page/Teensy-for-Microsoft-Visual-Studio.aspx.

However I have been unable to find the correct "Defines - Project" settings to setup the Teensy as a serial + keyboard + mouse + joystck device (like I am able to do using Teensyduino). The help page states that "these standard Teensy defines can be found in the boards.txt file".

I found a define USB_SERIAL_HID however when I run with this define, the Teensy doesn't show up as a standard HID device in the Windows Game Controllers Control Panel Applet. When I compile the same sketch in Teensyduino with the USB type set to serial + keyboard + mouse + joystck it all works as expected.

I would be extremely grateful if someone could offer help on the correct project defines to use so that the teensy will show up as a hid device when compiling with Visual Micro.

Many thanks,

Tristan
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Help needed for project defines for Teensy 3.1 serial + keyboard + mouse + joystck
Reply #1 - May 25th, 2014 at 8:29pm
Print Post  
Hi,

Yes -DUSB_SERIAL_HID -DLAYOUT_US_ENGLISH should work as far as I can tell.

To confirm what both teensyduino and visual micro are doing you can switch on verbose compile.

In teensyduino file>preference>compiler verbose + upload verbose.
In Visual micro tools>options>vsiaul micro>compiler>verbose

The compile and upload with teensyduino and visual micro.

If you can see the difference then email the output to info[at]visualmicro.com

Thanks
  
Back to top
IP Logged
 
tristan
Newbies
*
Offline


Posts: 3
Joined: May 24th, 2014
Re: Help needed for project defines for Teensy 3.1 serial + keyboard + mouse + joystck
Reply #2 - May 25th, 2014 at 10:24pm
Print Post  
Hi Tim, thank you for your quick reply!

Your advice re comparing the two compiler outputs really helped.

Setting the project defines as F_CPU=96000000;USB_SERIAL_HID;LAYOUT_US_ENGLISH did in fact work but helped me uncover the issue as to why the project was not building in Visual Studio.

Comparing the two compiler outputs I noticed that none of the .c files in Arduino\hardware\teensy\cores\teensy3 seem to be compiled when compiling with Visual Studio whereas they are when compiling with Teensyduino.

As a temporary hack renaming usb_joystick.c to usb_joystick.cpp got my project compiling correctly, but if you have any insight into why the *.c files aren't compiled when using Visual Micro + Visual Studio I'd be keen to know.
  
Back to top
 
IP Logged
 
stevech
Member
***
Offline


Posts: 147
Location: So. Calif. US
Joined: Jun 16th, 2013
Re: Help needed for project defines for Teensy 3.1 serial + keyboard + mouse + joystck
Reply #3 - May 26th, 2014 at 6:49am
Print Post  
For the Teensy3 I put those three -D items into the teensy-specific boards.txt file- as per Tim's idea. One for T3.0 and one for T3.1. (I no longer use Teensy2/AVR).

Wow. that works and I don't have to juggle the project properties any longer as I change target boards.

The specifics on doing this are on this site's forum, in a prior posting dialog between Time and me.
And on PJRC's forum.

« Last Edit: May 26th, 2014 at 6:51am by stevech »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Help needed for project defines for Teensy 3.1 serial + keyboard + mouse + joystck
Reply #4 - May 26th, 2014 at 5:01pm
Print Post  
Hi tristan,

The .c files should be included in the compile. Please click "Build>Clean Solution" then run a compile and email the resulting output.

Thanks
  
Back to top
IP Logged
 
tristan
Newbies
*
Offline


Posts: 3
Joined: May 24th, 2014
Re: Help needed for project defines for Teensy 3.1 serial + keyboard + mouse + joystck
Reply #5 - May 27th, 2014 at 1:36am
Print Post  
Hi Tim,

Thanks for you continued support, much appreciated.

I just fired up visual studio to grab the build output and the issue I was experiencing is no longer happening, the compiler happily finds and compiles usb_joystick.c

So all a bit strange but everything's now working as expected.

If the issue occurs again I'll post the build output.

Thanks again,

Tristan

  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint