Skip to content

Commit

Permalink
Merge branch 'MK3_3.11.0' into BEAR_MK3S
Browse files Browse the repository at this point in the history
  • Loading branch information
vertigo235 committed Jan 21, 2022
2 parents 21607e4 + 08ccc26 commit 0a62763
Show file tree
Hide file tree
Showing 176 changed files with 72,343 additions and 25,082 deletions.
16 changes: 8 additions & 8 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ workspace:

steps:
- name: tests
image: vertigo235/fw-build
image: vertigo235/fw-build:1.3
commands:
- bash -x test.sh
when:
Expand All @@ -16,7 +16,7 @@ steps:
- pull_request

- name: build-a-bear
image: vertigo235/fw-build
image: vertigo235/fw-build:1.3
environment:
BUILD_TYPE: GOLD
commands:
Expand All @@ -28,17 +28,17 @@ steps:
- sed 's/#define CUSTOM_MENDEL_NAME "Prusa i3 MK3S"/#define CUSTOM_MENDEL_NAME "Prusa i3 MK3S BEAR"/' Firmware/variants/1_75mm_MK3S-EINSy10a-E3Dv6full.h > Firmware/variants/Bear_Cal_FW_MK3S-EINSy10a.h
- sed 's/#define CUSTOM_MENDEL_NAME "Prusa i3 MK2.5"/#define CUSTOM_MENDEL_NAME "Prusa i3 MK2.5S BEAR"/' Firmware/variants/1_75mm_MK25S-RAMBo10a-E3Dv6full.h > Firmware/variants/Bear_Cal_FW_MK25S-RAMBo10a.h
- sed 's/#define CUSTOM_MENDEL_NAME "Prusa i3 MK2.5"/#define CUSTOM_MENDEL_NAME "Prusa i3 MK2.5S BEAR"/' Firmware/variants/1_75mm_MK25S-RAMBo13a-E3Dv6full.h > Firmware/variants/Bear_Cal_FW_MK25S-RAMBo13a.h
- bash -x PF-build.sh Bear_Cal_FW_MK3S-EINSy10a.h ALL $BUILD_TYPE
- bash -x PF-build.sh Bear_Cal_FW_MK25S-RAMBo10a.h ALL $BUILD_TYPE
- bash -x PF-build.sh Bear_Cal_FW_MK25S-RAMBo13a.h ALL $BUILD_TYPE
- bash -x PF-build.sh -v Bear_Cal_FW_MK3S-EINSy10a.h -l ALL -d $BUILD_TYPE
- bash -x PF-build.sh -v Bear_Cal_FW_MK25S-RAMBo10a.h -l ALL -d $BUILD_TYPE
- bash -x PF-build.sh -v Bear_Cal_FW_MK25S-RAMBo13a.h -l ALL -d $BUILD_TYPE
when:
event:
- push
- tag
- pull_request

- name: prepare-hex
image: vertigo235/fw-build
image: vertigo235/fw-build:1.3
commands:
- cd $DRONE_WORKSPACE
- mkdir out
Expand All @@ -61,7 +61,7 @@ steps:
- build-a-bear

- name: transfersh
image: vertigo235/fw-build:1
image: vertigo235/fw-build:1.3
failure: ignore
commands:
- cd $DRONE_WORKSPACE/fileshare
Expand All @@ -76,7 +76,7 @@ steps:
- prepare-hex

- name: fileio
image: vertigo235/fw-build:1
image: vertigo235/fw-build:1.3
failure: ignore
commands:
- cd $DRONE_WORKSPACE/fileshare
Expand Down
10 changes: 5 additions & 5 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ labels: bug
assignees: ''

---

<!--
Please, before you create a new bug report, please make sure you searched in open and closed issues and couldn't find anything that matches.

-->
**Printer type** - [e.g. MK3S, MK3, MK2.5S, MK2.5, MK2S, MK2]
**Printer firmware version**- [e.g. 3.8.1, 3.8.1-RC1, ...]
**Printer firmware version** - [e.g. 3.8.1, 3.8.1-RC1, ...]

**MMU Upgrade** - [e.g. MMU2S, MMU2, MMU1]
**MMU upgrade firmware version [e.g. 1.0.6, 1.0.6-RC2, ...]
**MMU upgrade** - [e.g. MMU2S, MMU2, MMU1]
**MMU upgrade firmware version** - [e.g. 1.0.6, 1.0.6-RC2, ...]

**SD card or USB/Octoprint**
Please let us know if you print via SD card or USB/Octoprint
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
.project
.cproject
Debug
__pycache__
Firmware/Configuration_prusa.h
Firmware/Doc
/Firmware/.vs/Firmware/v14
Expand Down Expand Up @@ -53,3 +54,5 @@ Firmware/Doc
/Firmware/Firmware.vcxproj
/Firmware/Configuration_prusa_bckp.h
/Firmware/variants/printers.h
Configuration.tmp
config.tmp
22 changes: 17 additions & 5 deletions Firmware/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,19 @@ extern uint16_t nPrinterType;
extern PGM_P sPrinterName;

