Quellcode durchsuchen

Fix Linux GPIO logging (#20093)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
Costas Basdekis vor 3 Jahren
Ursprung
Commit
3b68e44d9a
Es ist kein Account mit der E-Mail-Adresse des Committers verbunden
2 geänderte Dateien mit 14 neuen und 12 gelöschten Zeilen
  1. 3
    0
      .gitignore
  2. 11
    12
      Marlin/src/HAL/LINUX/main.cpp

+ 3
- 0
.gitignore Datei anzeigen

@@ -183,3 +183,6 @@ cmake-build-*
183 183
 
184 184
 #Python
185 185
 __pycache__
186
+
187
+#IOLogger logs
188
+*_log.csv

+ 11
- 12
Marlin/src/HAL/LINUX/main.cpp Datei anzeigen

@@ -19,22 +19,23 @@
19 19
  */
20 20
 #ifdef __PLAT_LINUX__
21 21
 
22
-extern void setup();
23
-extern void loop();
24
-
25
-#include <thread>
26
-
27
-#include <iostream>
28
-#include <fstream>
22
+//#define GPIO_LOGGING // Full GPIO and Positional Logging
29 23
 
30 24
 #include "../../inc/MarlinConfig.h"
31
-#include <stdio.h>
32
-#include <stdarg.h>
33 25
 #include "../shared/Delay.h"
34 26
 #include "hardware/IOLoggerCSV.h"
35 27
 #include "hardware/Heater.h"
36 28
 #include "hardware/LinearAxis.h"
37 29
 
30
+#include <stdio.h>
31
+#include <stdarg.h>
32
+#include <thread>
33
+#include <iostream>
34
+#include <fstream>
35
+
36
+extern void setup();
37
+extern void loop();
38
+
38 39
 // simple stdout / stdin implementation for fake serial port
39 40
 void write_serial_thread() {
40 41
   for (;;) {
@@ -64,8 +65,6 @@ void simulation_loop() {
64 65
   LinearAxis z_axis(Z_ENABLE_PIN, Z_DIR_PIN, Z_STEP_PIN, Z_MIN_PIN, Z_MAX_PIN);
65 66
   LinearAxis extruder0(E0_ENABLE_PIN, E0_DIR_PIN, E0_STEP_PIN, P_NC, P_NC);
66 67
 
67
-  //#define GPIO_LOGGING // Full GPIO and Positional Logging
68
-
69 68
   #ifdef GPIO_LOGGING
70 69
     IOLoggerCSV logger("all_gpio_log.csv");
71 70
     Gpio::attachLogger(&logger);
@@ -88,7 +87,7 @@ void simulation_loop() {
88 87
 
89 88
     #ifdef GPIO_LOGGING
90 89
       if (x_axis.position != x || y_axis.position != y || z_axis.position != z) {
91
-        uint64_t update = MAX3(x_axis.last_update, y_axis.last_update, z_axis.last_update);
90
+        uint64_t update = _MAX(x_axis.last_update, y_axis.last_update, z_axis.last_update);
92 91
         position_log << update << ", " << x_axis.position << ", " << y_axis.position << ", " << z_axis.position << std::endl;
93 92
         position_log.flush();
94 93
         x = x_axis.position;

Laden…
Abbrechen
Speichern