Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into X5SA-2E-Bug…
Browse files Browse the repository at this point in the history
…fix-ColorUI
  • Loading branch information
effgarces committed Oct 28, 2020
2 parents 205e3bc + 12dec25 commit 3656bc2
Show file tree
Hide file tree
Showing 232 changed files with 9,521 additions and 11,913 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/test-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ jobs:
# Base Environments

- DUE
- DUE_archim
- esp32
- linux_native
- mega2560
- at90usb1286_dfu
- teensy31
- teensy35
- teensy41
Expand Down Expand Up @@ -95,7 +97,6 @@ jobs:

# Non-working environment tests
#- at90usb1286_cdc
#- at90usb1286_dfu
#- STM32F103CB_malyan
#- mks_robin_mini

Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ tags
*.out
*.app


#
# C
#
Expand Down
8 changes: 6 additions & 2 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@

/**
* Select a secondary serial port on the board to use for communication with the host.
* :[-1, 0, 1, 2, 3, 4, 5, 6, 7]
* Currently Ethernet (-2) is only supported on Teensy 4.1 boards.
* :[-2, -1, 0, 1, 2, 3, 4, 5, 6, 7]
*/
#define SERIAL_PORT_2 3

Expand Down Expand Up @@ -336,6 +337,9 @@
//#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80
//#define PSU_POWERUP_DELAY 250 // (ms) Delay for the PSU to warm up to full power

//#define PSU_POWERUP_GCODE "M355 S1" // G-code to run after power-on (e.g., case light on)
//#define PSU_POWEROFF_GCODE "M355 S0" // G-code to run before power-off (e.g., case light off)

//#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin
#if ENABLED(AUTO_POWER_CONTROL)
#define AUTO_POWER_FANS // Turn on PSU if fans need power
Expand Down Expand Up @@ -2194,7 +2198,7 @@

//
// Third-party or vendor-customized controller interfaces.
// Sources should be installed in 'src/lcd/extensible_ui'.
// Sources should be installed in 'src/lcd/extui'.
//
//#define EXTENSIBLE_UI

Expand Down
57 changes: 52 additions & 5 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1090,6 +1090,9 @@
// BACK menu items keep the highlight at the top
//#define TURBO_BACK_MENU_ITEM

// Add a mute option to the LCD menu
//#define SOUND_MENU_ITEM

/**
* LED Control Menu
* Add LED Control to the LCD menu
Expand Down Expand Up @@ -2261,14 +2264,20 @@
#if HAS_TRINAMIC_CONFIG

#define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current
#define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256

/**
* Interpolate microsteps to 256
* Override for each driver with <driver>_INTERPOLATE settings below
*/
#define INTERPOLATE true

#if AXIS_IS_TMC(X)
#define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current.
#define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing
#define X_MICROSTEPS 16 // 0..256
#define X_MICROSTEPS 16 // 0..256
#define X_RSENSE 0.11
#define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ...
#define X_CHAIN_POS -1 // -1..0: Not chained. 1: MCU MOSI connected. 2: Next in chain, ...
//#define X_INTERPOLATE true // Enable to override 'INTERPOLATE' for the X axis
#endif

#if AXIS_IS_TMC(X2)
Expand All @@ -2277,6 +2286,7 @@
#define X2_MICROSTEPS 16
#define X2_RSENSE 0.11
#define X2_CHAIN_POS -1
//#define X2_INTERPOLATE true
#endif

#if AXIS_IS_TMC(Y)
Expand All @@ -2285,6 +2295,7 @@
#define Y_MICROSTEPS 16
#define Y_RSENSE 0.11
#define Y_CHAIN_POS -1
//#define Y_INTERPOLATE true
#endif

#if AXIS_IS_TMC(Y2)
Expand All @@ -2293,6 +2304,7 @@
#define Y2_MICROSTEPS 16
#define Y2_RSENSE 0.11
#define Y2_CHAIN_POS -1
//#define Y2_INTERPOLATE true
#endif

