Browse Source

uart only in debug build

Thomas Buck 1 year 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,13 +619,19 @@ void cnsl_handle_input(const uint8_t *buf, size_t len) {
619 619
             }
620 620
 
621 621
             usb_cdc_write((const uint8_t *)"\b \b", 3);
622
+
623
+#ifndef NDEBUG
622 624
             serial_write((const uint8_t *)"\b \b", 3);
625
+#endif
623 626
 
624 627
             // check for another backspace in this space
625 628
             i--;
626 629
         } else {
627 630
             usb_cdc_write((const uint8_t *)(cnsl_line_buff + i), 1);
631
+
632
+#ifndef NDEBUG
628 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,7 +62,9 @@ void log_dump_to_usb(void) {
62 62
 }
63 63
 
64 64
 void log_dump_to_uart(void) {
65
+#ifndef NDEBUG
65 66
     log_dump_to_x(serial_write);
67
+#endif
66 68
 }
67 69
 
68 70
 static void log_file_write_callback(const uint8_t *data, size_t len) {
@@ -100,7 +102,10 @@ void debug_log_va(bool log, const char *format, va_list args) {
100 102
     }
101 103
     if ((l > 0) && (l <= (int)sizeof(line_buff))) {
102 104
         usb_cdc_write(line_buff, l);
105
+
106
+#ifndef NDEBUG
103 107
         serial_write(line_buff, l);
108
+#endif
104 109
 
105 110
         if (log) {
106 111
             add_to_log(line_buff, l);

+ 2
- 0
src/main.c View File

@@ -55,7 +55,9 @@ int main(void) {
55 55
 
56 56
     // required for debug console
57 57
     cnsl_init();
58
+#ifndef NDEBUG
58 59
     serial_init();
60
+#endif
59 61
     usb_init();
60 62
 
61 63
     debug("mem_init");

+ 2
- 0
src/state_edit_workflow.c View File

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

+ 2
- 0
src/state_workflow.c View File

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

Loading…
Cancel
Save