Browse Source

uart only in debug build

Thomas Buck 6 months ago
parent
commit
cda6c09cd2
5 changed files with 17 additions and 0 deletions
  1. 6
    0
      src/console.c
  2. 5
    0
      src/log.c
  3. 2
    0
      src/main.c
  4. 2
    0
      src/state_edit_workflow.c
  5. 2
    0
      src/state_workflow.c

+ 6
- 0
src/console.c View File

619
             }
619
             }
620
 
620
 
621
             usb_cdc_write((const uint8_t *)"\b \b", 3);
621
             usb_cdc_write((const uint8_t *)"\b \b", 3);
622
+
623
+#ifndef NDEBUG
622
             serial_write((const uint8_t *)"\b \b", 3);
624
             serial_write((const uint8_t *)"\b \b", 3);
625
+#endif
623
 
626
 
624
             // check for another backspace in this space
627
             // check for another backspace in this space
625
             i--;
628
             i--;
626
         } else {
629
         } else {
627
             usb_cdc_write((const uint8_t *)(cnsl_line_buff + i), 1);
630
             usb_cdc_write((const uint8_t *)(cnsl_line_buff + i), 1);
631
+
632
+#ifndef NDEBUG
628
             serial_write((const uint8_t *)(cnsl_line_buff + i), 1);
633
             serial_write((const uint8_t *)(cnsl_line_buff + i), 1);
634
+#endif
629
         }
635
         }
630
     }
636
     }
631
 
637
 

+ 5
- 0
src/log.c View File

62
 }
62
 }
63
 
63
 
64
 void log_dump_to_uart(void) {
64
 void log_dump_to_uart(void) {
65
+#ifndef NDEBUG
65
     log_dump_to_x(serial_write);
66
     log_dump_to_x(serial_write);
67
+#endif
66
 }
68
 }
67
 
69
 
68
 static void log_file_write_callback(const uint8_t *data, size_t len) {
70
 static void log_file_write_callback(const uint8_t *data, size_t len) {
100
     }
102
     }
101
     if ((l > 0) && (l <= (int)sizeof(line_buff))) {
103
     if ((l > 0) && (l <= (int)sizeof(line_buff))) {
102
         usb_cdc_write(line_buff, l);
104
         usb_cdc_write(line_buff, l);
105
+
106
+#ifndef NDEBUG
103
         serial_write(line_buff, l);
107
         serial_write(line_buff, l);
108
+#endif
104
 
109
 
105
         if (log) {
110
         if (log) {
106
             add_to_log(line_buff, l);
111
             add_to_log(line_buff, l);

+ 2
- 0
src/main.c View File

55
 
55
 
56
     // required for debug console
56
     // required for debug console
57
     cnsl_init();
57
     cnsl_init();
58
+#ifndef NDEBUG
58
     serial_init();
59
     serial_init();
60
+#endif
59
     usb_init();
61
     usb_init();
60
 
62
 
61
     debug("mem_init");
63
     debug("mem_init");

+ 2
- 0
src/state_edit_workflow.c View File

16
  * See <http://www.gnu.org/licenses/>.
16
  * See <http://www.gnu.org/licenses/>.
17
  */
17
  */
18
 
18
 
19
+// TODO adding and removing whole steps
20
+
19
 #include <stdio.h>
21
 #include <stdio.h>
20
 #include <string.h>
22
 #include <string.h>
21
 
23
 

+ 2
- 0
src/state_workflow.c View File

16
  * See <http://www.gnu.org/licenses/>.
16
  * See <http://www.gnu.org/licenses/>.
17
  */
17
  */
18
 
18
 
19
+// TODO adding and removing whole workflows
20
+
19
 #include <stdio.h>
21
 #include <stdio.h>
20
 #include <string.h>
22
 #include <string.h>
21
 
23
 

Loading…
Cancel
Save