Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into bugfix-2.0.x
Browse files Browse the repository at this point in the history
  • Loading branch information
dot-bob committed Jun 22, 2019
2 parents 7a17342 + be69ec5 commit 8256043
Show file tree
Hide file tree
Showing 662 changed files with 91,029 additions and 18,784 deletions.
2 changes: 1 addition & 1 deletion .github/issue_template.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
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/master/.github/code_of_conduct.md
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/.
Expand Down
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,13 @@ CMakeListsPrivate.txt

#CLion
cmake-build-*

#Eclipse
.project
.cproject
.pydevproject
.settings
.classpath

#Python
__pycache__
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dist: trusty
dist: xenial
sudo: require

language: python
Expand Down Expand Up @@ -38,7 +38,7 @@ before_install:

install:
#- pip install -U platformio
- pip install -U https://github.com/platformio/platformio-core/archive/develop.zip
- pip install -U https://github.com/platformio/platformio-core/archive/master.zip

before_script:
# Update PlatformIO packages
Expand Down
231 changes: 138 additions & 93 deletions Marlin/Configuration.h

Large diffs are not rendered by default.

291 changes: 250 additions & 41 deletions Marlin/Configuration_adv.h

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions Marlin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ else ifeq ($(HARDWARE_MOTHERBOARD),443)
else ifeq ($(HARDWARE_MOTHERBOARD),243)
# Creality: CR10S, CR20, CR-X
else ifeq ($(HARDWARE_MOTHERBOARD),244)
# Dagoma F5
else ifeq ($(HARDWARE_MOTHERBOARD),245)
# Fysetc F6
else ifeq ($(HARDWARE_MOTHERBOARD),541)
# Duplicator i3 Plus
Expand All @@ -237,6 +239,8 @@ else ifeq ($(HARDWARE_MOTHERBOARD),31)
else ifeq ($(HARDWARE_MOTHERBOARD),441)
# TRONXY V3 1.0
else ifeq ($(HARDWARE_MOTHERBOARD),442)
# Z-Bolt X Series
else ifeq ($(HARDWARE_MOTHERBOARD),550)

#
# Other ATmega1280, ATmega2560
Expand Down Expand Up @@ -271,7 +275,7 @@ else ifeq ($(HARDWARE_MOTHERBOARD),304)
# Einsy Retro
else ifeq ($(HARDWARE_MOTHERBOARD),305)
# Elefu Ra Board (v3)
else ifeq ($(HARDWARE_MOTHERBOARD),21)
else ifeq ($(HARDWARE_MOTHERBOARD),23)
# Leapfrog
else ifeq ($(HARDWARE_MOTHERBOARD),999)
# Mega controller
Expand All @@ -288,6 +292,8 @@ else ifeq ($(HARDWARE_MOTHERBOARD),75)
else ifeq ($(HARDWARE_MOTHERBOARD),76)
# Geeetech GT2560 Rev B for A20(M/D)
else ifeq ($(HARDWARE_MOTHERBOARD),86)
# Einstart retrofit
else ifeq ($(HARDWARE_MOTHERBOARD),666)

#
# ATmega1281, ATmega2561
Expand Down Expand Up @@ -587,7 +593,7 @@ ifeq ($(U8GLIB), 1)
endif

ifeq ($(TMC), 1)
LIB_CXXSRC += TMCStepper.cpp COOLCONF.cpp DRV_STATUS.cpp IHOLD_IRUN.cpp CHOPCONF.cpp GCONF.cpp PWMCONF.cpp DRV_CONF.cpp DRVCONF.cpp DRVCTRL.cpp DRVSTATUS.cpp ENCMODE.cpp RAMP_STAT.cpp SGCSCONF.cpp SHORT_CONF.cpp SMARTEN.cpp SW_MODE.cpp SW_SPI.cpp TMC2130Stepper.cpp TMC2208Stepper.cpp TMC2660Stepper.cpp TMC5130Stepper.cpp TMC5160Stepper.cpp
LIB_CXXSRC += TMCStepper.cpp COOLCONF.cpp DRV_STATUS.cpp IHOLD_IRUN.cpp CHOPCONF.cpp GCONF.cpp PWMCONF.cpp DRV_CONF.cpp DRVCONF.cpp DRVCTRL.cpp DRVSTATUS.cpp ENCMODE.cpp RAMP_STAT.cpp SGCSCONF.cpp SHORT_CONF.cpp SMARTEN.cpp SW_MODE.cpp SW_SPI.cpp TMC2130Stepper.cpp TMC2208Stepper.cpp TMC2209Stepper.cpp TMC2660Stepper.cpp TMC5130Stepper.cpp TMC5160Stepper.cpp
endif

