From 151096446fbeb32d9df6c03c59273b024ce4c2db Mon Sep 17 00:00:00 2001 From: Rob Date: Sun, 19 Sep 2021 21:14:45 +1000 Subject: [PATCH] Prepairing for 3.3.0 Rel Correct readme, changelog and added changes for double cutter #210 Variants added to do two builds --- .build/pre_build_script.py | 10 ++++++++++ .gitignore | 1 + CHANGELOG.md | 7 +++++++ README.md | 3 --- platformio.ini | 27 +++++++++++++++++++++------ src/config.h | 5 +++-- src/motion.cpp | 4 ++++ src/{tmc2130.c => tmc2130.cpp} | 0 src/variants/MMU2S-DoubleCutter.h | 1 + src/variants/MMU2S.h | 1 + 10 files changed, 48 insertions(+), 11 deletions(-) create mode 100644 .build/pre_build_script.py rename src/{tmc2130.c => tmc2130.cpp} (100%) create mode 100644 src/variants/MMU2S-DoubleCutter.h create mode 100644 src/variants/MMU2S.h diff --git a/.build/pre_build_script.py b/.build/pre_build_script.py new file mode 100644 index 00000000..13d7db84 --- /dev/null +++ b/.build/pre_build_script.py @@ -0,0 +1,10 @@ +import os +import shutil +Import("env") + +my_flags = env.ParseFlags(env['BUILD_FLAGS']) +defines = {k: v for (k, v) in my_flags.get("CPPDEFINES")} + +shutil.copyfile(os.path.join(os.getcwd(), "src/variants/{0}.h".format(defines.get('CONFIG'))), os.path.join(os.getcwd(), 'src/config_tzb.h')), + +env.Replace(PROGNAME="TZB-{0}-{1}-BN{2}".format(defines.get('CONFIG'), defines.get('VERSION'), defines.get('BN'))) \ No newline at end of file diff --git a/.gitignore b/.gitignore index 00860a30..bbd3df91 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,5 @@ /.vs/MM-control-01/v14/.suo /main.cpp~RFdf1346e.TMP /__vm/.MM-control-01.vsarduino.h +/src/config_tzb.h Doc diff --git a/CHANGELOG.md b/CHANGELOG.md index a0a02b2f..eece237f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ Changelog of MMU2S Firmware ============================= +# v3.3.0 RMM +* Pulled Printer Code upstream to 3.10.0 +* Implemented BLTouch support for MK3S +* Updated custom variant of MMU2S code for @gizzburn(and others) on issue #210 - double selector blades +* Fixed issue Error on failure recovery #205 +* Updated readme to reflect new printer FW build environment changes + # v3.2.0 RMM * Pulled Printer Code upstream to 3.9.3 * MMU2S Cutter implemented and tested with stock blade location #187 diff --git a/README.md b/README.md index fd6ad7a2..0f7feb83 100755 --- a/README.md +++ b/README.md @@ -21,9 +21,6 @@ This is configured to work directly with **MMU2S** with matching **MK3S** FW at https://github.com/TheZeroBeast/TZB-MK3S-Firmware ### PlatformIO Download, open in PlatformIO -Follow these steps to install EINSY board -https://community.platformio.org/t/error-when-building-latest-3d-printer-firmware/9506/2 -Build. The HEX which is placed within the .pio root folder still requires the addition of the **; device = mm-control** line as bellow. ### Arduino diff --git a/platformio.ini b/platformio.ini index 0ac165bb..f8d78b4a 100755 --- a/platformio.ini +++ b/platformio.ini @@ -1,9 +1,24 @@ -[platformio] -src_dir = . -lib_dir = .piolib -libdeps_dir = .piolibdeps +[common_env_data] +build_flags = + -D BN=373 + -D VERSION=3.3.0 -[env:mmu] +[env:MMU2S] platform = atmelavr +extra_scripts = pre:.build/pre_build_script.py +board = prusa_mm_control framework = arduino -board = leonardo +src_filter = +<*> - +build_flags = ${common_env_data.build_flags} + -D CONFIG=MMU2S + +[env:MMU2S-DoubleCutter] +platform = atmelavr +extra_scripts = pre:.build/pre_build_script.py +board = prusa_mm_control +framework = arduino +src_filter = +<*> - +build_flags = ${common_env_data.build_flags} + -D CONFIG=MMU2S-DoubleCutter + + diff --git a/src/config.h b/src/config.h index 5a6b7abb..4cdcdf40 100644 --- a/src/config.h +++ b/src/config.h @@ -1,8 +1,9 @@ // config.h - main configuration file +#include "config_tzb.h" -#define FW_VERSION 320 // example: 103 means version 1.0.3 -#define FW_BUILDNR 372 // number of commits in 'master' +#define FW_VERSION 330 // example: 103 means version 1.0.3 +#define FW_BUILDNR 373 // number of commits in 'master' #define WAKE_TIMER 300000 // 5m diff --git a/src/motion.cpp b/src/motion.cpp index f323a176..8481e035 100644 --- a/src/motion.cpp +++ b/src/motion.cpp @@ -32,7 +32,11 @@ int filament_lookup_table[9][3] = const uint8_t IDLER_PARKING_STEPS = (355 / 2) + 40; // 217 const uint16_t EJECT_PULLEY_STEPS = 2000; +#ifdef doublecutter +const int selectorStepPositionsFromHome[EXTRUDERS+2] = {-3178, -2479, -1782, -1085, -387, -27, 0} ; +#else const int selectorStepPositionsFromHome[EXTRUDERS+2] = {-3700, -3002, -2305, -1607, -910, -100, 0}; +#endif // doublecutter const int idlerStepPositionsFromHome[EXTRUDERS+1] = {-130, -485, -840, -1195, -1550, 0}; uint8_t selSGFailCount = 0; diff --git a/src/tmc2130.c b/src/tmc2130.cpp similarity index 100% rename from src/tmc2130.c rename to src/tmc2130.cpp diff --git a/src/variants/MMU2S-DoubleCutter.h b/src/variants/MMU2S-DoubleCutter.h new file mode 100644 index 00000000..9a3a3e8b --- /dev/null +++ b/src/variants/MMU2S-DoubleCutter.h @@ -0,0 +1 @@ +#define doublecutter \ No newline at end of file diff --git a/src/variants/MMU2S.h b/src/variants/MMU2S.h new file mode 100644 index 00000000..f8dd13a2 --- /dev/null +++ b/src/variants/MMU2S.h @@ -0,0 +1 @@ +#define cutter \ No newline at end of file