Selaa lähdekoodia

Fix Linux GPIO logging (#20093)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
Costas Basdekis 3 vuotta sitten
vanhempi
commit
3b68e44d9a
No account linked to committer's email address
2 muutettua tiedostoa jossa 14 lisäystä ja 12 poistoa
  1. 3
    0
      .gitignore
  2. 11
    12
      Marlin/src/HAL/LINUX/main.cpp

+ 3
- 0
.gitignore Näytä tiedosto

183
 
183
 
184
 #Python
184
 #Python
185
 __pycache__
185
 __pycache__
186
+
187
+#IOLogger logs
188
+*_log.csv

+ 11
- 12
Marlin/src/HAL/LINUX/main.cpp Näytä tiedosto

19
  */
19
  */
20
 #ifdef __PLAT_LINUX__
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
 #include "../../inc/MarlinConfig.h"
24
 #include "../../inc/MarlinConfig.h"
31
-#include <stdio.h>
32
-#include <stdarg.h>
33
 #include "../shared/Delay.h"
25
 #include "../shared/Delay.h"
34
 #include "hardware/IOLoggerCSV.h"
26
 #include "hardware/IOLoggerCSV.h"
35
 #include "hardware/Heater.h"
27
 #include "hardware/Heater.h"
36
 #include "hardware/LinearAxis.h"
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
 // simple stdout / stdin implementation for fake serial port
39
 // simple stdout / stdin implementation for fake serial port
39
 void write_serial_thread() {
40
 void write_serial_thread() {
40
   for (;;) {
41
   for (;;) {
64
   LinearAxis z_axis(Z_ENABLE_PIN, Z_DIR_PIN, Z_STEP_PIN, Z_MIN_PIN, Z_MAX_PIN);
65
   LinearAxis z_axis(Z_ENABLE_PIN, Z_DIR_PIN, Z_STEP_PIN, Z_MIN_PIN, Z_MAX_PIN);
65
   LinearAxis extruder0(E0_ENABLE_PIN, E0_DIR_PIN, E0_STEP_PIN, P_NC, P_NC);
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
   #ifdef GPIO_LOGGING
68
   #ifdef GPIO_LOGGING
70
     IOLoggerCSV logger("all_gpio_log.csv");
69
     IOLoggerCSV logger("all_gpio_log.csv");
71
     Gpio::attachLogger(&logger);
70
     Gpio::attachLogger(&logger);
88
 
87
 
89
     #ifdef GPIO_LOGGING
88
     #ifdef GPIO_LOGGING
90
       if (x_axis.position != x || y_axis.position != y || z_axis.position != z) {
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
         position_log << update << ", " << x_axis.position << ", " << y_axis.position << ", " << z_axis.position << std::endl;
91
         position_log << update << ", " << x_axis.position << ", " << y_axis.position << ", " << z_axis.position << std::endl;
93
         position_log.flush();
92
         position_log.flush();
94
         x = x_axis.position;
93
         x = x_axis.position;

Loading…
Peruuta
Tallenna