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,6 +118,8 @@ tags
118 118
 
119 119
 # PlatformIO files/dirs
120 120
 .pio*
121
+.pioenvs
122
+.piolibdeps
121 123
 lib/readme.txt
122 124
 
123 125
 #Visual Studio
@@ -131,6 +133,7 @@ Marlin/.vs/
131 133
 
132 134
 #VScode
133 135
 .vscode
136
+.vscode/c_cpp_properties.json
134 137
 
135 138
 #cmake
136 139
 CMakeLists.txt

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

@@ -20,8 +20,8 @@
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 26
 #include <stdint.h>
27 27
 #include "softspi.h"
@@ -54,4 +54,4 @@ class SPI<MISO_PIN, MOSI_PIN, SCK_PIN> {
54 54
 
55 55
 };
56 56
 
57
-#endif // __SPI_H__
57
+#endif // __MARLIN_SPI_H__

+ 23
- 18
Marlin/Marlin_main.cpp View File

@@ -10325,25 +10325,30 @@ inline void gcode_M502() {
10325 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 10354
    * M906: Set motor current in milliamps using axis codes X, Y, Z, E

+ 1
- 1
Marlin/temperature.cpp View File

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

+ 6
- 1
platformio.ini View File

@@ -19,7 +19,12 @@ libdeps_dir = .piolibdeps
19 19
 env_default = megaatmega2560
20 20
 
21 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 29
 [env:megaatmega2560]
25 30
 platform = atmelavr

Loading…
Cancel
Save