Skip to content

Commit

Permalink
Merge pull request #47 from MarlinFirmware/bugfix-2.0.x
Browse files Browse the repository at this point in the history
sync Bugfix 2.0.x
  • Loading branch information
Msq001 authored Jul 22, 2019
2 parents 7fe3d7c + 1005f22 commit 4f2d2c3
Show file tree
Hide file tree
Showing 228 changed files with 21,658 additions and 1,107 deletions.
2 changes: 1 addition & 1 deletion .github/issue_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Have you read Marlin's Code of Conduct? By filing an Issue, you are expected to comply with it, including treating everyone with respect: https://github.com/MarlinFirmware/Marlin/blob/bugfix-2.0.x/.github/code_of_conduct.md
Do you want to ask a question? Are you looking for support? Please don't post here. Instead please use the Marlin Firmware forum at http://forums.reprap.org/list.php?415 or the Marlin Facebook Group https://www.facebook.com/groups/1049718498464482/.
Do you want to ask a question? Are you looking for support? Please don't post here. Instead please use the Marlin Firmware forum at http://forums.reprap.org/list.php?415 or the Marlin Facebook Group https://www.facebook.com/groups/1049718498464482/ or the Marlin Discord Server https://discord.gg/n5NJ59y.
Before filing an issue be sure to test the 1.1 and/or 2.0 "bugfix" branches to see whether the issue is already addressed.
Expand Down
20 changes: 3 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
dist: xenial
sudo: require
dist: bionic
sudo: false

language: python
python:
Expand All @@ -8,13 +8,6 @@ python:
notifications:
email: false

# Cache PlatformIO packages using Travis CI container-based infrastructure
sudo: false
cache:
pip: true
directories:
- "~/.platformio"

env:
- TEST_PLATFORM="megaatmega2560"
- TEST_PLATFORM="DUE"
Expand All @@ -25,16 +18,9 @@ env:
- TEST_PLATFORM="linux_native"
- TEST_PLATFORM="esp32"
- TEST_PLATFORM="alfawise_U20"

addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-7
- TEST_PLATFORM="black_stm32f407ve"

before_install:
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 90
#
# Fetch the tag information for the current branch
- git fetch origin --tags
Expand Down
15 changes: 12 additions & 3 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,14 @@
#define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock
#elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD)
#define SWITCHING_TOOLHEAD_Y_RELEASE 5 // (mm) Security distance Y axis
#define SWITCHING_TOOLHEAD_X_SECURITY -35 // (mm) Security distance X axis
#define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } // (mm) Security distance X axis (T0,T1)
//#define PRIME_BEFORE_REMOVE // Prime the nozzle before release from the dock
#if ENABLED(PRIME_BEFORE_REMOVE)
#define SWITCHING_TOOLHEAD_PRIME_MM 20 // (mm) Extruder prime length
#define SWITCHING_TOOLHEAD_RETRACT_MM 10 // (mm) Retract after priming length
#define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 // (mm/m) Extruder prime feedrate
#define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 // (mm/m) Extruder retract feedrate
#endif
#elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD)
#define SWITCHING_TOOLHEAD_Z_HOP 2 // (mm) Z raise for switching
#endif
Expand Down Expand Up @@ -2137,8 +2144,10 @@
//#define NEOPIXEL_LED
#if ENABLED(NEOPIXEL_LED)
#define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h)
#define NEOPIXEL_PIN 4 // LED driving pin
#define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip
#define NEOPIXEL_PIN 4 // LED driving pin
//#define NEOPIXEL2_TYPE NEOPIXEL_TYPE
//#define NEOPIXEL2_PIN 5
#define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used
#define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once.
#define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255)
//#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup
Expand Down
2 changes: 1 addition & 1 deletion Marlin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ else ifeq ($(HARDWARE_MOTHERBOARD),1134)
else ifeq ($(HARDWARE_MOTHERBOARD),1135)
# Dagoma F5
else ifeq ($(HARDWARE_MOTHERBOARD),1136)
# Fysetc F6
# FYSETC F6
else ifeq ($(HARDWARE_MOTHERBOARD),1137)
# Duplicator i3 Plus
else ifeq ($(HARDWARE_MOTHERBOARD),1138)
Expand Down
8 changes: 4 additions & 4 deletions Marlin/src/HAL/HAL_AVR/HAL_spi_AVR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ void spiBegin(void) {

#if NONE(SOFTWARE_SPI, FORCE_SOFT_SPI)

//------------------------------------------------------------------------------
// ------------------------
// Hardware SPI
//------------------------------------------------------------------------------
// ------------------------

// make sure SPCR rate is in expected bits
#if (SPR0 != 0 || SPR1 != 1)
Expand Down Expand Up @@ -177,9 +177,9 @@ void spiBegin(void) {

#else // SOFTWARE_SPI || FORCE_SOFT_SPI

//------------------------------------------------------------------------------
// ------------------------
// Software SPI
//------------------------------------------------------------------------------
// ------------------------

// nop to tune soft SPI timing
#define nop asm volatile ("\tnop\n")
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/HAL/HAL_DUE/Servo_Due.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@

static volatile int8_t Channel[_Nbr_16timers]; // counter for the servo being pulsed for each timer (or -1 if refresh interval)

//------------------------------------------------------------------------------
// ------------------------
/// Interrupt handler for the TC0 channel 1.
//------------------------------------------------------------------------------
// ------------------------
void Servo_Handler(timer16_Sequence_t timer, Tc *pTc, uint8_t channel);

#ifdef _useTimer1
Expand Down
1 change: 0 additions & 1 deletion Marlin/src/HAL/HAL_DUE/pinsDebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@

#define digitalRead_mod(p) extDigitalRead(p) // AVR digitalRead disabled PWM before it read the pin
#define PRINT_PORT(p)
#define NAME_FORMAT(p) PSTR("%-##p##s")
#define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%02d"), p); SERIAL_ECHO(buffer); }while(0)
#define GET_ARRAY_PIN(p) pin_array[p].pin
Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/HAL/HAL_DUE/usb/udi_cdc.c
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ void udi_cdc_data_sof_notify(void)
}


//-------------------------------------------------
// ------------------------
//------- Internal routines to control serial line

static uint8_t udi_cdc_setup_to_port(void)
Expand Down Expand Up @@ -579,7 +579,7 @@ static void udi_cdc_serial_state_msg_sent(udd_ep_status_t status, iram_size_t n,
}


//-------------------------------------------------
// ------------------------
//------- Internal routines to process data transfer


Expand Down Expand Up @@ -781,7 +781,7 @@ static void udi_cdc_tx_send(uint8_t port)
}


