From 91359103e5d46d132be02fea7dfee120da13602e Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Fri, 29 Nov 2019 22:53:11 +0100 Subject: [PATCH 01/11] Add model configuration parameter. Add configuration_MMUv2.h.in. Move selector and idler step constants to configuration file. --- CMakeLists.txt | 60 ++++++++++++++++++++------ MM-control-01/configuration_MMUv2.h.in | 11 +++++ MM-control-01/stepper.cpp | 8 +--- 3 files changed, 58 insertions(+), 21 deletions(-) create mode 100644 MM-control-01/configuration_MMUv2.h.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 337292da..92669148 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,29 @@ -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.3) + +# +# Command Line Options +# +# You should specify those options when invoking CMake. Example: +# ~~~ +# cmake .. -DPRINTER=MINI +# ~~~ + +SET(MODEL_VALID_OPTS "MMUv2" "FANTAv1") + +SET(MODEL + "MMUv2" + CACHE + STRING + "Select the model for which you want to compile the project (valid values are ${MODEL_VALID_OPTS})." + ) + +# Validate options +foreach(OPTION "MODEL") + if(NOT ${OPTION} IN_LIST ${OPTION}_VALID_OPTS) + message(FATAL_ERROR "Invalid ${OPTION} ${${OPTION}}: Valid values are ${${OPTION}_VALID_OPTS}") + endif() +endforeach() + SET(CMAKE_SYSTEM_NAME Generic) SET(CMAKE_C_COMPILER avr-gcc) @@ -44,9 +69,16 @@ git_count_parent_commits(GIT_PARENT_COMMITS) git_local_changes(GIT_LOCAL_CHANGES) configure_file( -${CMAKE_SOURCE_DIR}/MM-control-01/version.h.in -version.h + ${CMAKE_SOURCE_DIR}/MM-control-01/version.h.in + version.h ) + +configure_file( + ${CMAKE_SOURCE_DIR}/MM-control-01/configuration_${MODEL}.h.in + configuration.h + COPYONLY +) + # The 'real' git information file set(GITREV_BARE_FILE dirty.h) # The temporary git information file @@ -126,18 +158,18 @@ add_custom_target( add_custom_command( - OUTPUT ${GITREV_TMP} - COMMAND ${CMAKE_COMMAND} -E echo_append "#define FW_LOCAL_CHANGES " > ${GITREV_TMP} - COMMAND ${GIT_EXECUTABLE} diff-index --quiet HEAD -- && echo 0 >> ${GITREV_TMP} || echo 1 >> ${GITREV_TMP} - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${GITREV_TMP} ${GITREV_FILE} - COMMAND ${CMAKE_COMMAND} -E remove ${GITREV_TMP} - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} - VERBATIM + OUTPUT ${GITREV_TMP} + COMMAND ${CMAKE_COMMAND} -E echo_append "#define FW_LOCAL_CHANGES " > ${GITREV_TMP} + COMMAND ${GIT_EXECUTABLE} diff-index --quiet HEAD -- && echo 0 >> ${GITREV_TMP} || echo 1 >> ${GITREV_TMP} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${GITREV_TMP} ${GITREV_FILE} + COMMAND ${CMAKE_COMMAND} -E remove ${GITREV_TMP} + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + VERBATIM ) if ("Windows" STREQUAL CMAKE_HOST_SYSTEM_NAME) -configure_file( -${CMAKE_SOURCE_DIR}/build.bat.in -build.bat -) + configure_file( + ${CMAKE_SOURCE_DIR}/build.bat.in + build.bat + ) endif() diff --git a/MM-control-01/configuration_MMUv2.h.in b/MM-control-01/configuration_MMUv2.h.in new file mode 100644 index 00000000..bcd37847 --- /dev/null +++ b/MM-control-01/configuration_MMUv2.h.in @@ -0,0 +1,11 @@ +#ifndef CONFIGURATION_H +#define CONFIGURATION_H + +static const int selector_steps_after_homing = -3700; +static const int idler_steps_after_homing = -130; + +static const int selector_steps = 2790/4; +static const int idler_steps = 1420 / 4; // 2 msteps = 180 / 4 +static const int idler_parking_steps = (idler_steps / 2) + 40; // 40 + +#endif //CONFIGURATION_H \ No newline at end of file diff --git a/MM-control-01/stepper.cpp b/MM-control-01/stepper.cpp index 5522cdbe..58c31547 100644 --- a/MM-control-01/stepper.cpp +++ b/MM-control-01/stepper.cpp @@ -11,17 +11,11 @@ #include "permanent_storage.h" #include "pins.h" #include "tmc2130.h" +#include "configuration.h" int8_t filament_type[EXTRUDERS] = {-1, -1, -1, -1, -1}; static bool isIdlerParked = false; -static const int selector_steps_after_homing = -3700; -static const int idler_steps_after_homing = -130; - -static const int selector_steps = 2790/4; -static const int idler_steps = 1420 / 4; // 2 msteps = 180 / 4 -static const int idler_parking_steps = (idler_steps / 2) + 40; // 40 - static int set_idler_direction(int _steps); static int set_selector_direction(int _steps); From 4f4e18d3c5b0f32a384bb11206b3ebd57b1b0d51 Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Sat, 30 Nov 2019 00:53:54 +0100 Subject: [PATCH 02/11] Add FANTAv1 configuration. Add idler_homing_direction and idler_single_parking_position. --- MM-control-01/configuration_FANTAv1.h.in | 17 +++++++++++++++++ MM-control-01/configuration_MMUv2.h.in | 16 +++++++++++----- MM-control-01/stepper.cpp | 4 ++-- 3 files changed, 30 insertions(+), 7 deletions(-) create mode 100644 MM-control-01/configuration_FANTAv1.h.in diff --git a/MM-control-01/configuration_FANTAv1.h.in b/MM-control-01/configuration_FANTAv1.h.in new file mode 100644 index 00000000..2cc7b921 --- /dev/null +++ b/MM-control-01/configuration_FANTAv1.h.in @@ -0,0 +1,17 @@ +#ifndef CONFIGURATION_H +#define CONFIGURATION_H + +// FANTAv1 configuration +// edit input file configuration_FANTAv1.h.in + +static constexpr int idler_homing_direction = -1; + +static constexpr int selector_steps_after_homing = -3700; +static constexpr int idler_steps_after_homing = 533; + +static constexpr int selector_steps = 2790/4; +static constexpr int idler_steps = -500; +static constexpr int idler_parking_steps = 533; +static constexpr bool idler_single_parking_position = true; + +#endif //CONFIGURATION_H \ No newline at end of file diff --git a/MM-control-01/configuration_MMUv2.h.in b/MM-control-01/configuration_MMUv2.h.in index bcd37847..1f0fc0ea 100644 --- a/MM-control-01/configuration_MMUv2.h.in +++ b/MM-control-01/configuration_MMUv2.h.in @@ -1,11 +1,17 @@ #ifndef CONFIGURATION_H #define CONFIGURATION_H -static const int selector_steps_after_homing = -3700; -static const int idler_steps_after_homing = -130; +// MMUv2 configuration +// edit input file configuration_MMUv2.h.in -static const int selector_steps = 2790/4; -static const int idler_steps = 1420 / 4; // 2 msteps = 180 / 4 -static const int idler_parking_steps = (idler_steps / 2) + 40; // 40 +static constexpr int idler_homing_direction = 1; + +static constexpr int selector_steps_after_homing = -3700; +static constexpr int idler_steps_after_homing = -130; + +static constexpr int selector_steps = 2790/4; +static constexpr int idler_steps = 1420 / 4; // 2 msteps = 180 / 4 +static constexpr int idler_parking_steps = (idler_steps / 2) + 40; // 40 +static constexpr bool idler_single_parking_position = false; #endif //CONFIGURATION_H \ No newline at end of file diff --git a/MM-control-01/stepper.cpp b/MM-control-01/stepper.cpp index 58c31547..1926a1b1 100644 --- a/MM-control-01/stepper.cpp +++ b/MM-control-01/stepper.cpp @@ -71,14 +71,14 @@ bool home_idler() tmc2130_init(HOMING_MODE); - move(-10, 0, 0); // move a bit in opposite direction + move(-10*idler_homing_direction, 0, 0); // move a bit in opposite direction for (int c = 1; c > 0; c--) // not really functional, let's do it rather more times to be sure { delay(50); for (int i = 0; i < 2000; i++) { - move(1, 0,0); + move(idler_homing_direction, 0,0); delayMicroseconds(100); tmc2130_read_sg(0); From 27c57d82614b72e324af0d47027be83580b32bc3 Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Sat, 30 Nov 2019 02:07:28 +0100 Subject: [PATCH 03/11] Set selector steps for FANTAv1 configuration. (cherry picked from commit f8c73448757476adb7faf06586687ad63ac53231) --- MM-control-01/configuration_FANTAv1.h.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MM-control-01/configuration_FANTAv1.h.in b/MM-control-01/configuration_FANTAv1.h.in index 2cc7b921..32bdbe1f 100644 --- a/MM-control-01/configuration_FANTAv1.h.in +++ b/MM-control-01/configuration_FANTAv1.h.in @@ -6,11 +6,11 @@ static constexpr int idler_homing_direction = -1; -static constexpr int selector_steps_after_homing = -3700; +static constexpr int selector_steps_after_homing = 0; static constexpr int idler_steps_after_homing = 533; -static constexpr int selector_steps = 2790/4; static constexpr int idler_steps = -500; +static constexpr int selector_steps = -828; static constexpr int idler_parking_steps = 533; static constexpr bool idler_single_parking_position = true; From 27de35ccc06179efea7608a9e128d586dfa75e68 Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Sat, 30 Nov 2019 00:56:09 +0100 Subject: [PATCH 04/11] Invert park_idler parameter logic. (cherry picked from commit 10ceda4bdfb6738fc150124941eb73e43bbfecfa) --- MM-control-01/motion.cpp | 8 ++++---- MM-control-01/stepper.cpp | 22 +++++++++++----------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/MM-control-01/motion.cpp b/MM-control-01/motion.cpp index 94f4048a..80ff67ce 100644 --- a/MM-control-01/motion.cpp +++ b/MM-control-01/motion.cpp @@ -26,7 +26,7 @@ void rehome() shr16_set_ena(7); tmc2130_init(tmc2130_mode); home(); - if (s_idler_engaged) park_idler(true); + park_idler(!s_idler_engaged); } static void rehome_idler() @@ -38,7 +38,7 @@ static void rehome_idler() home_idler(); int idler_steps = get_idler_steps(0, s_idler); move_proportional(idler_steps, 0); - if (s_idler_engaged) park_idler(true); + park_idler(!s_idler_engaged); } void motion_set_idler_selector(uint8_t idler_selector) @@ -100,14 +100,14 @@ static void check_idler_drive_error() void motion_engage_idler() { s_idler_engaged = true; - park_idler(true); + park_idler(false); check_idler_drive_error(); } void motion_disengage_idler() { s_idler_engaged = false; - park_idler(false); + park_idler(true); check_idler_drive_error(); } diff --git a/MM-control-01/stepper.cpp b/MM-control-01/stepper.cpp index 1926a1b1..97daf89f 100644 --- a/MM-control-01/stepper.cpp +++ b/MM-control-01/stepper.cpp @@ -89,15 +89,15 @@ bool home_idler() } } - move(idler_steps_after_homing, 0, 0); // move to initial position + move(idler_steps_after_homing, 0, 0); // move to initial position - tmc2130_init(tmc2130_mode); + tmc2130_init(tmc2130_mode); - delay(500); + delay(500); - isIdlerParked = false; + isIdlerParked = false; - park_idler(false); + park_idler(true); return true; } @@ -288,17 +288,17 @@ void set_pulley_dir_pull() //! @brief Park idler //! each filament selected has its park position, there is no park position for all filaments. -//! @param _unpark -//! * false park -//! * true engage -void park_idler(bool _unpark) +//! @param park +//! * true park +//! * false engage +void park_idler(bool park) { - if (_unpark && isIdlerParked) // get idler in contact with filament + if (!park && isIdlerParked) // get idler in contact with filament { move_proportional(idler_parking_steps, 0); isIdlerParked = false; } - else if (!_unpark && !isIdlerParked) // park idler so filament can move freely + else if (park && !isIdlerParked) // park idler so filament can move freely { move_proportional(idler_parking_steps*-1, 0); isIdlerParked = true; From e979f3e3cf39019009d0a3b6ee044668e8b5a067 Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Sat, 30 Nov 2019 02:44:58 +0100 Subject: [PATCH 05/11] Do not home idler if already homed. --- MM-control-01/motion.cpp | 13 +++++++++---- MM-control-01/stepper.h | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/MM-control-01/motion.cpp b/MM-control-01/motion.cpp index 80ff67ce..24e3141d 100644 --- a/MM-control-01/motion.cpp +++ b/MM-control-01/motion.cpp @@ -14,6 +14,7 @@ static uint8_t s_idler = 0; static uint8_t s_selector = 0; static bool s_selector_homed = false; +static bool s_idler_homed = false; static bool s_idler_engaged = true; static bool s_has_door_sensor = false; @@ -55,12 +56,15 @@ void motion_set_idler_selector(uint8_t idler_selector) //! @param selector selector void motion_set_idler_selector(uint8_t idler, uint8_t selector) { + if (!s_idler_homed) + { + motion_set_idler(0); + } if (!s_selector_homed) { - home(); - s_selector = 0; - s_idler = 0; - s_selector_homed = true; + home_selector(); + s_selector = 0; + s_selector_homed = true; } const uint8_t tries = 2; for (uint8_t i = 0; i <= tries; ++i) @@ -223,6 +227,7 @@ void motion_door_sensor_detected() void motion_set_idler(uint8_t idler) { home_idler(); + s_idler_homed = true; int idler_steps = get_idler_steps(0, idler); move_proportional(idler_steps, 0); s_idler = idler; diff --git a/MM-control-01/stepper.h b/MM-control-01/stepper.h index 99293364..2952889f 100644 --- a/MM-control-01/stepper.h +++ b/MM-control-01/stepper.h @@ -11,6 +11,7 @@ extern int8_t filament_type[EXTRUDERS]; void home(); bool home_idler(); +bool home_selector(); int get_idler_steps(int current_filament, int next_filament); int get_selector_steps(int current_filament, int next_filament); From f8ae5b744ffa905f84eac20eb3a2ec8c9dd2c77d Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Sat, 30 Nov 2019 03:11:46 +0100 Subject: [PATCH 06/11] Add support for idler with just single parking position. --- MM-control-01/motion.cpp | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/MM-control-01/motion.cpp b/MM-control-01/motion.cpp index 24e3141d..f9e9e1fe 100644 --- a/MM-control-01/motion.cpp +++ b/MM-control-01/motion.cpp @@ -10,6 +10,7 @@ #include "config.h" #include "tmc2130.h" #include "shr16.h" +#include "configuration.h" static uint8_t s_idler = 0; static uint8_t s_selector = 0; @@ -71,8 +72,14 @@ void motion_set_idler_selector(uint8_t idler, uint8_t selector) { int idler_steps = get_idler_steps(s_idler, idler); int selector_steps = get_selector_steps(s_selector, selector); - - move_proportional(idler_steps, selector_steps); + if (idler_single_parking_position && !s_idler_engaged) + { + move_proportional(0, selector_steps); + } + else + { + move_proportional(idler_steps, selector_steps); + } s_idler = idler; s_selector = selector; @@ -104,6 +111,10 @@ static void check_idler_drive_error() void motion_engage_idler() { s_idler_engaged = true; + if (idler_single_parking_position) + { + motion_set_idler(s_idler); + } park_idler(false); check_idler_drive_error(); } @@ -111,6 +122,16 @@ void motion_engage_idler() void motion_disengage_idler() { s_idler_engaged = false; + if (idler_single_parking_position) + { + if (!s_idler_homed) + { + home_idler(); + s_idler_homed = true; + } + int idler_steps = get_idler_steps(s_idler, 0); + move_proportional(idler_steps, 0); + } park_idler(true); check_idler_drive_error(); } @@ -226,8 +247,11 @@ void motion_door_sensor_detected() void motion_set_idler(uint8_t idler) { - home_idler(); - s_idler_homed = true; + if (!s_idler_homed) + { + home_idler(); + s_idler_homed = true; + } int idler_steps = get_idler_steps(0, idler); move_proportional(idler_steps, 0); s_idler = idler; From 27aadc7a5f61bcbc05d7525801de63f993e95413 Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Sat, 30 Nov 2019 03:15:09 +0100 Subject: [PATCH 07/11] Add doxygen header. --- MM-control-01/configuration_FANTAv1.h.in | 3 +++ MM-control-01/configuration_MMUv2.h.in | 3 +++ 2 files changed, 6 insertions(+) diff --git a/MM-control-01/configuration_FANTAv1.h.in b/MM-control-01/configuration_FANTAv1.h.in index 32bdbe1f..44a4f7eb 100644 --- a/MM-control-01/configuration_FANTAv1.h.in +++ b/MM-control-01/configuration_FANTAv1.h.in @@ -1,3 +1,6 @@ +//! @file +//! @author Marek Bel + #ifndef CONFIGURATION_H #define CONFIGURATION_H diff --git a/MM-control-01/configuration_MMUv2.h.in b/MM-control-01/configuration_MMUv2.h.in index 1f0fc0ea..3648d04e 100644 --- a/MM-control-01/configuration_MMUv2.h.in +++ b/MM-control-01/configuration_MMUv2.h.in @@ -1,3 +1,6 @@ +//! @file +//! @author Marek Bel + #ifndef CONFIGURATION_H #define CONFIGURATION_H From 9f6a3abd1c987018441644a821b08dc947cef7f3 Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Sat, 30 Nov 2019 03:37:31 +0100 Subject: [PATCH 08/11] Add pulley_parking_steps. --- MM-control-01/configuration_FANTAv1.h.in | 1 + MM-control-01/configuration_MMUv2.h.in | 1 + MM-control-01/mmctl.cpp | 5 +++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/MM-control-01/configuration_FANTAv1.h.in b/MM-control-01/configuration_FANTAv1.h.in index 44a4f7eb..dd838eda 100644 --- a/MM-control-01/configuration_FANTAv1.h.in +++ b/MM-control-01/configuration_FANTAv1.h.in @@ -15,6 +15,7 @@ static constexpr int idler_steps_after_homing = 533; static constexpr int idler_steps = -500; static constexpr int selector_steps = -828; static constexpr int idler_parking_steps = 533; +static constexpr int pulley_parking_steps = 1242; static constexpr bool idler_single_parking_position = true; #endif //CONFIGURATION_H \ No newline at end of file diff --git a/MM-control-01/configuration_MMUv2.h.in b/MM-control-01/configuration_MMUv2.h.in index 3648d04e..28876e02 100644 --- a/MM-control-01/configuration_MMUv2.h.in +++ b/MM-control-01/configuration_MMUv2.h.in @@ -15,6 +15,7 @@ static constexpr int idler_steps_after_homing = -130; static constexpr int selector_steps = 2790/4; static constexpr int idler_steps = 1420 / 4; // 2 msteps = 180 / 4 static constexpr int idler_parking_steps = (idler_steps / 2) + 40; // 40 +static constexpr int pulley_parking_steps = 600; static constexpr bool idler_single_parking_position = false; #endif //CONFIGURATION_H \ No newline at end of file diff --git a/MM-control-01/mmctl.cpp b/MM-control-01/mmctl.cpp index e3b37288..df7f0304 100644 --- a/MM-control-01/mmctl.cpp +++ b/MM-control-01/mmctl.cpp @@ -15,6 +15,7 @@ #include "motion.h" #include "permanent_storage.h" #include "config.h" +#include "configuration.h" //! Keeps track of selected filament. It is used for LED signalization and it is backed up to permanent storage //! so MMU can unload filament after power loss. @@ -90,7 +91,7 @@ bool feed_filament(bool timeout) { // unload to PTFE tube set_pulley_dir_pull(); - for (int i = 600 + finda_limit; i > 0; i--) + for (int i = pulley_parking_steps + finda_limit; i > 0; i--) { do_pulley_step(); delayMicroseconds(3000); @@ -337,7 +338,7 @@ static bool checkOk() // looks ok ! // unload to PTFE tube set_pulley_dir_pull(); - for (int i = 600; i > 0; i--) // 570 + for (int i = pulley_parking_steps; i > 0; i--) { do_pulley_step(); delayMicroseconds(3000); From 5d01963acf4023e2d72522074b8d5a4ba905138e Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Sat, 30 Nov 2019 04:57:48 +0100 Subject: [PATCH 09/11] Tune pulley_parking_steps in FANTAv1 variant. Make unload_filament_withSensor() dependent on pulley_parking_steps. --- MM-control-01/configuration_FANTAv1.h.in | 2 +- MM-control-01/mmctl.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MM-control-01/configuration_FANTAv1.h.in b/MM-control-01/configuration_FANTAv1.h.in index dd838eda..4a553d81 100644 --- a/MM-control-01/configuration_FANTAv1.h.in +++ b/MM-control-01/configuration_FANTAv1.h.in @@ -15,7 +15,7 @@ static constexpr int idler_steps_after_homing = 533; static constexpr int idler_steps = -500; static constexpr int selector_steps = -828; static constexpr int idler_parking_steps = 533; -static constexpr int pulley_parking_steps = 1242; +static constexpr int pulley_parking_steps = 1500; static constexpr bool idler_single_parking_position = true; #endif //CONFIGURATION_H \ No newline at end of file diff --git a/MM-control-01/mmctl.cpp b/MM-control-01/mmctl.cpp index df7f0304..d777874f 100644 --- a/MM-control-01/mmctl.cpp +++ b/MM-control-01/mmctl.cpp @@ -639,7 +639,7 @@ void unload_filament_withSensor() // correct unloading // unload to PTFE tube set_pulley_dir_pull(); - for (int i = 450; i > 0; i--) // 570 + for (int i = pulley_parking_steps - 150; i > 0; i--) // 570 { do_pulley_step(); delayMicroseconds(5000); From 2595e8f15fbc85c733e2fd2c378828452a4a5ecb Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Sun, 1 Dec 2019 03:20:20 +0100 Subject: [PATCH 10/11] Add FANTAv1 to build system. --- .travis.yml | 5 +++-- CMakeLists.txt | 4 ++-- build.sh | 16 +++++++++++++++- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index e8f314f9..c2e42de8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,14 +11,15 @@ script: - bash -x test.sh - bash -x build.sh - wget https://github.com/prusa3d/caterina/releases/download/V4/Caterina-prusa_mm_control.hex - - srec_cat ../MM-control-01-build/MM-control-01.hex.tmp -Intel Caterina-prusa_mm_control.hex -Intel -Output MM-control-01_with_bootloader.hex -Intel + - srec_cat ../MM-control-01-build/MM-control-01.hex.tmp -Intel Caterina-prusa_mm_control.hex -Intel -Output MM-control-01_MMUv2_with_bootloader.hex -Intel - mv Doxyfile MM-control-01/Doxyfile && cd MM-control-01 - doxygen && cd .. deploy: provider: releases api_key: $ACCESS_TOKEN file: - - ../MM-control-01-build/MM-control-01.hex + - ../MM-control-01-build/MM-control-01_MMUv2.hex + - ../MM-control-01_FANTAv1-build/MM-control-01_FANTAv1.hex - MM-control-01_with_bootloader.hex skip_cleanup: true on: diff --git a/CMakeLists.txt b/CMakeLists.txt index 92669148..870a4391 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 3.3) # # You should specify those options when invoking CMake. Example: # ~~~ -# cmake .. -DPRINTER=MINI +# cmake .. -DMODEL=FANTAv1 # ~~~ SET(MODEL_VALID_OPTS "MMUv2" "FANTAv1") @@ -135,7 +135,7 @@ add_custom_command( COMMAND ${CAT} ARGS ${CMAKE_SOURCE_DIR}/MM-control-01.hex.in MM-control-01.hex.tmp - > MM-control-01.hex + > MM-control-01_${MODEL}.hex COMMENT "Generating HEX image" VERBATIM ) diff --git a/build.sh b/build.sh index fbaf630d..a45e988e 100755 --- a/build.sh +++ b/build.sh @@ -34,4 +34,18 @@ if [ ! -f "$BUILD_ENV.version" ]; then touch $BUILD_ENV.version || exit 9 fi -cmake --build . || exit 10 \ No newline at end of file +cmake --build . || exit 10 + +if [ ! -d "MM-control-01_FANTAv1-build" ]; then + mkdir MM-control-01_FANTAv1-build || exit 11 +fi + +cd MM-control-01_FANTAv1-build || exit 12 + +if [ ! -f "$BUILD_ENV.version" ]; then + rm -r * + cmake -G "$BUILD_GENERATOR" -DMODEL=FANTAv1 $SCRIPT_PATH || exit 13 + touch $BUILD_ENV.version || exit 14 +fi + +cmake --build . || exit 15 \ No newline at end of file From 919dd1b58cebac7f1514113a337a38acade9396b Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Sun, 1 Dec 2019 03:44:07 +0100 Subject: [PATCH 11/11] Fix build path for FANTAv1 model in build.sh. Fix deployed file name in .travis.yml --- .travis.yml | 2 +- build.sh | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index c2e42de8..8898b7bf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,7 @@ deploy: file: - ../MM-control-01-build/MM-control-01_MMUv2.hex - ../MM-control-01_FANTAv1-build/MM-control-01_FANTAv1.hex - - MM-control-01_with_bootloader.hex + - MM-control-01_MMUv2_with_bootloader.hex skip_cleanup: true on: tags: true diff --git a/build.sh b/build.sh index a45e988e..b97691f9 100755 --- a/build.sh +++ b/build.sh @@ -35,6 +35,7 @@ if [ ! -f "$BUILD_ENV.version" ]; then fi cmake --build . || exit 10 +cd .. if [ ! -d "MM-control-01_FANTAv1-build" ]; then mkdir MM-control-01_FANTAv1-build || exit 11 @@ -48,4 +49,5 @@ if [ ! -f "$BUILD_ENV.version" ]; then touch $BUILD_ENV.version || exit 14 fi -cmake --build . || exit 15 \ No newline at end of file +cmake --build . || exit 15 +cd .. \ No newline at end of file