Skip to content

Commit

Permalink
Merge branch 'bugfix-2.0.x' into 2.0.x-Sapphire-Pro
Browse files Browse the repository at this point in the history
  • Loading branch information
petrzmax committed Mar 19, 2020
2 parents 2f76ba7 + 14daf1e commit dcddbf1
Show file tree
Hide file tree
Showing 724 changed files with 1,701 additions and 1,085 deletions.
4 changes: 3 additions & 1 deletion Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
* Advanced settings can be found in Configuration_adv.h
*
*/
#define CONFIGURATION_H_VERSION 020004
#define CONFIGURATION_H_VERSION 020005

//===========================================================================
//============================= Getting Started =============================
Expand Down Expand Up @@ -363,6 +363,7 @@
* 331 : (3.3V scaled thermistor 1 table for MEGA)
* 332 : (3.3V scaled thermistor 1 table for DUE)
* 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup)
* 202 : 200k thermistor - Copymaster 3D
* 3 : Mendel-parts thermistor (4.7k pullup)
* 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !!
* 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup)
Expand Down Expand Up @@ -1465,6 +1466,7 @@
#define EEPROM_SETTINGS // Persistent storage with M500 and M501
//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release!
#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM.
#define EEPROM_BOOT_SILENT // Keep M503 quiet and only give errors during first load
#if ENABLED(EEPROM_SETTINGS)
#define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors.
#endif
Expand Down
35 changes: 23 additions & 12 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* Basic settings can be found in Configuration.h
*
*/
#define CONFIGURATION_ADV_H_VERSION 020004
#define CONFIGURATION_ADV_H_VERSION 020005

// @section temperature

Expand Down Expand Up @@ -338,15 +338,22 @@
* Controller Fan
* To cool down the stepper drivers and MOSFETs.
*
* The fan will turn on automatically whenever any stepper is enabled
* and turn off after a set period after all steppers are turned off.
* The fan turns on automatically whenever any driver is enabled and turns
* off (or reduces to idle speed) shortly after drivers are turned off.
*
*/
//#define USE_CONTROLLER_FAN
#if ENABLED(USE_CONTROLLER_FAN)
//#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan
#define CONTROLLERFAN_SECS 60 // Duration in seconds for the fan to run after all motors are disabled
#define CONTROLLERFAN_SPEED 255 // 255 == full speed
//#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled
//#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan
//#define CONTROLLER_FAN_USE_Z_ONLY // With this option only the Z axis is considered
#define CONTROLLERFAN_SPEED_MIN 0 // (0-255) Minimum speed. (If set below this value the fan is turned off.)
#define CONTROLLERFAN_SPEED_ACTIVE 255 // (0-255) Active speed, used when any motor is enabled
#define CONTROLLERFAN_SPEED_IDLE 0 // (0-255) Idle speed, used when motors are disabled
#define CONTROLLERFAN_IDLE_TIME 60 // (seconds) Extra time to keep the fan running after disabling motors
//#define CONTROLLER_FAN_EDITABLE // Enable M710 configurable settings
#if ENABLED(CONTROLLER_FAN_EDITABLE)
#define CONTROLLER_FAN_MENU // Enable the Controller Fan submenu
#endif
#endif

// When first starting the main fan, run it at full speed for the
Expand Down Expand Up @@ -753,8 +760,12 @@
// Minimum time that a segment needs to take if the buffer is emptied
#define DEFAULT_MINSEGMENTTIME 20000 // (ms)

// If defined the movements slow down when the look ahead buffer is only half full
// Slow down the machine if the look ahead buffer is (by default) half full.
// Increase the slowdown divisor for larger buffer sizes.
#define SLOWDOWN
#if ENABLED(SLOWDOWN)
#define SLOWDOWN_DIVISOR 2
#endif

// Frequency limit
// See nophead's blog for more info
Expand Down Expand Up @@ -999,7 +1010,7 @@
#define BOOTSCREEN_TIMEOUT 4000 // (ms) Total Duration to display the boot screen(s)
#endif

#if HAS_GRAPHICAL_LCD && HAS_PRINT_PROGRESS
#if HAS_GRAPHICAL_LCD && EITHER(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY)
//#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits
//#define SHOW_REMAINING_TIME // Display estimated time to completion
#if ENABLED(SHOW_REMAINING_TIME)
Expand All @@ -1008,7 +1019,7 @@
#endif
#endif

#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS
#if HAS_CHARACTER_LCD && EITHER(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY)
//#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing
#if ENABLED(LCD_PROGRESS_BAR)
#define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar
Expand Down Expand Up @@ -1302,9 +1313,9 @@
#define DGUS_PREHEAT_UI // Display a preheat screen during heatup