#if AXIS_IS_TMC(Z)
Expand All @@ -2301,6 +2313,7 @@
#define Z_MICROSTEPS 16
#define Z_RSENSE 0.11
#define Z_CHAIN_POS -1
//#define Z_INTERPOLATE true
#endif

#if AXIS_IS_TMC(Z2)
Expand All @@ -2309,6 +2322,7 @@
#define Z2_MICROSTEPS 16
#define Z2_RSENSE 0.11
#define Z2_CHAIN_POS -1
//#define Z2_INTERPOLATE true
#endif

#if AXIS_IS_TMC(Z3)
Expand All @@ -2317,6 +2331,7 @@
#define Z3_MICROSTEPS 16
#define Z3_RSENSE 0.11
#define Z3_CHAIN_POS -1
//#define Z3_INTERPOLATE true
#endif

#if AXIS_IS_TMC(Z4)
Expand All @@ -2325,62 +2340,71 @@
#define Z4_MICROSTEPS 16
#define Z4_RSENSE 0.11
#define Z4_CHAIN_POS -1
//#define Z4_INTERPOLATE true
#endif

#if AXIS_IS_TMC(E0)
#define E0_CURRENT 800
#define E0_MICROSTEPS 16
#define E0_RSENSE 0.11
#define E0_CHAIN_POS -1
//#define E0_INTERPOLATE true
#endif

#if AXIS_IS_TMC(E1)
#define E1_CURRENT 800
#define E1_MICROSTEPS 16
#define E1_RSENSE 0.11
#define E1_CHAIN_POS -1
//#define E1_INTERPOLATE true
#endif

#if AXIS_IS_TMC(E2)
#define E2_CURRENT 800
#define E2_MICROSTEPS 16
#define E2_RSENSE 0.11
#define E2_CHAIN_POS -1
//#define E2_INTERPOLATE true
#endif

#if AXIS_IS_TMC(E3)
#define E3_CURRENT 800
#define E3_MICROSTEPS 16
#define E3_RSENSE 0.11
#define E3_CHAIN_POS -1
//#define E3_INTERPOLATE true
#endif

#if AXIS_IS_TMC(E4)
#define E4_CURRENT 800
#define E4_MICROSTEPS 16
#define E4_RSENSE 0.11
#define E4_CHAIN_POS -1
//#define E4_INTERPOLATE true
#endif

#if AXIS_IS_TMC(E5)
#define E5_CURRENT 800
#define E5_MICROSTEPS 16
#define E5_RSENSE 0.11
#define E5_CHAIN_POS -1
//#define E5_INTERPOLATE true
#endif

#if AXIS_IS_TMC(E6)
#define E6_CURRENT 800
#define E6_MICROSTEPS 16
#define E6_RSENSE 0.11
#define E6_CHAIN_POS -1
//#define E6_INTERPOLATE true
#endif

#if AXIS_IS_TMC(E7)
#define E7_CURRENT 800
#define E7_MICROSTEPS 16
#define E7_RSENSE 0.11
#define E7_CHAIN_POS -1
//#define E7_INTERPOLATE true
#endif