// Firmware version
#define FW_VERSION "3.9.1"
#define FW_COMMIT_NR 3518
#define FW_MAJOR 3
#define FW_MINOR 10
#define FW_REVISION 1
//#define FW_FLAVOR RC //uncomment if DEBUG, DEVEL, APLHA, BETA or RC
//#define FW_FLAVERSION 1 //uncomment if FW_FLAVOR is defined and versioning is needed.
#ifndef FW_FLAVOR
#define FW_VERSION STR(FW_MAJOR) "." STR(FW_MINOR) "." STR(FW_REVISION)
#else
#define FW_VERSION STR(FW_MAJOR) "." STR(FW_MINOR) "." STR(FW_REVISION) "-" STR(FW_FLAVOR) "" STR(FW_FLAVERSION)
#endif

#define FW_COMMIT_NR 4697

// FW_VERSION_UNKNOWN means this is an unofficial build.
// The firmware should only be checked into github with this symbol.
#define FW_DEV_VERSION FW_VERSION_UNKNOWN
Expand Down Expand Up @@ -551,9 +562,10 @@ enum CalibrationStatus

// Try to maintain a minimum distance from the bed even when Z is
// unknown when doing the following operations
#define MIN_Z_FOR_LOAD 50
#define MIN_Z_FOR_UNLOAD 20
#define MIN_Z_FOR_PREHEAT 10
#define MIN_Z_FOR_LOAD 50 // lcd filament loading or autoload
#define MIN_Z_FOR_UNLOAD 50 // lcd filament unloading
#define MIN_Z_FOR_SWAP 27 // filament change (including M600)
#define MIN_Z_FOR_PREHEAT 10 // lcd preheat

