reduce debug information sent via UART0
authorMichael Moon <triffid.hunter@gmail.com>
Thu, 20 Dec 2012 04:00:40 +0000 (15:00 +1100)
committerMichael Moon <triffid.hunter@gmail.com>
Wed, 2 Jan 2013 00:45:28 +0000 (11:45 +1100)
src/libs/Kernel.cpp
src/libs/USBDevice/USB.cpp
src/libs/USBDevice/USBMSD/USBMSD.cpp
src/libs/USBDevice/USBSerial/USBCDC.cpp
src/libs/USBDevice/USBSerial/USBSerial.cpp
src/main.cpp

index cd877e6..e00711e 100644 (file)
@@ -49,7 +49,7 @@ const ModuleCallback kernel_callback_functions[NUMBER_OF_DEFINED_EVENTS] = {
 Kernel::Kernel(){
     extern SerialConsole uart;
 
-    uart.printf("Kernel: ");
+//     uart.printf("Kernel: ");
 
     // Value init for the arrays
     for( uint8_t i=0; i<NUMBER_OF_DEFINED_EVENTS; i++ ){
@@ -58,12 +58,12 @@ Kernel::Kernel(){
         }
     }
 
-    uart.printf("\t[new Config]\n");
+//     uart.printf("\t[new Config]\n");
 
     // Config first, because we need the baud_rate setting before we start serial
     this->config         = new Config();
 
-    uart.printf("\t[new StreamOutputPool]\n");
+//     uart.printf("\t[new StreamOutputPool]\n");
 
     // Serial second, because the other modules might want to say something
     this->streams        = new StreamOutputPool();
@@ -88,23 +88,23 @@ Kernel::Kernel(){
 //     }
     this->serial = &uart;
 
-    uart.printf("\tADD config\n");
+//     uart.printf("\tADD config\n");
 
     this->add_module( this->config );
 
 //     __debugbreak();
 
-    uart.printf("\tADD serial\n");
+//     uart.printf("\tADD serial\n");
     this->add_module( this->serial );
 
     // HAL stuff
-    uart.printf("\tADD SlowTicker\n");
+//     uart.printf("\tADD SlowTicker\n");
     this->slow_ticker          = new SlowTicker();
-    uart.printf("\tADD StepTicker\n");
+//     uart.printf("\tADD StepTicker\n");
     this->step_ticker          = new StepTicker();
-    uart.printf("\tADD Adc\n");
+//     uart.printf("\tADD Adc\n");
     this->adc                  = new Adc();
-    uart.printf("\tADD Digipot\n");
+//     uart.printf("\tADD Digipot\n");
     this->digipot              = new Digipot();
 
     // LPC17xx-specific
@@ -142,20 +142,20 @@ Kernel::Kernel(){
 //     this->step_ticker->set_frequency(   base_stepping_frequency );
 
     // Core modules
-    uart.printf("\tADD GcodeDispatch\n");
+//     uart.printf("\tADD GcodeDispatch\n");
     this->add_module( this->gcode_dispatch = new GcodeDispatch() );
-    uart.printf("\tADD Robot\n");
+//     uart.printf("\tADD Robot\n");
     this->add_module( this->robot          = new Robot()         );
-    uart.printf("\tADD Stepper\n");
+//     uart.printf("\tADD Stepper\n");
     this->add_module( this->stepper        = new Stepper()       );
-    uart.printf("\tADD Planner\n");
+//     uart.printf("\tADD Planner\n");
     this->add_module( this->planner        = new Planner()       );
-    uart.printf("\tADD Player\n");
+//     uart.printf("\tADD Player\n");
     this->add_module( this->player         = new Player()        );
-    uart.printf("\tADD Pauser\n");
+//     uart.printf("\tADD Pauser\n");
     this->add_module( this->pauser         = new Pauser()        );
 
-    uart.printf("Kernel Complete!\n");
+//     uart.printf("Kernel Complete!\n");
 }
 
 void Kernel::add_module(Module* module){
index aaacb1c..208d2de 100644 (file)
@@ -5,6 +5,8 @@
 #include "descriptor_cdc.h"
 #include "descriptor_msc.h"
 
+#define iprintf(...) do { } while (0)
+
 usbdesc_base *USB::descriptors[N_DESCRIPTORS];
 
 usbdesc_device USB::device = {
index 437b792..9b9420d 100644 (file)
@@ -65,7 +65,8 @@
 // max packet size\r
 #define MAX_PACKET  MAX_PACKET_SIZE_EPBULK\r
 \r
-#define iprintf(...) kernel->streams->printf(__VA_ARGS__)\r
+// #define iprintf(...) kernel->streams->printf(__VA_ARGS__)\r
+#define iprintf(...) do { } while (0)\r
 \r
 // CSW Status\r
 enum Status {\r
index 4dcc7e1..d33f3f2 100644 (file)
@@ -23,6 +23,8 @@
 \r
 static uint8_t cdc_line_coding[7]= {0x80, 0x25, 0x00, 0x00, 0x00, 0x00, 0x08};\r
 \r
+#define iprintf(...) do { } while (0)\r
+\r
 // #define DEFAULT_CONFIGURATION (1)\r
 \r
 // #define CDC_SET_LINE_CODING        0x20\r
index a079346..6520196 100644 (file)
@@ -27,7 +27,7 @@
 // extern void setled(int, bool);\r
 #define setled(a, b) do {} while (0)\r
 \r
-// #define iprintf(...)\r
+#define iprintf(...) do { } while (0)\r
 \r
 USBSerial::USBSerial(USB *u): USBCDC(u), rxbuf(128), txbuf(128)\r
 {\r
index 1500b90..2d3836a 100644 (file)
@@ -65,15 +65,15 @@ int main() {
         leds[i] = (i & 1) ^ 1;
     }
 
-    uart.printf("Smoothie Start\n");
+//     uart.printf("Smoothie Start\n");
 
     sd.disk_initialize();
 
-    uart.printf("SD ok: %uMB\n", sd.disk_sectors() / 2048);
+//     uart.printf("SD ok: %uMB\n", sd.disk_sectors() / 2048);
 
     Kernel* kernel = new Kernel();
 
-    uart.printf("Kernel ok\n");
+//     uart.printf("Kernel ok\n");
 
     kernel->streams->printf("Smoothie ( grbl port ) version 0.7.0 \r\n");
 
@@ -121,7 +121,7 @@ int main() {
     kernel->add_module( &usbserial );
     kernel->add_module( &u );
 
-    kernel->streams->printf("start\r\n");
+//     kernel->streams->printf("start\r\n");
 
     struct SerialMessage message;
     message.message = "G90";