ifeq ($(RELOC_WORKAROUND), 1)
Expand Down
42 changes: 21 additions & 21 deletions Marlin/src/HAL/HAL_AVR/HAL.cpp
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
/* **************************************************************************
Marlin 3D Printer Firmware
Copyright (C) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
Copyright (c) 2016 Bob Cousins bobcousins42@googlemail.com
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/>.
****************************************************************************/
/**
* Marlin 3D Printer Firmware
* Copyright (C) 2019 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/>.
*
*/

#ifdef __AVR__

Expand Down
15 changes: 7 additions & 8 deletions Marlin/src/HAL/HAL_AVR/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,7 @@

#include <stdint.h>

#include <Arduino.h>

#include <util/delay.h>
#include <avr/eeprom.h>
#include <avr/pgmspace.h>
#include <avr/interrupt.h>
#include <avr/io.h>

#include "../shared/Marduino.h"
#include "../shared/HAL_SPI.h"
#include "fastio_AVR.h"
#include "watchdog_AVR.h"
Expand All @@ -43,6 +36,12 @@
#include "MarlinSerial.h"
#endif

#include <util/delay.h>
#include <avr/eeprom.h>
#include <avr/pgmspace.h>
#include <avr/interrupt.h>
#include <avr/io.h>

// --------------------------------------------------------------------------
// Defines
// --------------------------------------------------------------------------
Expand Down
53 changes: 23 additions & 30 deletions Marlin/src/HAL/HAL_AVR/HAL_spi_AVR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
*/

/**
* Originally from Arduino Sd2Card Library
* Adapted from Arduino Sd2Card Library
* Copyright (C) 2009 by William Greiman
*/

/**
* Description: HAL for AVR - SPI functions
* HAL for AVR - SPI functions
*/

#ifdef __AVR__
Expand All @@ -37,36 +37,25 @@

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

// --------------------------------------------------------------------------
// Public Variables
// --------------------------------------------------------------------------


// --------------------------------------------------------------------------
// Public functions
// --------------------------------------------------------------------------

