From 97c19de8b9c07660e19b3dc9fde373c510f4f5a1 Mon Sep 17 00:00:00 2001 From: Thomas Moore Date: Thu, 16 Nov 2017 15:16:21 -0600 Subject: [PATCH] Fix PlatformIO dependencies --- .gitignore | 3 +++ Marlin/{spi.h => MarlinSPI.h} | 6 ++--- Marlin/Marlin_main.cpp | 41 ++++++++++++++++++++--------------- Marlin/temperature.cpp | 2 +- platformio.ini | 7 +++++- 5 files changed, 36 insertions(+), 23 deletions(-) rename Marlin/{spi.h => MarlinSPI.h} (95%) diff --git a/.gitignore b/.gitignore index 8c7053826..9b811c6a9 100755 --- a/.gitignore +++ b/.gitignore @@ -118,6 +118,8 @@ tags # PlatformIO files/dirs .pio* +.pioenvs +.piolibdeps lib/readme.txt #Visual Studio @@ -131,6 +133,7 @@ Marlin/.vs/ #VScode .vscode +.vscode/c_cpp_properties.json #cmake CMakeLists.txt diff --git a/Marlin/spi.h b/Marlin/MarlinSPI.h similarity index 95% rename from Marlin/spi.h rename to Marlin/MarlinSPI.h index c4b86005a..93f9fb2b0 100644 --- a/Marlin/spi.h +++ b/Marlin/MarlinSPI.h @@ -20,8 +20,8 @@ * */ -#ifndef __SPI_H__ -#define __SPI_H__ +#ifndef __MARLIN_SPI_H__ +#define __MARLIN_SPI_H__ #include #include "softspi.h" @@ -54,4 +54,4 @@ class SPI { }; -#endif // __SPI_H__ +#endif // __MARLIN_SPI_H__ diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 2d9977ca5..84c313fa7 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -10325,25 +10325,30 @@ inline void gcode_M502() { SERIAL_ECHOLNPGM(" prewarn flag cleared"); } - static void tmc2130_get_pwmthrs(TMC2130Stepper &st, const char name, const uint16_t spmm) { - SERIAL_CHAR(name); - SERIAL_ECHOPGM(" stealthChop max speed set to "); - SERIAL_ECHOLN(12650000UL * st.microsteps() / (256 * st.stealth_max_speed() * spmm)); - } - static void tmc2130_set_pwmthrs(TMC2130Stepper &st, const char name, const int32_t thrs, const uint32_t spmm) { - st.stealth_max_speed(12650000UL * st.microsteps() / (256 * thrs * spmm)); - tmc2130_get_pwmthrs(st, name, spmm); - } + #if ENABLED(HYBRID_THRESHOLD) + static void tmc2130_get_pwmthrs(TMC2130Stepper &st, const char name, const uint16_t spmm) { + SERIAL_CHAR(name); + SERIAL_ECHOPGM(" stealthChop max speed set to "); + SERIAL_ECHOLN(12650000UL * st.microsteps() / (256 * st.stealth_max_speed() * spmm)); + } - static void tmc2130_get_sgt(TMC2130Stepper &st, const char name) { - SERIAL_CHAR(name); - SERIAL_ECHOPGM(" driver homing sensitivity set to "); - SERIAL_ECHOLN(st.sgt()); - } - static void tmc2130_set_sgt(TMC2130Stepper &st, const char name, const int8_t sgt_val) { - st.sgt(sgt_val); - tmc2130_get_sgt(st, name); - } + static void tmc2130_set_pwmthrs(TMC2130Stepper &st, const char name, const int32_t thrs, const uint32_t spmm) { + st.stealth_max_speed(12650000UL * st.microsteps() / (256 * thrs * spmm)); + tmc2130_get_pwmthrs(st, name, spmm); + } + #endif + + #if ENABLED(SENSORLESS_HOMING) + static void tmc2130_get_sgt(TMC2130Stepper &st, const char name) { + SERIAL_CHAR(name); + SERIAL_ECHOPGM(" driver homing sensitivity set to "); + SERIAL_ECHOLN(st.sgt()); + } + static void tmc2130_set_sgt(TMC2130Stepper &st, const char name, const int8_t sgt_val) { + st.sgt(sgt_val); + tmc2130_get_sgt(st, name); + } + #endif /** * M906: Set motor current in milliamps using axis codes X, Y, Z, E diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index c73c9187a..1ab024d86 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -32,7 +32,7 @@ #include "language.h" #if ENABLED(HEATER_0_USES_MAX6675) - #include "spi.h" + #include "MarlinSPI.h" #endif #if ENABLED(BABYSTEPPING) diff --git a/platformio.ini b/platformio.ini index 3d7cff483..b9f3b3646 100644 --- a/platformio.ini +++ b/platformio.ini @@ -19,7 +19,12 @@ libdeps_dir = .piolibdeps env_default = megaatmega2560 [common] -lib_deps = U8glib@1.19.1 +lib_deps = + U8glib@1.19.1 + TMC2130Stepper + Adafruit NeoPixel + https://github.com/lincomatic/LiquidTWI2.git + https://github.com/trinamic/TMC26XStepper.git [env:megaatmega2560] platform = atmelavr