Browse Source

Fix PlatformIO dependencies

Thomas Moore 6 years ago
parent
commit
97c19de8b9
5 changed files with 36 additions and 23 deletions
  1. 3
    0
      .gitignore
  2. 3
    3
      Marlin/MarlinSPI.h
  3. 23
    18
      Marlin/Marlin_main.cpp
  4. 1
    1
      Marlin/temperature.cpp
  5. 6
    1
      platformio.ini

+ 3
- 0
.gitignore View File

118
 
118
 
119
 # PlatformIO files/dirs
119
 # PlatformIO files/dirs
120
 .pio*
120
 .pio*
121
+.pioenvs
122
+.piolibdeps
121
 lib/readme.txt
123
 lib/readme.txt
122
 
124
 
123
 #Visual Studio
125
 #Visual Studio
131
 
133
 
132
 #VScode
134
 #VScode
133
 .vscode
135
 .vscode
136
+.vscode/c_cpp_properties.json
134
 
137
 
135
 #cmake
138
 #cmake
136
 CMakeLists.txt
139
 CMakeLists.txt

Marlin/spi.h → Marlin/MarlinSPI.h View File

20
  *
20
  *
21
  */
21
  */
22
 
22
 
23
-#ifndef __SPI_H__
24
-#define __SPI_H__
23
+#ifndef __MARLIN_SPI_H__
24
+#define __MARLIN_SPI_H__
25
 
25
 
26
 #include <stdint.h>
26
 #include <stdint.h>
27
 #include "softspi.h"
27
 #include "softspi.h"
54
 
54
 
55
 };
55
 };
56
 
56
 
57
-#endif // __SPI_H__
57
+#endif // __MARLIN_SPI_H__

+ 23
- 18
Marlin/Marlin_main.cpp View File

10325
     SERIAL_ECHOLNPGM(" prewarn flag cleared");
10325
     SERIAL_ECHOLNPGM(" prewarn flag cleared");
10326
   }
10326
   }
10327
 
10327
 
10328
-  static void tmc2130_get_pwmthrs(TMC2130Stepper &st, const char name, const uint16_t spmm) {
10329
-    SERIAL_CHAR(name);
10330
-    SERIAL_ECHOPGM(" stealthChop max speed set to ");
10331
-    SERIAL_ECHOLN(12650000UL * st.microsteps() / (256 * st.stealth_max_speed() * spmm));
10332
-  }
10333
-  static void tmc2130_set_pwmthrs(TMC2130Stepper &st, const char name, const int32_t thrs, const uint32_t spmm) {
10334
-    st.stealth_max_speed(12650000UL * st.microsteps() / (256 * thrs * spmm));
10335
-    tmc2130_get_pwmthrs(st, name, spmm);
10336
-  }
10328
+  #if ENABLED(HYBRID_THRESHOLD)
10329
+    static void tmc2130_get_pwmthrs(TMC2130Stepper &st, const char name, const uint16_t spmm) {
10330
+      SERIAL_CHAR(name);
10331
+      SERIAL_ECHOPGM(" stealthChop max speed set to ");
10332
+      SERIAL_ECHOLN(12650000UL * st.microsteps() / (256 * st.stealth_max_speed() * spmm));
10333
+    }
10337
 
10334
 
10338
-  static void tmc2130_get_sgt(TMC2130Stepper &st, const char name) {
10339
-    SERIAL_CHAR(name);
10340
-    SERIAL_ECHOPGM(" driver homing sensitivity set to ");
10341
-    SERIAL_ECHOLN(st.sgt());
10342
-  }
10343
-  static void tmc2130_set_sgt(TMC2130Stepper &st, const char name, const int8_t sgt_val) {
10344
-    st.sgt(sgt_val);
10345
-    tmc2130_get_sgt(st, name);
10346
-  }
10335
+    static void tmc2130_set_pwmthrs(TMC2130Stepper &st, const char name, const int32_t thrs, const uint32_t spmm) {
10336
+      st.stealth_max_speed(12650000UL * st.microsteps() / (256 * thrs * spmm));
10337
+      tmc2130_get_pwmthrs(st, name, spmm);
10338
+    }
10339
+  #endif
10340
+
10341
+  #if ENABLED(SENSORLESS_HOMING)
10342
+    static void tmc2130_get_sgt(TMC2130Stepper &st, const char name) {
10343
+      SERIAL_CHAR(name);
10344
+      SERIAL_ECHOPGM(" driver homing sensitivity set to ");
10345
+      SERIAL_ECHOLN(st.sgt());
10346
+    }
10347
+    static void tmc2130_set_sgt(TMC2130Stepper &st, const char name, const int8_t sgt_val) {
10348
+      st.sgt(sgt_val);
10349
+      tmc2130_get_sgt(st, name);
10350
+    }
10351
+  #endif
10347
 
10352
 
10348
   /**
10353
   /**
10349
    * M906: Set motor current in milliamps using axis codes X, Y, Z, E
10354
    * M906: Set motor current in milliamps using axis codes X, Y, Z, E

+ 1
- 1
Marlin/temperature.cpp View File

32
 #include "language.h"
32
 #include "language.h"
33
 
33
 
34
 #if ENABLED(HEATER_0_USES_MAX6675)
34
 #if ENABLED(HEATER_0_USES_MAX6675)
35
-  #include "spi.h"
35
+  #include "MarlinSPI.h"
36
 #endif
36
 #endif
37
 
37
 
38
 #if ENABLED(BABYSTEPPING)
38
 #if ENABLED(BABYSTEPPING)

+ 6
- 1
platformio.ini View File

19
 env_default = megaatmega2560
19
 env_default = megaatmega2560
20
 
20
 
21
 [common]
21
 [common]
22
-lib_deps = U8glib@1.19.1
22
+lib_deps =
23
+  U8glib@1.19.1
24
+  TMC2130Stepper
25
+  Adafruit NeoPixel
26
+  https://github.com/lincomatic/LiquidTWI2.git
27
+  https://github.com/trinamic/TMC26XStepper.git
23
 
28
 
24
 [env:megaatmega2560]
29
 [env:megaatmega2560]
25
 platform = atmelavr
30
 platform = atmelavr

Loading…
Cancel
Save