void spiBegin (void) {
SET_OUTPUT(SS_PIN);
WRITE(SS_PIN, HIGH);
void spiBegin(void) {
OUT_WRITE(SS_PIN, HIGH);
SET_OUTPUT(SCK_PIN);
SET_INPUT(MISO_PIN);
SET_OUTPUT(MOSI_PIN);

#if DISABLED(SOFTWARE_SPI)
// SS must be in output mode even it is not chip select
SET_OUTPUT(SS_PIN);
//SET_OUTPUT(SS_PIN);
// set SS high - may be chip select for another SPI device
#if SET_SPI_SS_HIGH
WRITE(SS_PIN, HIGH);
#endif // SET_SPI_SS_HIGH
//#if SET_SPI_SS_HIGH
//WRITE(SS_PIN, HIGH);
//#endif
// set a default rate
spiInit(1);
#endif // SOFTWARE_SPI
#endif
}


#if DISABLED(SOFTWARE_SPI)
#if DISABLED(SOFTWARE_SPI, FORCE_SOFT_SPI)

//------------------------------------------------------------------------------
// Hardware SPI
Expand Down Expand Up @@ -190,22 +179,26 @@ void spiBegin (void) {
}


#else
#else // SOFTWARE_SPI || FORCE_SOFT_SPI

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

/** nop to tune soft SPI timing */
// nop to tune soft SPI timing
#define nop asm volatile ("\tnop\n")

/** Set SPI rate */
// Set SPI rate
void spiInit(uint8_t spiRate) {
UNUSED(spiRate); // nothing to do
}

/** Begin SPI transaction, set clock, bit order, data mode */
// Begin SPI transaction, set clock, bit order, data mode
void spiBeginTransaction(uint32_t spiClock, uint8_t bitOrder, uint8_t dataMode) {
UNUSED(spiBeginTransaction); // nothing to do
}

/** Soft SPI receive byte */
// Soft SPI receive byte
uint8_t spiRec() {
uint8_t data = 0;
// no interrupts during byte receive - about 8µs
Expand All @@ -230,13 +223,13 @@ void spiBegin (void) {
return data;
}

/** Soft SPI read data */
// Soft SPI read data
void spiRead(uint8_t* buf, uint16_t nbyte) {
for (uint16_t i = 0; i < nbyte; i++)
buf[i] = spiRec();
}

/** Soft SPI send byte */
// Soft SPI send byte
void spiSend(uint8_t data) {
// no interrupts during byte send - about 8µs
cli();
Expand All @@ -257,13 +250,13 @@ void spiBegin (void) {
sei();
}

/** Soft SPI send block */
// Soft SPI send block
void spiSendBlock(uint8_t token, const uint8_t* buf) {
spiSend(token);
for (uint16_t i = 0; i < 512; i++)
spiSend(buf[i]);
}

#endif // SOFTWARE_SPI
#endif // SOFTWARE_SPI || FORCE_SOFT_SPI

#endif // __AVR__
24 changes: 12 additions & 12 deletions Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -739,24 +739,24 @@

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

#ifdef INTERNAL_SERIAL_PORT

#if defined(INTERNAL_SERIAL_PORT)

ISR(SERIAL_REGNAME(USART,INTERNAL_SERIAL_PORT,_RX_vect)) {
MarlinSerial<MarlinInternalSerialCfg<INTERNAL_SERIAL_PORT>>::store_rxd_char();
}
ISR(SERIAL_REGNAME(USART,INTERNAL_SERIAL_PORT,_RX_vect)) {
MarlinSerial<MarlinInternalSerialCfg<INTERNAL_SERIAL_PORT>>::store_rxd_char();
}

ISR(SERIAL_REGNAME(USART,INTERNAL_SERIAL_PORT,_UDRE_vect)) {
MarlinSerial<MarlinInternalSerialCfg<INTERNAL_SERIAL_PORT>>::_tx_udr_empty_irq();
}
ISR(SERIAL_REGNAME(USART,INTERNAL_SERIAL_PORT,_UDRE_vect)) {
MarlinSerial<MarlinInternalSerialCfg<INTERNAL_SERIAL_PORT>>::_tx_udr_empty_irq();
}

// Preinstantiate
template class MarlinSerial<MarlinInternalSerialCfg<INTERNAL_SERIAL_PORT>>;
// Preinstantiate
template class MarlinSerial<MarlinInternalSerialCfg<INTERNAL_SERIAL_PORT>>;

// Instantiate
MarlinSerial<MarlinInternalSerialCfg<INTERNAL_SERIAL_PORT>> internalSerial;
// Instantiate
MarlinSerial<MarlinInternalSerialCfg<INTERNAL_SERIAL_PORT>> internalSerial;

#endif

// For AT90USB targets use the UART for BT interfacing
#if defined(USBCON) && ENABLED(BLUETOOTH)
HardwareSerial bluetoothSerial;
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/HAL_AVR/MarlinSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@
#endif // !USBCON


#if defined(INTERNAL_SERIAL_PORT)
#ifdef INTERNAL_SERIAL_PORT
template <uint8_t serial>
struct MarlinInternalSerialCfg {
static constexpr int PORT = serial;
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/HAL/HAL_AVR/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
* Sanity checks for Spindle / Laser
*/
#if ENABLED(SPINDLE_LASER_ENABLE)
#if !PIN_EXISTS(SPINDLE_LASER_ENABLE)
#error "SPINDLE_LASER_ENABLE requires SPINDLE_LASER_ENABLE_PIN."
#if !PIN_EXISTS(SPINDLE_LASER_ENA)
#error "SPINDLE_LASER_ENABLE requires SPINDLE_LASER_ENA_PIN."
#elif SPINDLE_DIR_CHANGE && !PIN_EXISTS(SPINDLE_DIR)
#error "SPINDLE_DIR_PIN not defined."
#elif ENABLED(SPINDLE_LASER_PWM) && PIN_EXISTS(SPINDLE_LASER_PWM)
Expand Down
8 changes: 4 additions & 4 deletions Marlin/src/HAL/HAL_AVR/ServoTimers.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,16 @@
#endif

typedef enum {
#if ENABLED(_useTimer1)
#ifdef _useTimer1
_timer1,
#endif
#if ENABLED(_useTimer3)
#ifdef _useTimer3
_timer3,
#endif
#if ENABLED(_useTimer4)
#ifdef _useTimer4
_timer4,
#endif
#if ENABLED(_useTimer5)
#ifdef _useTimer5
_timer5,
#endif
_Nbr_16timers
Expand Down
Loading

0 comments on commit 8256043

Please sign in to comment.