Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into ender3v2_bu…
Browse files Browse the repository at this point in the history
…gfix

* upstream/bugfix-2.0.x: (125 commits)
  [cron] Bump distribution date (2021-05-16)
  Update Hex Version to 02000801
  M154 Position Auto-Report (MarlinFirmware#18427)
  Fix MKS UI missing font select condition (MarlinFirmware#21905)
  Fix G29_RETRY_AND_RECOVER dependency (MarlinFirmware#21907)
  [cron] Bump distribution date (2021-05-15)
  🚑️ Fix TFT for Robin Pro (MarlinFirmware#21900)
  🚑️ BTT Octopus Step Timer (MarlinFirmware#21901)
  🐛 Fix RR collision with MM (MarlinFirmware#21902)
  ✨ Instant Freeze/Resume Function (MarlinFirmware#17462)
  [cron] Bump distribution date (2021-05-14)
  Fix Octopus 12864 LCD Delays (MarlinFirmware#21883)
  Fix nextion compile error  (MarlinFirmware#21884)
  Fix compilation failure in M1001 (MarlinFirmware#21897)
  fix compilation for home hon top (MarlinFirmware#21894)
  🔧 Improve SD_DETECT_STATE default (MarlinFirmware#21885)
  [cron] Bump distribution date (2021-05-13)
  Clean up hasty PR
  Update Robin Pro TFT Pins (MarlinFirmware#21879)
  minor multi volume config typo (MarlinFirmware#21880)
  ...
  • Loading branch information
Michael authored and Michael committed May 16, 2021
2 parents 1945af2 + 533ba2a commit 8e4b67d
Show file tree
Hide file tree
Showing 631 changed files with 9,958 additions and 5,375 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ jobs:

# STM32 (ST) Environments

- STM32F103RC_btt_stm32
- STM32F407VE_black
- STM32F401VE_STEVAL
- BIGTREE_BTT002
Expand All @@ -86,6 +87,7 @@ jobs:
- FLYF407ZG
- rumba32
- LERDGEX
- LERDGEK
- mks_robin_nano35_stm32
- NUCLEO_F767ZI
- REMRAM_V1
Expand Down
16 changes: 13 additions & 3 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
*
* Advanced settings can be found in Configuration_adv.h
*/
#define CONFIGURATION_H_VERSION 020008
#define CONFIGURATION_H_VERSION 02000801

//===========================================================================
//============================= Getting Started =============================
Expand Down Expand Up @@ -111,6 +111,13 @@
*/
//#define SERIAL_PORT_2 -1

/**
* Select a third serial port on the board to use for communication with the host.
* Currently only supported for AVR, DUE, LPC1768/9 and STM32/STM32F1
* :[-1, 0, 1, 2, 3, 4, 5, 6, 7]
*/
//#define SERIAL_PORT_3 1

/**
* This setting determines the communication speed of the printer.
*
Expand Down Expand Up @@ -1497,6 +1504,8 @@
//#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used
// as the Z-Height correction value.

//#define UBL_MESH_WIZARD // Run several commands in a row to get a complete mesh

#elif ENABLED(MESH_BED_LEVELING)

//===========================================================================
Expand Down Expand Up @@ -2264,7 +2273,8 @@
// MKS LCD12864A/B with graphic controller and SD support. Follows MKS_MINI_12864 pinout.
// https://www.aliexpress.com/item/33018110072.html
//
//#define MKS_LCD12864
//#define MKS_LCD12864A
//#define MKS_LCD12864B

//
// FYSETC variant of the MINI12864 graphic controller with SD support
Expand Down Expand Up @@ -2572,7 +2582,7 @@
#define DWIN_CREALITY_LCD

//
// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8
// Touch Screen Settings
//
//#define TOUCH_SCREEN
#if ENABLED(TOUCH_SCREEN)
Expand Down
52 changes: 37 additions & 15 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*
* Basic settings can be found in Configuration.h
*/
#define CONFIGURATION_ADV_H_VERSION 020008
#define CONFIGURATION_ADV_H_VERSION 02000801

//===========================================================================
//============================= Thermal Settings ============================
Expand Down Expand Up @@ -1487,8 +1487,8 @@
#if ENABLED(MULTI_VOLUME)
#define VOLUME_SD_ONBOARD
#define VOLUME_USB_FLASH_DRIVE
#define DEFAULT_VOLUME SD_ONBOARD
#define DEFAULT_SHARED_VOLUME USB_FLASH_DRIVE
#define DEFAULT_VOLUME SV_SD_ONBOARD
#define DEFAULT_SHARED_VOLUME SV_USB_FLASH_DRIVE
#endif

#endif // SDSUPPORT
Expand Down Expand Up @@ -2302,14 +2302,15 @@
#endif // HAS_MULTI_EXTRUDER

/**
* Advanced Pause
* Experimental feature for filament change support and for parking the nozzle when paused.
* Adds the GCode M600 for initiating filament change.
* If PARK_HEAD_ON_PAUSE enabled, adds the GCode M125 to pause printing and park the nozzle.
* Advanced Pause for Filament Change
* - Adds the G-code M600 Filament Change to initiate a filament change.
* - This feature is required for the default FILAMENT_RUNOUT_SCRIPT.
*
* Requires an LCD display.
* Requires NOZZLE_PARK_FEATURE.
* This feature is required for the default FILAMENT_RUNOUT_SCRIPT.
* Requirements:
* - For Filament Change parking enable and configure NOZZLE_PARK_FEATURE.
* - For user interaction enable an LCD display, HOST_PROMPT_SUPPORT, or EMERGENCY_PARSER.
*
* Enable PARK_HEAD_ON_PAUSE to add the G-code M125 Pause and Park.
*/
#define ADVANCED_PAUSE_FEATURE
#if ENABLED(ADVANCED_PAUSE_FEATURE)
Expand Down Expand Up @@ -3167,13 +3168,19 @@
//#define AIR_EVACUATION // Cutter Vacuum / Laser Blower motor control with G-codes M10-M11
#if ENABLED(AIR_EVACUATION)
#define AIR_EVACUATION_ACTIVE LOW // Set to "HIGH" if the on/off function is active HIGH
#define AIR_EVACUATION_PIN 42 // Override the default Cutter Vacuum or Laser Blower pin
//#define AIR_EVACUATION_PIN 42 // Override the default Cutter Vacuum or Laser Blower pin
#endif

//#define AIR_ASSIST // Air Assist control with G-codes M8-M9
#if ENABLED(AIR_ASSIST)
#define AIR_ASSIST_ACTIVE LOW // Active state on air assist pin
//#define AIR_ASSIST_PIN 44 // Override the default Air Assist pin
#endif

//#define SPINDLE_SERVO // A servo converting an angle to spindle power
//#define SPINDLE_SERVO // A servo converting an angle to spindle power
#ifdef SPINDLE_SERVO
#define SPINDLE_SERVO_NR 0 // Index of servo used for spindle control
#define SPINDLE_SERVO_MIN 10 // Minimum angle for servo spindle
#define SPINDLE_SERVO_NR 0 // Index of servo used for spindle control
#define SPINDLE_SERVO_MIN 10 // Minimum angle for servo spindle
#endif

/**
Expand Down Expand Up @@ -3410,6 +3417,11 @@
*/
#define AUTO_REPORT_TEMPERATURES

/**
* Auto-report position with M154 S<seconds>
*/
//#define AUTO_REPORT_POSITION

/**
* Include capabilities in M115 output
*/
Expand Down Expand Up @@ -3479,7 +3491,7 @@
#define PROPORTIONAL_FONT_RATIO 1.0

/**
* Spend 28 bytes of SRAM to optimize the GCode parser
* Spend 28 bytes of SRAM to optimize the G-code parser
*/
#define FASTER_GCODE_PARSER

Expand Down Expand Up @@ -3775,6 +3787,16 @@
#define GANTRY_CALIBRATION_COMMANDS_POST "G28" // G28 highly recommended to ensure an accurate position
#endif

/**
* Instant freeze / unfreeze functionality
* Specified pin has pullup and connecting to ground will instantly pause motion.
* Potentially useful for emergency stop that allows being resumed.
*/
//#define FREEZE_FEATURE
#if ENABLED(FREEZE_FEATURE)
//#define FREEZE_PIN 41 // Override the default (KILL) pin here
#endif

/**
* MAX7219 Debug Matrix
*
Expand Down
15 changes: 11 additions & 4 deletions Marlin/src/HAL/AVR/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,28 +93,35 @@ typedef int8_t pin_t;
#define MYSERIAL1 TERN(BLUETOOTH, btSerial, MSerial0)
#else
#if !WITHIN(SERIAL_PORT, -1, 3)
#error "SERIAL_PORT must be from 0 to 3. You can also use -1 if the board supports Native USB."
#error "SERIAL_PORT must be from 0 to 3, or -1 for USB Serial."
#endif
#define MYSERIAL1 customizedSerial1

#ifdef SERIAL_PORT_2
#if !WITHIN(SERIAL_PORT_2, -1, 3)
#error "SERIAL_PORT_2 must be from 0 to 3. You can also use -1 if the board supports Native USB."
#error "SERIAL_PORT_2 must be from 0 to 3, or -1 for USB Serial."
#endif
#define MYSERIAL2 customizedSerial2
#endif

#ifdef SERIAL_PORT_3
#if !WITHIN(SERIAL_PORT_3, -1, 3)
#error "SERIAL_PORT_3 must be from 0 to 3, or -1 for USB Serial."
#endif
#define MYSERIAL3 customizedSerial3
#endif
#endif

#ifdef MMU2_SERIAL_PORT
#if !WITHIN(MMU2_SERIAL_PORT, -1, 3)
#error "MMU2_SERIAL_PORT must be from 0 to 3. You can also use -1 if the board supports Native USB."
#error "MMU2_SERIAL_PORT must be from 0 to 3, or -1 for USB Serial."
#endif
#define MMU2_SERIAL mmuSerial
#endif

#ifdef LCD_SERIAL_PORT
#if !WITHIN(LCD_SERIAL_PORT, -1, 3)
#error "LCD_SERIAL_PORT must be from 0 to 3. You can also use -1 if the board supports Native USB."
#error "LCD_SERIAL_PORT must be from 0 to 3, or -1 for USB Serial."
#endif
#define LCD_SERIAL lcdSerial
#if HAS_DGUS_LCD
Expand Down
32 changes: 25 additions & 7 deletions Marlin/src/HAL/AVR/MarlinSerial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ ISR(SERIAL_REGNAME(USART, SERIAL_PORT, _UDRE_vect)) {

// Because of the template definition above, it's required to instantiate the template to have all methods generated
template class MarlinSerial< MarlinSerialCfg<SERIAL_PORT> >;
MSerialT customizedSerial1(MSerialT::HasEmergencyParser);
MSerialT1 customizedSerial1(MSerialT1::HasEmergencyParser);

#ifdef SERIAL_PORT_2

Expand All @@ -582,7 +582,24 @@ MSerialT customizedSerial1(MSerialT::HasEmergencyParser);

template class MarlinSerial< MarlinSerialCfg<SERIAL_PORT_2> >;
MSerialT2 customizedSerial2(MSerialT2::HasEmergencyParser);
#endif

#endif // SERIAL_PORT_2

#ifdef SERIAL_PORT_3

// Hookup ISR handlers
ISR(SERIAL_REGNAME(USART, SERIAL_PORT_3, _RX_vect)) {
MarlinSerial<MarlinSerialCfg<SERIAL_PORT_3>>::store_rxd_char();
}

ISR(SERIAL_REGNAME(USART, SERIAL_PORT_3, _UDRE_vect)) {
MarlinSerial<MarlinSerialCfg<SERIAL_PORT_3>>::_tx_udr_empty_irq();
}

template class MarlinSerial< MarlinSerialCfg<SERIAL_PORT_3> >;
MSerialT3 customizedSerial3(MSerialT3::HasEmergencyParser);

#endif // SERIAL_PORT_3

#ifdef MMU2_SERIAL_PORT

Expand All @@ -595,8 +612,9 @@ MSerialT customizedSerial1(MSerialT::HasEmergencyParser);
}

template class MarlinSerial< MMU2SerialCfg<MMU2_SERIAL_PORT> >;
MSerialT3 mmuSerial(MSerialT3::HasEmergencyParser);
#endif
MSerialMMU2 mmuSerial(MSerialMMU2::HasEmergencyParser);

#endif // MMU2_SERIAL_PORT

#ifdef LCD_SERIAL_PORT

Expand All @@ -609,7 +627,7 @@ MSerialT customizedSerial1(MSerialT::HasEmergencyParser);
}

template class MarlinSerial< LCDSerialCfg<LCD_SERIAL_PORT> >;
MSerialT4 lcdSerial(MSerialT4::HasEmergencyParser);
MSerialLCD lcdSerial(MSerialLCD::HasEmergencyParser);

#if HAS_DGUS_LCD
template<typename Cfg>
Expand All @@ -622,13 +640,13 @@ MSerialT customizedSerial1(MSerialT::HasEmergencyParser);
}
#endif

#endif
#endif // LCD_SERIAL_PORT

#endif // !USBCON && (UBRRH || UBRR0H || UBRR1H || UBRR2H || UBRR3H)

// For AT90USB targets use the UART for BT interfacing
#if defined(USBCON) && ENABLED(BLUETOOTH)
MSerialT5 bluetoothSerial(false);
MSerialBT bluetoothSerial(false);
#endif

#endif // __AVR__
21 changes: 13 additions & 8 deletions Marlin/src/HAL/AVR/MarlinSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,14 +238,19 @@
static constexpr bool MAX_RX_QUEUED = ENABLED(SERIAL_STATS_MAX_RX_QUEUED);
};

typedef Serial1Class< MarlinSerial< MarlinSerialCfg<SERIAL_PORT> > > MSerialT;
extern MSerialT customizedSerial1;
typedef Serial1Class< MarlinSerial< MarlinSerialCfg<SERIAL_PORT> > > MSerialT1;
extern MSerialT1 customizedSerial1;

#ifdef SERIAL_PORT_2
typedef Serial1Class< MarlinSerial< MarlinSerialCfg<SERIAL_PORT_2> > > MSerialT2;
extern MSerialT2 customizedSerial2;
#endif

#ifdef SERIAL_PORT_3
typedef Serial1Class< MarlinSerial< MarlinSerialCfg<SERIAL_PORT_3> > > MSerialT3;
extern MSerialT3 customizedSerial3;
#endif

#endif // !USBCON

#ifdef MMU2_SERIAL_PORT
Expand All @@ -262,8 +267,8 @@
static constexpr bool RX_OVERRUNS = false;
};

typedef Serial1Class< MarlinSerial< MMU2SerialCfg<MMU2_SERIAL_PORT> > > MSerialT3;
extern MSerialT3 mmuSerial;
typedef Serial1Class< MarlinSerial< MMU2SerialCfg<MMU2_SERIAL_PORT> > > MSerialMMU2;
extern MSerialMMU2 mmuSerial;
#endif

#ifdef LCD_SERIAL_PORT
Expand All @@ -281,12 +286,12 @@
static constexpr bool RX_OVERRUNS = BOTH(HAS_DGUS_LCD, SERIAL_STATS_RX_BUFFER_OVERRUNS);
};

typedef Serial1Class< MarlinSerial< LCDSerialCfg<LCD_SERIAL_PORT> > > MSerialT4;
extern MSerialT4 lcdSerial;
typedef Serial1Class< MarlinSerial< LCDSerialCfg<LCD_SERIAL_PORT> > > MSerialLCD;
extern MSerialLCD lcdSerial;
#endif

// Use the UART for Bluetooth in AT90USB configurations
#if defined(USBCON) && ENABLED(BLUETOOTH)
typedef Serial1Class<HardwareSerial> MSerialT5;
extern MSerialT5 bluetoothSerial;
typedef Serial1Class<HardwareSerial> MSerialBT;
extern MSerialBT bluetoothSerial;
#endif
21 changes: 14 additions & 7 deletions Marlin/src/HAL/DUE/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,12 @@ extern DefaultSerial4 MSerial3;
#define _MSERIAL(X) MSerial##X
#define MSERIAL(X) _MSERIAL(X)

// Define MYSERIAL1/2 before MarlinSerial includes!
#if SERIAL_PORT == -1 || ENABLED(EMERGENCY_PARSER)
#define MYSERIAL1 customizedSerial1
#elif WITHIN(SERIAL_PORT, 0, 3)
#define MYSERIAL1 MSERIAL(SERIAL_PORT)
#else
#error "The required SERIAL_PORT must be from 0 to 3. You can also use -1 if the board supports Native USB."
#error "The required SERIAL_PORT must be from 0 to 3, or -1 for USB Serial."
#endif

#ifdef SERIAL_PORT_2
Expand All @@ -65,7 +64,17 @@ extern DefaultSerial4 MSerial3;
#elif WITHIN(SERIAL_PORT_2, 0, 3)
#define MYSERIAL2 MSERIAL(SERIAL_PORT_2)
#else
#error "SERIAL_PORT_2 must be from 0 to 3. You can also use -1 if the board supports Native USB."
#error "SERIAL_PORT_2 must be from 0 to 3, or -1 for USB Serial."
#endif
#endif

#ifdef SERIAL_PORT_3
#if SERIAL_PORT_3 == -1 || ENABLED(EMERGENCY_PARSER)
#define MYSERIAL3 customizedSerial3
#elif WITHIN(SERIAL_PORT_3, 0, 3)
#define MYSERIAL3 MSERIAL(SERIAL_PORT_3)
#else
#error "SERIAL_PORT_3 must be from 0 to 3, or -1 for USB Serial."
#endif
#endif

Expand All @@ -78,12 +87,10 @@ extern DefaultSerial4 MSerial3;
#endif

#ifdef LCD_SERIAL_PORT
#if LCD_SERIAL_PORT == -1
#define LCD_SERIAL lcdSerial
#elif WITHIN(LCD_SERIAL_PORT, 0, 3)
#if WITHIN(LCD_SERIAL_PORT, 0, 3)
#define LCD_SERIAL MSERIAL(LCD_SERIAL_PORT)
#else
#error "LCD_SERIAL_PORT must be from 0 to 3. You can also use -1 if the board supports Native USB."
#error "LCD_SERIAL_PORT must be from 0 to 3."
#endif
#endif

Expand Down
Loading

0 comments on commit 8e4b67d

Please sign in to comment.