//---------------------------------------------
// ------------------------
//------- Application interface


Expand Down
10 changes: 5 additions & 5 deletions Marlin/src/HAL/HAL_DUE/usb/udi_msc.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ uint8_t udi_msc_getsetting(void)
}


//---------------------------------------------
// ------------------------
//------- Routines to process CBW packet

static void udi_msc_cbw_invalid(void)
Expand Down Expand Up @@ -613,7 +613,7 @@ static bool udi_msc_cbw_validate(uint32_t alloc_len, uint8_t dir_flag)
}


//---------------------------------------------
// ------------------------
//------- Routines to process small data packet

static void udi_msc_data_send(uint8_t * buffer, uint8_t buf_size)
Expand Down Expand Up @@ -645,7 +645,7 @@ static void udi_msc_data_sent(udd_ep_status_t status, iram_size_t nb_sent,
}


//---------------------------------------------
// ------------------------
//------- Routines to process CSW packet

static void udi_msc_csw_process(void)
Expand Down Expand Up @@ -691,7 +691,7 @@ static void udi_msc_csw_sent(udd_ep_status_t status, iram_size_t nb_sent,
}


//---------------------------------------------
// ------------------------
//------- Routines manage sense data

static void udi_msc_clear_sense(void)
Expand Down Expand Up @@ -757,7 +757,7 @@ static void udi_msc_sense_command_invalid(void)
}


//---------------------------------------------
// ------------------------
//------- Routines manage SCSI Commands

static void udi_msc_spc_requestsense(void)
Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/HAL/HAL_DUE/usb/uotghs_device_due.c
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ static bool udd_ep_interrupt(void);
//@}


//--------------------------------------------------------
// ------------------------
//--- INTERNAL ROUTINES TO MANAGED GLOBAL EVENTS

