I have a lot of debugging outputs in my code, but the project is designed to mostly write to a data file. Does the Netduino know when the debugger is attached, and if so, does it ignore all debug.print() commands when no debugger is present?
Does the Netduino ignore Debug.Print() commands when the debugger isn't attached?
#1
Posted 27 February 2013 - 12:03 AM
#2
Posted 27 February 2013 - 02:18 AM
#3
Posted 27 February 2013 - 06:40 PM
Hi Verdris, Debug.Print will always send its output to the debug port. We typically place an #if block around Debug statements so that we can compile them out in production code. Chris
What's the syntax for #iffing out debug commands?
#4
Posted 28 February 2013 - 04:14 AM
What's the syntax for #iffing out debug commands?
http://msdn.microsof...9(v=vs.71).aspx
http://www.google.co...nal compilation
FWIW, without the conditional compilation, the debug command will still execute code and will still try to send stuff out through the USB port. But, without an active USB connection, I'm not sure how much of the code executes, verses a call, not connected - so return.
Basically, other than performance and code space, there's no harm in keeping the debug commands.
If you're concerned about a customer/person hooking up to the USB port, put a little "J-B Weld" epoxy in connector (don't let it get on the pins in back of the connector). That connector is now useless. However, you'd still have the option to solder wires to the pins. With J-B Weld, I doubt that connector would come off the board without taking some of the PCB with it. Of course, there are plenty of other options (different glue, remove the USB connector, etc). FWIW, removing the USB connector should be pretty simple with hot air. Note that putting surface mount devices on a PCB is much much harder than removing them.
Good Luck!
#5
Posted 28 February 2013 - 07:41 AM
What's the syntax for #iffing out debug commands?
In addition to what cutlass said, you can wrap Debug.Print() with your own method and decorate it with Conditional attribute, like shown here.
Also tagged with one or more of these keywords: debug, debug.print, debug.print()
Hardware →
Netduino Plus 2 (and Netduino Plus 1) →
ERROR CANT CONNECT TO NEDUINO PLUS 2Started by frisch928, 29 Aug 2014 NETDUINO PLUS 2, ERROR, debug and 2 more... |
|
|||
Programming Languages and Tools →
Visual Studio →
Using the USB for something other than a debug portStarted by ChuckZ, 14 Jan 2014 USB, debug |
|
|||
Hardware →
Netduino 2 (and Netduino 1) →
Debug.Print not always shown (in combination with Serial communication?)Started by bakerman, 10 Jan 2014 Debug, Print, Serial, GPRS |
|
|||
Hardware →
Netduino Plus 2 (and Netduino Plus 1) →
N+ 2 "hangs" after a while. How to debug?Started by Niels R., 03 Jul 2013 debug, debugging |
|
|||
Hardware →
Netduino Plus 2 (and Netduino Plus 1) →
Code only appears to execute when breakpoint is setStarted by j2inet, 04 Apr 2013 COM port, Event Handler, Debug |
|
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users