added second_usb_serial_enable config option
authorLogxen <logxen@hotmail.com>
Thu, 14 Feb 2013 08:26:16 +0000 (00:26 -0800)
committerLogxen <logxen@hotmail.com>
Thu, 14 Feb 2013 08:26:16 +0000 (00:26 -0800)
ConfigSamples/Smoothieboard/config
src/main.cpp

index 0fe1513..4e21583 100644 (file)
@@ -41,7 +41,8 @@ gamma_current                                1.5              # Z stepper motor
 z_axis_max_speed                             300              # mm/min
 
 # Serial communications configuration ( baud rate default to 9600 if undefined )
-uart0.baud_rate                              115200           # Baud rate for the default serial port
+uart0.baud_rate                              115200           # Baud rate for the default hardware serial port
+second_usb_serial_enable                     false            # This enables a second usb serial port (to have both pronterface and a terminal connected)
 
 # Extruder module configuration
 extruder_module_enable                       true             # Whether to activate the extruder module at all. All configuration is ignored if false
index 2ca4b44..2db44a2 100644 (file)
@@ -34,6 +34,8 @@
 
 #include "libs/Watchdog.h"
 
+#define second_usb_serial_enable_checksum  CHECKSUM("second_usb_serial_enable")
+
 // Watchdog wd(5000000, WDT_MRI);
 
 // #include "libs/USBCDCMSC/USBCDCMSC.h"
@@ -47,7 +49,6 @@ USB u;
 USBSerial usbserial(&u);
 USBMSD msc(&u, &sd);
 DFU dfu(&u);
-//USBSerial usbserial2(&u);
 
 SDFAT mounter("sd", &sd);
 
@@ -117,7 +118,9 @@ int main() {
 
     kernel->add_module( &msc );
     kernel->add_module( &usbserial );
-//    kernel->add_module( &usbserial2 );
+    if( kernel->config->value( second_usb_serial_enable_checksum )->by_default(false)->as_bool() ){
+        kernel->add_module( new USBSerial(&u) );
+    }
     kernel->add_module( &dfu );
     kernel->add_module( &u );