/**
Expand Down Expand Up @@ -1307,7 +1307,7 @@ void udd_test_mode_packet(void)



//--------------------------------------------------------
// ------------------------
//--- INTERNAL ROUTINES TO MANAGED THE CONTROL ENDPOINT

static void udd_reset_ep_ctrl(void)
Expand Down Expand Up @@ -1729,7 +1729,7 @@ static bool udd_ctrl_interrupt(void)
}


//--------------------------------------------------------
// ------------------------
//--- INTERNAL ROUTINES TO MANAGED THE BULK/INTERRUPT/ISOCHRONOUS ENDPOINTS

#if (0 != USB_DEVICE_MAX_EP)
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/HAL/HAL_ESP32/HAL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
#endif

// ------------------------
// Externals
// Externs
// ------------------------

portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
Expand Down Expand Up @@ -177,7 +177,7 @@ void HAL_adc_init() {
// Calculate ADC characteristics (i.e., gain and offset factors for each attenuation level)
for (int i = 0; i < ADC_ATTEN_MAX; i++) {
esp_adc_cal_characterize(ADC_UNIT_1, (adc_atten_t)i, ADC_WIDTH_BIT_12, V_REF, &characteristics[i]);

// Change attenuation 100mV below the calibrated threshold
thresholds[i] = esp_adc_cal_raw_to_voltage(4095, &characteristics[i]);
}
Expand Down
1 change: 0 additions & 1 deletion Marlin/src/HAL/HAL_LINUX/pinsDebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#define digitalRead_mod(p) digitalRead(p)
#define PRINT_PORT(p)
#define GET_ARRAY_PIN(p) pin_array[p].pin
#define NAME_FORMAT(p) PSTR("%-##p##s")
#define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%3d "), p); SERIAL_ECHO(buffer); }while(0)
#define MULTI_NAME_PAD 16 // space needed to be pretty if not first name assigned to a pin
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/HAL_LINUX/spi_pins.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#if HAS_GRAPHICAL_LCD && ENABLED(SDSUPPORT) && (LCD_PINS_D4 == SCK_PIN || LCD_PINS_ENABLE == MOSI_PIN || DOGLCD_SCK == SCK_PIN || DOGLCD_MOSI == MOSI_PIN)
#define LPC_SOFTWARE_SPI // If the SD card and LCD adapter share the same SPI pins, then software SPI is currently
// needed due to the speed and mode requred for communicating with each device being different.
// needed due to the speed and mode required for communicating with each device being different.
// This requirement can be removed if the SPI access to these devices is updated to use
// spiBeginTransaction.
#endif
Expand Down
4 changes: 3 additions & 1 deletion Marlin/src/HAL/HAL_LPC1768/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ using FilteredADC = LPC176x::ADC<ADC_LOWPASS_K_VALUE, ADC_MEDIAN_FILTER_SIZE>;
#define HAL_ADC_READY() FilteredADC::finished_conversion()

// A grace period to allow ADC readings to stabilize, preventing false alarms
#define THERMAL_PROTECTION_GRACE_PERIOD 1000
#ifndef THERMAL_PROTECTION_GRACE_PERIOD
#define THERMAL_PROTECTION_GRACE_PERIOD 1000
#endif

// Parse a G-code word into a pin index
int16_t PARSED_PIN_INDEX(const char code, const int16_t dval);
Expand Down
1 change: 0 additions & 1 deletion Marlin/src/HAL/HAL_LPC1768/pinsDebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#define digitalRead_mod(p) extDigitalRead(p)
#define PRINT_PORT(p)
#define GET_ARRAY_PIN(p) pin_array[p].pin
#define NAME_FORMAT(p) PSTR("%-##p##s")
#define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%d.%02d"), LPC1768_PIN_PORT(p), LPC1768_PIN_PIN(p)); SERIAL_ECHO(buffer); }while(0)
#define MULTI_NAME_PAD 16 // space needed to be pretty if not first name assigned to a pin
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/HAL_LPC1768/spi_pins.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

#if ENABLED(SDSUPPORT) && HAS_GRAPHICAL_LCD && (LCD_PINS_D4 == SCK_PIN || LCD_PINS_ENABLE == MOSI_PIN || DOGLCD_SCK == SCK_PIN || DOGLCD_MOSI == MOSI_PIN)
#define LPC_SOFTWARE_SPI // If the SD card and LCD adapter share the same SPI pins, then software SPI is currently
// needed due to the speed and mode requred for communicating with each device being different.
// needed due to the speed and mode required for communicating with each device being different.
// This requirement can be removed if the SPI access to these devices is updated to use
// spiBeginTransaction.
#endif
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/HAL_STM32/fastio_STM32.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void FastIO_init(); // Must be called before using fast io macros

#define _BV32(b) (1UL << (b))

#if !defined(PWM)
#ifndef PWM
#define PWM OUTPUT
#endif

Expand Down
1 change: 0 additions & 1 deletion Marlin/src/HAL/HAL_STM32/pinsDebug_STM32GENERIC.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ extern const stm32_pin_info PIN_MAP[BOARD_NR_GPIO_PINS];
#define GET_ARRAY_PIN(p) pin_t(pin_array[p].pin)
#define pwm_status(pin) PWM_PIN(pin)
#define digitalRead_mod(p) extDigitalRead(p)
#define NAME_FORMAT(p) PSTR("%-##p##s")
#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%3hd "), int16_t(p)); SERIAL_ECHO(buffer); }while(0)
#define PRINT_PORT(p) print_port(p)
#define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
Expand Down
1 change: 0 additions & 1 deletion Marlin/src/HAL/HAL_STM32/pinsDebug_STM32duino.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ const XrefInfo pin_xref[] PROGMEM = {
#define NUMBER_PINS_TOTAL NUM_DIGITAL_PINS
#define VALID_PIN(ANUM) ((ANUM) >= 0 && (ANUM) < NUMBER_PINS_TOTAL)
#define digitalRead_mod(Ard_num) extDigitalRead(Ard_num) // must use Arduino pin numbers when doing reads
#define NAME_FORMAT(p) PSTR("%-##p##s")
#define PRINT_PIN(Q)
#define PRINT_PORT(ANUM) port_print(ANUM)
#define DIGITAL_PIN_TO_ANALOG_PIN(ANUM) -1 // will report analog pin number in the print port routine
Expand Down
11 changes: 10 additions & 1 deletion Marlin/src/HAL/HAL_STM32F1/HAL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,11 @@ void HAL_init(void) {
#if PIN_EXISTS(LED)
OUT_WRITE(LED_PIN, LOW);
#endif
#if PIN_EXISTS(USB_CONNECT)
OUT_WRITE(USB_CONNECT_PIN, !USB_CONNECT_INVERTING); // USB clear connection
delay(1000); // Give OS time to notice
OUT_WRITE(USB_CONNECT_PIN, USB_CONNECT_INVERTING);
#endif
}

/* VGPV Done with defines
Expand Down Expand Up @@ -260,7 +265,11 @@ extern "C" {
void HAL_adc_init(void) {
// configure the ADC
adc.calibrate();
adc.setSampleRate(ADC_SMPR_41_5); // ?
#if F_CPU > 72000000
adc.setSampleRate(ADC_SMPR_71_5); // 71.5 ADC cycles
#else
adc.setSampleRate(ADC_SMPR_41_5); // 41.5 ADC cycles
#endif
adc.setPins(adc_pins, ADC_PIN_COUNT);
adc.setDMA(HAL_adc_results, (uint16_t)ADC_PIN_COUNT, (uint32_t)(DMA_MINC_MODE | DMA_CIRC_MODE), nullptr);
adc.setScanMode();
Expand Down
16 changes: 13 additions & 3 deletions Marlin/src/HAL/HAL_STM32F1/HAL_spi_STM32F1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,25 @@ void spiBegin() {
* @details
*/
void spiInit(uint8_t spiRate) {
/**
* STM32F1 APB2 = 72MHz, APB1 = 36MHz, max SPI speed of this MCU if 18Mhz
* STM32F1 has 3 SPI ports, SPI1 in APB2, SPI2/SPI3 in APB1
* so the minimum prescale of SPI1 is DIV4, SPI2/SPI3 is DIV2
*/
#if SPI_DEVICE == 1
#define SPI_CLOCK_MAX SPI_CLOCK_DIV4
#else
#define SPI_CLOCK_MAX SPI_CLOCK_DIV2
#endif
uint8_t clock;
switch (spiRate) {
case SPI_FULL_SPEED: clock = SPI_CLOCK_DIV2 ; break;
case SPI_FULL_SPEED: clock = SPI_CLOCK_MAX ; break;
case SPI_HALF_SPEED: clock = SPI_CLOCK_DIV4 ; break;
case SPI_QUARTER_SPEED: clock = SPI_CLOCK_DIV8 ; break;
case SPI_EIGHTH_SPEED: clock = SPI_CLOCK_DIV16; break;
case SPI_SPEED_5: clock = SPI_CLOCK_DIV32; break;
case SPI_SPEED_6: clock = SPI_CLOCK_DIV64; break;
default: clock = SPI_CLOCK_DIV2; // Default from the SPI library
default: clock = SPI_CLOCK_DIV2; // Default from the SPI library
}
SPI.setModule(SPI_DEVICE);
SPI.begin();
Expand All @@ -104,7 +114,7 @@ void spiInit(uint8_t spiRate) {
* @details
*/
uint8_t spiRec(void) {
uint8_t returnByte = SPI.transfer(0xFF);
uint8_t returnByte = SPI.transfer(ff);
return returnByte;
}

Expand Down
1 change: 0 additions & 1 deletion Marlin/src/HAL/HAL_STM32F1/STM32F1_flag_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#dynamic build flags for generic compile options
if __name__ == "__main__":
args = " ".join([ "-std=gnu11",
"-std=gnu++11",
"-Os",
"-mcpu=cortex-m3",
"-mthumb",
Expand Down
Loading

0 comments on commit 4f2d2c3

Please sign in to comment.