/**
Expand Down Expand Up @@ -2471,10 +2495,26 @@
* CHOPPER_PRUSAMK3_24V // Imported parameters from the official Průša firmware for MK3 (24V)
* CHOPPER_MARLIN_119 // Old defaults from Marlin v1.1.9
*
* Define you own with
* Define your own with:
* { <off_time[1..15]>, <hysteresis_end[-3..12]>, hysteresis_start[1..8] }
*/
#define CHOPPER_TIMING CHOPPER_DEFAULT_12V
#define CHOPPER_TIMING CHOPPER_DEFAULT_12V // All axes (override below)
//#define CHOPPER_TIMING_X CHOPPER_DEFAULT_12V // For X Axes (override below)
//#define CHOPPER_TIMING_X2 CHOPPER_DEFAULT_12V
//#define CHOPPER_TIMING_Y CHOPPER_DEFAULT_12V // For Y Axes (override below)
//#define CHOPPER_TIMING_Y2 CHOPPER_DEFAULT_12V
//#define CHOPPER_TIMING_Z CHOPPER_DEFAULT_12V // For Z Axes (override below)
//#define CHOPPER_TIMING_Z2 CHOPPER_DEFAULT_12V
//#define CHOPPER_TIMING_Z3 CHOPPER_DEFAULT_12V
//#define CHOPPER_TIMING_Z4 CHOPPER_DEFAULT_12V
//#define CHOPPER_TIMING_E CHOPPER_DEFAULT_12V // For Extruders (override below)
//#define CHOPPER_TIMING_E1 CHOPPER_DEFAULT_12V
//#define CHOPPER_TIMING_E2 CHOPPER_DEFAULT_12V
//#define CHOPPER_TIMING_E3 CHOPPER_DEFAULT_12V
//#define CHOPPER_TIMING_E4 CHOPPER_DEFAULT_12V
//#define CHOPPER_TIMING_E5 CHOPPER_DEFAULT_12V
//#define CHOPPER_TIMING_E6 CHOPPER_DEFAULT_12V
//#define CHOPPER_TIMING_E7 CHOPPER_DEFAULT_12V

/**
* Monitor Trinamic drivers
Expand Down Expand Up @@ -3440,6 +3480,13 @@
// Default behavior is limited to Z axis only.
#endif

/**
* Ethernet. Use M552 to enable and set the IP address.
*/
#if HAS_ETHERNET
#define MAC_ADDRESS { 0xDE, 0xAD, 0xBE, 0xEF, 0xF0, 0x0D } // A MAC address unique to your network
#endif

/**
* WiFi Support (Espressif ESP32 WiFi)
*/
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/DUE/fastio.h
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@
#define DIO91_PIN 15
#define DIO91_WPORT PIOB

#if ARDUINO_SAM_ARCHIM
#ifdef ARDUINO_SAM_ARCHIM