#include "Configuration_adv.h"
#include "thermistortables.h"
Expand Down
34 changes: 23 additions & 11 deletions Firmware/ConfigurationStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void Config_PrintSettings(uint8_t level)
"%SMaximum feedrates - stealth (mm/s):\n%S M203 X%.2f Y%.2f Z%.2f E%.2f\n"
"%SMaximum acceleration - normal (mm/s2):\n%S M201 X%lu Y%lu Z%lu E%lu\n"
"%SMaximum acceleration - stealth (mm/s2):\n%S M201 X%lu Y%lu Z%lu E%lu\n"
"%SAcceleration: S=acceleration, T=retract acceleration\n%S M204 S%.2f T%.2f\n"
"%SAcceleration: P=print, R=retract, T=travel\n%S M204 P%.2f R%.2f T%.2f\n"
"%SAdvanced variables: S=Min feedrate (mm/s), T=Min travel feedrate (mm/s), B=minimum segment time (ms), X=maximum XY jerk (mm/s), Z=maximum Z jerk (mm/s), E=maximum E jerk (mm/s)\n%S M205 S%.2f T%.2f B%.2f X%.2f Y%.2f Z%.2f E%.2f\n"
"%SHome offset (mm):\n%S M206 X%.2f Y%.2f Z%.2f\n"
),
Expand All @@ -106,22 +106,22 @@ void Config_PrintSettings(uint8_t level)
echomagic, echomagic, cs.max_feedrate_silent[X_AXIS], cs.max_feedrate_silent[Y_AXIS], cs.max_feedrate_silent[Z_AXIS], cs.max_feedrate_silent[E_AXIS],
echomagic, echomagic, cs.max_acceleration_units_per_sq_second_normal[X_AXIS], cs.max_acceleration_units_per_sq_second_normal[Y_AXIS], cs.max_acceleration_units_per_sq_second_normal[Z_AXIS], cs.max_acceleration_units_per_sq_second_normal[E_AXIS],
echomagic, echomagic, cs.max_acceleration_units_per_sq_second_silent[X_AXIS], cs.max_acceleration_units_per_sq_second_silent[Y_AXIS], cs.max_acceleration_units_per_sq_second_silent[Z_AXIS], cs.max_acceleration_units_per_sq_second_silent[E_AXIS],
echomagic, echomagic, cs.acceleration, cs.retract_acceleration,
echomagic, echomagic, cs.acceleration, cs.retract_acceleration, cs.travel_acceleration,
echomagic, echomagic, cs.minimumfeedrate, cs.mintravelfeedrate, cs.minsegmenttime, cs.max_jerk[X_AXIS], cs.max_jerk[Y_AXIS], cs.max_jerk[Z_AXIS], cs.max_jerk[E_AXIS],
echomagic, echomagic, cs.add_homing[X_AXIS], cs.add_homing[Y_AXIS], cs.add_homing[Z_AXIS]
#else //TMC2130
printf_P(PSTR(
"%SSteps per unit:\n%S M92 X%.2f Y%.2f Z%.2f E%.2f\n"
"%SMaximum feedrates (mm/s):\n%S M203 X%.2f Y%.2f Z%.2f E%.2f\n"
"%SMaximum acceleration (mm/s2):\n%S M201 X%lu Y%lu Z%lu E%lu\n"
"%SAcceleration: S=acceleration, T=retract acceleration\n%S M204 S%.2f T%.2f\n"
"%SAcceleration: P=print, R=retract, T=travel\n%S M204 P%.2f R%.2f T%.2f\n"
"%SAdvanced variables: S=Min feedrate (mm/s), T=Min travel feedrate (mm/s), B=minimum segment time (ms), X=maximum XY jerk (mm/s), Z=maximum Z jerk (mm/s), E=maximum E jerk (mm/s)\n%S M205 S%.2f T%.2f B%.2f X%.2f Y%.2f Z%.2f E%.2f\n"
"%SHome offset (mm):\n%S M206 X%.2f Y%.2f Z%.2f\n"
),
echomagic, echomagic, cs.axis_steps_per_unit[X_AXIS], cs.axis_steps_per_unit[Y_AXIS], cs.axis_steps_per_unit[Z_AXIS], cs.axis_steps_per_unit[E_AXIS],
echomagic, echomagic, max_feedrate[X_AXIS], max_feedrate[Y_AXIS], max_feedrate[Z_AXIS], max_feedrate[E_AXIS],
echomagic, echomagic, max_acceleration_units_per_sq_second[X_AXIS], max_acceleration_units_per_sq_second[Y_AXIS], max_acceleration_units_per_sq_second[Z_AXIS], max_acceleration_units_per_sq_second[E_AXIS],
echomagic, echomagic, cs.acceleration, cs.retract_acceleration,
echomagic, echomagic, cs.acceleration, cs.retract_acceleration, cs.travel_acceleration,
echomagic, echomagic, cs.minimumfeedrate, cs.mintravelfeedrate, cs.minsegmenttime, cs.max_jerk[X_AXIS], cs.max_jerk[Y_AXIS], cs.max_jerk[Z_AXIS], cs.max_jerk[E_AXIS],
echomagic, echomagic, cs.add_homing[X_AXIS], cs.add_homing[Y_AXIS], cs.add_homing[Z_AXIS]
#endif //TMC2130
Expand Down Expand Up @@ -184,7 +184,7 @@ static_assert (false, "zprobe_zoffset was not initialized in printers in field t
"0.0, if this is not acceptable, increment EEPROM_VERSION to force use default_conf");
#endif

static_assert (sizeof(M500_conf) == 192, "sizeof(M500_conf) has changed, ensure that EEPROM_VERSION has been incremented, "
static_assert (sizeof(M500_conf) == 196, "sizeof(M500_conf) has changed, ensure that EEPROM_VERSION has been incremented, "
"or if you added members in the end of struct, ensure that historically uninitialized values will be initialized."
"If this is caused by change to more then 8bit processor, decide whether make this struct packed to save EEPROM,"
"leave as it is to keep fast code, or reorder struct members to pack more tightly.");
Expand Down Expand Up @@ -232,8 +232,21 @@ static const M500_conf default_conf PROGMEM =
#else // TMC2130
{16,16,16,16},
#endif
DEFAULT_TRAVEL_ACCELERATION,
};


static bool is_uninitialized(void* addr, uint8_t len)
{
while(len--)
{
if(reinterpret_cast<uint8_t*>(addr)[len] != 0xff)
return false;
}
return true;
}


//! @brief Read M500 configuration
//! @retval true Succeeded. Stored settings retrieved or default settings retrieved in case EEPROM has been erased.
//! @retval false Failed. Default settings has been retrieved, because of older version or corrupted data.
Expand All @@ -257,13 +270,9 @@ bool Config_RetrieveSettings()
for (uint8_t i = 0; i < (sizeof(cs.max_feedrate_silent)/sizeof(cs.max_feedrate_silent[0])); ++i)
{
const uint32_t erased = 0xffffffff;
bool initialized = false;

for(uint8_t j = 0; j < sizeof(float); ++j)
{
if(0xff != reinterpret_cast<uint8_t*>(&(cs.max_feedrate_silent[i]))[j]) initialized = true;
if (is_uninitialized(&(cs.max_feedrate_silent[i]), sizeof(float))) {
memcpy_P(&cs.max_feedrate_silent[i],&default_conf.max_feedrate_silent[i], sizeof(cs.max_feedrate_silent[i]));
}
if (!initialized) memcpy_P(&cs.max_feedrate_silent[i],&default_conf.max_feedrate_silent[i], sizeof(cs.max_feedrate_silent[i]));
if (erased == cs.max_acceleration_units_per_sq_second_silent[i]) {
memcpy_P(&cs.max_acceleration_units_per_sq_second_silent[i],&default_conf.max_acceleration_units_per_sq_second_silent[i],sizeof(cs.max_acceleration_units_per_sq_second_silent[i]));
}
Expand Down Expand Up @@ -293,6 +302,9 @@ bool Config_RetrieveSettings()
tmc2130_set_res(E_AXIS, cs.axis_ustep_resolution[E_AXIS]);
#endif //TMC2130

if(is_uninitialized(&cs.travel_acceleration, sizeof(cs.travel_acceleration)))
cs.travel_acceleration = cs.acceleration;

reset_acceleration_rates();

// Call updatePID (similar to when we have processed M301)
Expand Down
1 change: 1 addition & 0 deletions Firmware/ConfigurationStore.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ typedef struct
float max_feedrate_silent[4]; //!< max speeds for silent mode
unsigned long max_acceleration_units_per_sq_second_silent[4];
unsigned char axis_ustep_resolution[4];
float travel_acceleration; //!< travel acceleration mm/s^2
} M500_conf;

extern M500_conf cs;
Expand Down
47 changes: 32 additions & 15 deletions Firmware/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,19 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
#define FAN_KICKSTART_TIME 800



/**
* Auto-report all at once with M155 S<seconds> C[bitmask] with single timer
*
* bit 0 = Auto-report temperatures
* bit 1 = Auto-report fans
* bit 2 = Auto-report position
* bit 3 = free
* bit 4 = free
* bit 5 = free
* bit 6 = free
* bit 7 = free
*/
#define AUTO_REPORT

//===========================================================================
//=============================Mechanical Settings===========================
Expand Down Expand Up @@ -220,33 +231,23 @@
* SD sorting uses static allocation (as set by SDSORT_LIMIT), allowing the
* compiler to calculate the worst-case usage and throw an error if the SRAM
* limit is exceeded.
*
* - SDSORT_USES_RAM provides faster sorting via a static directory buffer.
* - SDSORT_USES_STACK does the same, but uses a local stack-based buffer.
* - SDSORT_CACHE_NAMES will retain the sorted file listing in RAM. (Expensive!)
* - SDSORT_DYNAMIC_RAM only uses RAM when the SD menu is visible. (Use with caution!)
*/
#define SDCARD_SORT_ALPHA //Alphabetical sorting of SD files menu

// SD Card Sorting options
// In current firmware Prusa Firmware version,
// SDSORT_CACHE_NAMES and SDSORT_DYNAMIC_RAM is not supported and must be set to 0.
#ifdef SDCARD_SORT_ALPHA
#define SD_SORT_TIME 0
#define SD_SORT_ALPHA 1
#define SD_SORT_NONE 2
// #define SHELLSORT
// #define SORTING_DUMP

#define SDSORT_LIMIT 100 // Maximum number of sorted items (10-256).
#define FOLDER_SORTING -1 // -1=above 0=none 1=below
#define SDSORT_GCODE 0 // Allow turning sorting on/off with LCD and M34 g-code.
#define SDSORT_USES_RAM 0 // Pre-allocate a static array for faster pre-sorting.
#define SDSORT_USES_STACK 0 // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.)
#define SDSORT_CACHE_NAMES 0 // Keep sorted items in RAM longer for speedy performance. Most expensive option.
#define SDSORT_DYNAMIC_RAM 0 // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use!
#endif

#if defined(SDCARD_SORT_ALPHA)
#define HAS_FOLDER_SORTING (FOLDER_SORTING || SDSORT_GCODE)
#define HAS_FOLDER_SORTING (FOLDER_SORTING)
#endif

// Enable the option to stop SD printing when hitting and endstops, needs to be enabled from the LCD menu when this option is enabled.
Expand Down Expand Up @@ -327,6 +328,11 @@ const unsigned int dropsegments=5; //everything with less than this number of st
// Control heater 0 and heater 1 in parallel.
//#define HEATERS_PARALLEL

//LCD status clock interval timer to switch between
// remaining print time
// and time to change/pause/interaction
#define CLOCK_INTERVAL_TIME 5

//===========================================================================
//=============================Buffers ============================
//===========================================================================
Expand Down Expand Up @@ -376,6 +382,17 @@ const unsigned int dropsegments=5; //everything with less than this number of st
#endif
#endif

/**
* Include capabilities in M115 output
*/
#define EXTENDED_CAPABILITIES_REPORT

/**
* Enable M120/M121 G-code commands
*
*/
//#define M120_M121_ENABLED //Be careful enabling and using these G-code commands.

//===========================================================================
//============================= Define Defines ============================
//===========================================================================
Expand Down
Loading

0 comments on commit 0a62763

Please sign in to comment.