#if ENABLED(DGUS_LCD_UI_FYSETC)
//#define DUGS_UI_MOVE_DIS_OPTION // Disabled by default for UI_FYSETC
//#define DGUS_UI_MOVE_DIS_OPTION // Disabled by default for UI_FYSETC
#else
#define DUGS_UI_MOVE_DIS_OPTION // Enabled by default for UI_HIPRECY
#define DGUS_UI_MOVE_DIS_OPTION // Enabled by default for UI_HIPRECY
#endif

#define DGUS_FILAMENT_LOADUNLOAD
Expand Down
2 changes: 2 additions & 0 deletions Marlin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,8 @@ else ifeq ($(HARDWARE_MOTHERBOARD),1147)
else ifeq ($(HARDWARE_MOTHERBOARD),1148)
# MKS GEN L V2
else ifeq ($(HARDWARE_MOTHERBOARD),1149)
# Copymaster 3D
else ifeq ($(HARDWARE_MOTHERBOARD),1150)

#
# RAMBo and derivatives
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ void spiBegin() {
// output pin high - like sending 0xFF
WRITE(MOSI_PIN, HIGH);

for (uint8_t i = 0; i < 8; i++) {
LOOP_L_N(i, 8) {
WRITE(SCK_PIN, HIGH);

nop; // adjust so SCK is nice
Expand All @@ -224,7 +224,7 @@ void spiBegin() {
void spiSend(uint8_t data) {
// no interrupts during byte send - about 8µs
cli();
for (uint8_t i = 0; i < 8; i++) {
LOOP_L_N(i, 8) {
WRITE(SCK_PIN, LOW);
WRITE(MOSI_PIN, data & 0x80);
data <<= 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
// A SW memory barrier, to ensure GCC does not overoptimize loops
#define sw_barrier() asm volatile("": : :"memory");

#include "../../feature/emergency_parser.h"
#include "../../feature/e_parser.h"

// "Atomically" read the RX head index value without disabling interrupts:
// This MUST be called with RX interrupts enabled, and CAN'T be called
Expand Down Expand Up @@ -682,7 +682,7 @@

// Round correctly so that print(1.999, 2) prints as "2.00"
double rounding = 0.5;
for (uint8_t i = 0; i < digits; ++i) rounding *= 0.1;
LOOP_L_N(i, digits) rounding *= 0.1;
number += rounding;

// Extract the integer part of the number and print it
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ void set_pwm_frequency(const pin_t pin, int f_desired) {
uint16_t prescaler[] = { 0, 1, 8, /*TIMER2 ONLY*/32, 64, /*TIMER2 ONLY*/128, 256, 1024 };

// loop over prescaler values
for (uint8_t i = 1; i < 8; i++) {
LOOP_S_L_N(i, 1, 8) {
uint16_t res_temp_fast = 255, res_temp_phase_correct = 255;
if (timer.n == 2) {
// No resolution calculation for TIMER2 unless enabled USE_OCR2A_AS_TOP
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@

void PRINT_ARRAY_NAME(uint8_t x) {
char *name_mem_pointer = (char*)pgm_read_ptr(&pin_array[x].name);
for (uint8_t y = 0; y < MAX_NAME_LENGTH; y++) {
LOOP_L_N(y, MAX_NAME_LENGTH) {
char temp_char = pgm_read_byte(name_mem_pointer + y);
if (temp_char != 0)
SERIAL_CHAR(temp_char);
else {
for (uint8_t i = 0; i < MAX_NAME_LENGTH - y; i++) SERIAL_CHAR(' ');
LOOP_L_N(i, MAX_NAME_LENGTH - y) SERIAL_CHAR(' ');
break;
}
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ void u8g_spiSend_sw_AVR_mode_0(uint8_t val) {
volatile uint8_t *outData = u8g_outData,
*outClock = u8g_outClock;
U8G_ATOMIC_START();
for (uint8_t i = 0; i < 8; i++) {
LOOP_L_N(i, 8) {
if (val & 0x80)
*outData |= bitData;
else
Expand All @@ -108,7 +108,7 @@ void u8g_spiSend_sw_AVR_mode_3(uint8_t val) {
volatile uint8_t *outData = u8g_outData,
*outClock = u8g_outClock;
U8G_ATOMIC_START();
for (uint8_t i = 0; i < 8; i++) {
LOOP_L_N(i, 8) {
*outClock &= bitNotClock;
if (val & 0x80)
*outData |= bitData;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

#include "../../inc/MarlinConfig.h"

#if ENABLED(EEPROM_SETTINGS) && NONE(I2C_EEPROM, SPI_EEPROM)
#if ENABLED(FLASH_EEPROM_EMULATION)

#include "../shared/Marduino.h"
#include "../shared/persistent_store_api.h"
Expand Down Expand Up @@ -1016,5 +1016,5 @@ void eeprom_flush() {
ee_Flush();
}

#endif // EEPROM_SETTINGS && (!I2C_EEPROM && !SPI_EEPROM)
#endif // FLASH_EEPROM_EMULATION
#endif // ARDUINO_ARCH_AVR
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ template<typename Cfg> typename MarlinSerial<Cfg>::ring_buffer_pos_t MarlinSeria
// A SW memory barrier, to ensure GCC does not overoptimize loops
#define sw_barrier() asm volatile("": : :"memory");

#include "../../feature/emergency_parser.h"
#include "../../feature/e_parser.h"

// (called with RX interrupts disabled)
template<typename Cfg>
Expand Down Expand Up @@ -606,7 +606,7 @@ void MarlinSerial<Cfg>::printFloat(double number, uint8_t digits) {

// Round correctly so that print(1.999, 2) prints as "2.00"
double rounding = 0.5;
for (uint8_t i = 0; i < digits; ++i) rounding *= 0.1;
LOOP_L_N(i, digits) rounding *= 0.1;
number += rounding;

// Extract the integer part of the number and print it
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include "MarlinSerialUSB.h"

#if ENABLED(EMERGENCY_PARSER)
#include "../../feature/emergency_parser.h"
#include "../../feature/e_parser.h"
#endif

// Imports from Atmel USB Stack/CDC implementation
Expand Down Expand Up @@ -259,7 +259,7 @@ void MarlinSerialUSB::printFloat(double number, uint8_t digits) {

// Round correctly so that print(1.999, 2) prints as "2.00"
double rounding = 0.5;
for (uint8_t i = 0; i < digits; ++i)
LOOP_L_N(i, digits)
rounding *= 0.1;

number += rounding;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Pio *SCK_pPio, *MOSI_pPio;
uint32_t SCK_dwMask, MOSI_dwMask;

void u8g_spiSend_sw_DUE_mode_0(uint8_t val) { // 3MHz
for (uint8_t i = 0; i < 8; i++) {
LOOP_L_N(i, 8) {
if (val & 0x80)
MOSI_pPio->PIO_SODR = MOSI_dwMask;
else
Expand All @@ -94,7 +94,7 @@ void u8g_spiSend_sw_DUE_mode_0(uint8_t val) { // 3MHz
}

void u8g_spiSend_sw_DUE_mode_3(uint8_t val) { // 3.5MHz
for (uint8_t i = 0; i < 8; i++) {
LOOP_L_N(i, 8) {
SCK_pPio->PIO_CODR = SCK_dwMask;
DELAY_NS(50);
if (val & 0x80)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ extern PWM_map ISR_table[NUM_PWMS];
extern uint32_t motor_current_setting[3];

#define IR_BIT(p) (WITHIN(p, 0, 3) ? (p) : (p) + 4)
#define COPY_ACTIVE_TABLE() do{ for (uint8_t i = 0; i < 6 ; i++) work_table[i] = active_table[i]; }while(0)
#define COPY_ACTIVE_TABLE() do{ LOOP_L_N(i, 6) work_table[i] = active_table[i]; }while(0)

#define PWM_MR0 19999 // base repetition rate minus one count - 20mS
#define PWM_PR 24 // prescaler value - prescaler divide by 24 + 1 - 1 MHz output
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@
*
*/
#pragma once

#if USE_EMULATED_EEPROM
#undef SRAM_EEPROM_EMULATION
#undef SDCARD_EEPROM_EMULATION
#define FLASH_EEPROM_EMULATION
#endif
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "../../inc/MarlinConfig.h"
#include "../shared/persistent_store_api.h"

#if !defined(E2END) && NONE(I2C_EEPROM, SPI_EEPROM)
#if !defined(E2END) && ENABLED(FLASH_EEPROM_EMULATION)
#define E2END 0xFFF // Default to Flash emulated EEPROM size (EepromEmulation_Due.cpp)
#endif

Expand All @@ -38,7 +38,7 @@ extern void eeprom_flush();
bool PersistentStore::access_start() { return true; }

bool PersistentStore::access_finish() {
#if NONE(I2C_EEPROM, SPI_EEPROM)
#if ENABLED(FLASH_EEPROM_EMULATION)
eeprom_flush();
#endif
return true;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
27 changes: 27 additions & 0 deletions Marlin/src/HAL/ESP32/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once

// If no real EEPROM, Flash emulation, or SRAM emulation is available fall back to SD emulation
#if ENABLED(EEPROM_SETTINGS) && NONE(USE_REAL_EEPROM, FLASH_EEPROM_EMULATION, SRAM_EEPROM_EMULATION)
#define SDCARD_EEPROM_EMULATION
#endif
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 0 additions & 22 deletions Marlin/src/HAL/HAL_STM32_F4_F7/inc/Conditionals_post.h

This file was deleted.

22 changes: 0 additions & 22 deletions Marlin/src/HAL/HAL_TEENSY31_32/inc/Conditionals_post.h

This file was deleted.

22 changes: 0 additions & 22 deletions Marlin/src/HAL/HAL_TEENSY35_36/inc/Conditionals_post.h

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit dcddbf1

Please sign in to comment.