#define DIO92_PIN 11
#define DIO92_WPORT PIOC
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector) {
card.getSd2Card().readData(sector_buf);

// RAM -> USB
if (!udi_msc_trans_block(true, sector_buf, SD_MMC_BLOCK_SIZE, NULL)) {
if (!udi_msc_trans_block(true, sector_buf, SD_MMC_BLOCK_SIZE, nullptr)) {
card.getSd2Card().readStop();
return CTRL_FAIL;
}
Expand Down Expand Up @@ -120,7 +120,7 @@ Ctrl_status sd_mmc_spi_usb_write_10(uint32_t addr, uint16_t nb_sector) {
while (nb_sector--) {

// USB -> RAM
if (!udi_msc_trans_block(false, sector_buf, SD_MMC_BLOCK_SIZE, NULL)) {
if (!udi_msc_trans_block(false, sector_buf, SD_MMC_BLOCK_SIZE, nullptr)) {
card.getSd2Card().writeStop();
return CTRL_FAIL;
}
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/ESP32/HAL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ volatile int numPWMUsed = 0,

#endif

void HAL_init() { i2s_init(); }
void HAL_init() { TERN_(I2S_STEPPER_STREAM, i2s_init()); }

void HAL_init_board() {

Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/HAL/ESP32/i2s.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ int i2s_init() {

// Allocate the array of pointers to the buffers
dma.buffers = (uint32_t **)malloc(sizeof(uint32_t*) * DMA_BUF_COUNT);
if (dma.buffers == nullptr) return -1;
if (!dma.buffers) return -1;

// Allocate each buffer that can be used by the DMA controller
for (int buf_idx = 0; buf_idx < DMA_BUF_COUNT; buf_idx++) {
Expand All @@ -194,7 +194,7 @@ int i2s_init() {

// Allocate the array of DMA descriptors
dma.desc = (lldesc_t**) malloc(sizeof(lldesc_t*) * DMA_BUF_COUNT);
if (dma.desc == nullptr) return -1;
if (!dma.desc) return -1;

// Allocate each DMA descriptor that will be used by the DMA controller
for (int buf_idx = 0; buf_idx < DMA_BUF_COUNT; buf_idx++) {
Expand Down
6 changes: 0 additions & 6 deletions Marlin/src/HAL/ESP32/timers.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,9 @@
#include <stdint.h>
#include <driver/timer.h>

// Includes needed to get I2S_STEPPER_STREAM. Note that pins.h
// is included in case this header is being included early.
#include "../../inc/MarlinConfig.h"
#include "../../pins/pins.h"

// ------------------------
// Defines
// ------------------------
//
#define FORCE_INLINE __attribute__((always_inline)) inline

typedef uint64_t hal_timer_t;
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/LINUX/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#define CPU_32_BIT

#define F_CPU 100000000
#define F_CPU 100000000UL
#define SystemCoreClock F_CPU
#include <iostream>
#include <stdint.h>
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/HAL/LINUX/eeprom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
bool PersistentStore::access_start() {
const char eeprom_erase_value = 0xFF;
FILE * eeprom_file = fopen(filename, "rb");
if (eeprom_file == nullptr) return false;
if (!eeprom_file) return false;

fseek(eeprom_file, 0L, SEEK_END);
std::size_t file_size = ftell(eeprom_file);
Expand All @@ -59,7 +59,7 @@ bool PersistentStore::access_start() {

bool PersistentStore::access_finish() {
FILE * eeprom_file = fopen(filename, "wb");
if (eeprom_file == nullptr) return false;
if (!eeprom_file) return false;
fwrite(buffer, sizeof(uint8_t), sizeof(buffer), eeprom_file);
fclose(eeprom_file);
return true;
Expand Down
12 changes: 6 additions & 6 deletions Marlin/src/HAL/LINUX/hardware/Gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ class Gpio {
GpioEvent::Type evt_type = value > 1 ? GpioEvent::SET_VALUE : value > pin_map[pin].value ? GpioEvent::RISE : value < pin_map[pin].value ? GpioEvent::FALL : GpioEvent::NOP;
pin_map[pin].value = value;
GpioEvent evt(Clock::nanos(), pin, evt_type);
if (pin_map[pin].cb != nullptr) {
if (pin_map[pin].cb) {
pin_map[pin].cb->interrupt(evt);
}
if (Gpio::logger != nullptr) Gpio::logger->log(evt);
if (Gpio::logger) Gpio::logger->log(evt);
}

static uint16_t get(pin_type pin) {
Expand All @@ -105,8 +105,8 @@ class Gpio {
if (!valid_pin(pin)) return;
pin_map[pin].mode = value;
GpioEvent evt(Clock::nanos(), pin, GpioEvent::Type::SETM);
if (pin_map[pin].cb != nullptr) pin_map[pin].cb->interrupt(evt);
if (Gpio::logger != nullptr) Gpio::logger->log(evt);
if (pin_map[pin].cb) pin_map[pin].cb->interrupt(evt);
if (Gpio::logger) Gpio::logger->log(evt);
}

static uint8_t getMode(pin_type pin) {
Expand All @@ -118,8 +118,8 @@ class Gpio {
if (!valid_pin(pin)) return;
pin_map[pin].dir = value;
GpioEvent evt(Clock::nanos(), pin, GpioEvent::Type::SETD);
if (pin_map[pin].cb != nullptr) pin_map[pin].cb->interrupt(evt);
if (Gpio::logger != nullptr) Gpio::logger->log(evt);
if (pin_map[pin].cb) pin_map[pin].cb->interrupt(evt);
if (Gpio::logger) Gpio::logger->log(evt);
}

static uint8_t getDir(pin_type pin) {
Expand Down
Loading

0 comments on commit 3656bc2

Please sign in to comment.