Skip to content

Commit

Permalink
Merge pull request #12 from JGMaker3dofficial/UpgradetoMarlin2.0.1
Browse files Browse the repository at this point in the history
Upgrade  Base Code to marlin2.0.1
  • Loading branch information
TwinkieXLII committed Feb 2, 2021
2 parents fde2566 + 7c985f8 commit e906ef8
Show file tree
Hide file tree
Showing 442 changed files with 32,401 additions and 6,786 deletions.
84 changes: 0 additions & 84 deletions .travis.yml

This file was deleted.

16 changes: 11 additions & 5 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -712,14 +712,14 @@
* following movement settings. If fewer factors are given than the
* total number of extruders, the last value applies to the rest.
*/
//#define DISTINCT_E_FACTORS
#define DISTINCT_E_FACTORS

/**
* Default Axis Steps Per Unit (steps/mm)
* Override with M92
* X, Y, Z, E0 [, E1[, E2...]]
*/
#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 98 }
#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 98, 98 }

/**
* Default Max Feed Rate (mm/s)
Expand Down Expand Up @@ -856,6 +856,12 @@
*/
//#define FIX_MOUNTED_PROBE

/**
* Use the nozzle as the probe, as with a conductive
* nozzle system or a piezo-electric smart effector.
*/
//#define NOZZLE_AS_PROBE

/**
* Z Servo Probe, such as an endstop switch on a rotating arm.
*/
Expand Down Expand Up @@ -1772,7 +1778,7 @@

//
// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller
// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html
// https://www.aliexpress.com/item/32765887917.html
//
//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602

Expand Down Expand Up @@ -1946,7 +1952,7 @@

//
// Factory display for Creality CR-10
// https://www.aliexpress.com/item/Universal-LCD-12864-3D-Printer-Display-Screen-With-Encoder-For-CR-10-CR-7-Model/32833148327.html
// https://www.aliexpress.com/item/32833148327.html
//
// This is RAMPS-compatible using a single 10-pin connector.
// (For CR-10 owners who want to replace the Melzi Creality board but retain the display)
Expand All @@ -1964,7 +1970,7 @@

//
// AZSMZ 12864 LCD with SD
// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html
// https://www.aliexpress.com/item/32837222770.html
//
//#define AZSMZ_12864

Expand Down
21 changes: 9 additions & 12 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@
//#define Z_STEPPER_AUTO_ALIGN
#if ENABLED(Z_STEPPER_AUTO_ALIGN)
// Define probe X and Y positions for Z1, Z2 [, Z3]
#define Z_STEPPER_ALIGN_XY { { 10, 290 }, { 150, 10 }, { 290, 290 } }
#define Z_STEPPER_ALIGN_XY { { 10, 190 }, { 100, 10 }, { 190, 190 } }

// Provide Z stepper positions for more rapid convergence in bed alignment.
// Currently requires triple stepper drivers.
Expand Down Expand Up @@ -1562,12 +1562,12 @@
/**
* Maximum stepping rate (in Hz) the stepper driver allows
* If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE)
* 500000 : Maximum for A4988 stepper driver
* 400000 : Maximum for TMC2xxx stepper drivers
* 250000 : Maximum for DRV8825 stepper driver
* 200000 : Maximum for LV8729 stepper driver
* 150000 : Maximum for TB6600 stepper driver
* 15000 : Maximum for TB6560 stepper driver
* 5000000 : Maximum for TMC2xxx stepper drivers
* 1000000 : Maximum for LV8729 stepper driver
* 500000 : Maximum for A4988 stepper driver
* 250000 : Maximum for DRV8825 stepper driver
* 150000 : Maximum for TB6600 stepper driver
* 15000 : Maximum for TB6560 stepper driver
*
* Override the default value based on the driver type set in Configuration.h.
*/
Expand Down Expand Up @@ -1765,8 +1765,8 @@
//#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused.

// Filament Unload does a Retract, Delay, and Purge first:
#define FILAMENT_UNLOAD_RETRACT_LENGTH 13 // (mm) Unload initial retract length.
#define FILAMENT_UNLOAD_DELAY 5000 // (ms) Delay for the filament to cool after retract.
#define FILAMENT_UNLOAD_PURGE_RETRACT 13 // (mm) Unload initial retract length.
#define FILAMENT_UNLOAD_PURGE_DELAY 5000 // (ms) Delay for the filament to cool after retract.
#define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged.

#define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety.
Expand Down Expand Up @@ -2142,8 +2142,6 @@
*
* IMPROVE_HOMING_RELIABILITY tunes acceleration and jerk when
* homing and adds a guard period for endstop triggering.
*
* TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING
*/
//#define SENSORLESS_HOMING // StallGuard capable drivers only

Expand All @@ -2162,7 +2160,6 @@
#define Y_STALL_SENSITIVITY 8
//#define Z_STALL_SENSITIVITY 8
//#define SPI_ENDSTOPS // TMC2130 only
//#define HOME_USING_SPREADCYCLE
//#define IMPROVE_HOMING_RELIABILITY
#endif

Expand Down
2 changes: 1 addition & 1 deletion Marlin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ else ifeq ($(HARDWARE_MOTHERBOARD),1109)
else ifeq ($(HARDWARE_MOTHERBOARD),1110)
# zrib V2.0 control board (Chinese knock off RAMPS replica)
else ifeq ($(HARDWARE_MOTHERBOARD),1111)
# Bigtreetech or BIQU KFB2.0
# BigTreeTech or BIQU KFB2.0
else ifeq ($(HARDWARE_MOTHERBOARD),1112)
# Felix 2.0+ Electronics Board (RAMPS like)
else ifeq ($(HARDWARE_MOTHERBOARD),1113)
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/HAL_AVR/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
* Checks for FAST PWM
*/
#if ENABLED(FAST_PWM_FAN) && (ENABLED(USE_OCR2A_AS_TOP) && defined(TCCR2))
#error "USE_OCR2A_AS_TOP does not apply to devices with a single output TIMER2"
#error "USE_OCR2A_AS_TOP does not apply to devices with a single output TIMER2"
#endif

/**
Expand Down
7 changes: 7 additions & 0 deletions Marlin/src/HAL/HAL_AVR/pinsDebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@

#define NUMBER_PINS_TOTAL NUM_DIGITAL_PINS

#define AVR_ATmega2560_FAMILY_PLUS_70 MB(BQ_ZUM_MEGA_3D, MIGHTYBOARD_REVE, MINIRAMBO, SCOOVO_X9H)

#if AVR_AT90USB1286_FAMILY

// Working with Teensyduino extension so need to re-define some things
#include "pinsDebug_Teensyduino.h"
// Can't use the "digitalPinToPort" function from the Teensyduino type IDEs
Expand All @@ -35,19 +38,23 @@
#define digitalPinToBitMask_DEBUG(p) digitalPinToBitMask(p)
#define digitalPinToPort_DEBUG(p) digitalPinToPort_Teensy(p)
#define GET_PINMODE(pin) (*portModeRegister(pin) & digitalPinToBitMask_DEBUG(pin))

#elif AVR_ATmega2560_FAMILY_PLUS_70 // So we can access/display all the pins on boards using more than 70

#include "pinsDebug_plus_70.h"
#define digitalPinToTimer_DEBUG(p) digitalPinToTimer_plus_70(p)
#define digitalPinToBitMask_DEBUG(p) digitalPinToBitMask_plus_70(p)
#define digitalPinToPort_DEBUG(p) digitalPinToPort_plus_70(p)
bool GET_PINMODE(int8_t pin) {return *portModeRegister(digitalPinToPort_DEBUG(pin)) & digitalPinToBitMask_DEBUG(pin); }

#else

#define digitalPinToTimer_DEBUG(p) digitalPinToTimer(p)
#define digitalPinToBitMask_DEBUG(p) digitalPinToBitMask(p)
#define digitalPinToPort_DEBUG(p) digitalPinToPort(p)
bool GET_PINMODE(int8_t pin) {return *portModeRegister(digitalPinToPort_DEBUG(pin)) & digitalPinToBitMask_DEBUG(pin); }
#define GET_ARRAY_PIN(p) pgm_read_byte(&pin_array[p].pin)

#endif

#define VALID_PIN(pin) (pin >= 0 && pin < NUM_DIGITAL_PINS ? 1 : 0)
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 @@ -30,7 +30,7 @@

#include "../../inc/MarlinConfigPre.h"

#if EITHER(EEPROM_SETTINGS, WEBSUPPORT)
#if ENABLED(WEBSUPPORT)
#include "spiffs.h"
#endif

Expand Down Expand Up @@ -83,7 +83,7 @@ void HAL_init() {
}

void HAL_init_board() {
#if EITHER(EEPROM_SETTINGS, WEBSUPPORT)
#if ENABLED(WEBSUPPORT)
spiffs_init();
#endif

Expand Down
12 changes: 7 additions & 5 deletions Marlin/src/HAL/HAL_ESP32/WebSocketSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,16 @@

#include <Stream.h>

#ifndef RX_BUFFER_SIZE
#define RX_BUFFER_SIZE 128
#endif
#ifndef TX_BUFFER_SIZE
#define TX_BUFFER_SIZE 32
#endif
#if TX_BUFFER_SIZE <= 0
#error "TX_BUFFER_SIZE is required for the WebSocket."
#if ENABLED(WIFISUPPORT)
#ifndef RX_BUFFER_SIZE
#define RX_BUFFER_SIZE 128
#endif
#if TX_BUFFER_SIZE <= 0
#error "TX_BUFFER_SIZE is required for the WebSocket."
#endif
#endif

typedef uint16_t ring_buffer_pos_t;
Expand Down
63 changes: 63 additions & 0 deletions Marlin/src/HAL/HAL_ESP32/persistent_store_impl.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/**
* 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 ARDUINO_ARCH_ESP32

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

#if ENABLED(EEPROM_SETTINGS) && DISABLED(FLASH_EEPROM_EMULATION)

#include "../shared/persistent_store_api.h"
#include "EEPROM.h"

#define EEPROM_SIZE 4096

bool PersistentStore::access_start() {
return EEPROM.begin(EEPROM_SIZE);
}

bool PersistentStore::access_finish() {
EEPROM.end();
return true;
}

bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
for (size_t i = 0; i < size; i++) {
EEPROM.write(pos++, value[i]);
crc16(crc, &value[i], 1);
}
return false;
}

bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
for (size_t i = 0; i < size; i++) {
uint8_t c = EEPROM.read(pos++);
if (writing) value[i] = c;
crc16(crc, &c, 1);
}
return false;
}

size_t PersistentStore::capacity() { return EEPROM_SIZE; }

#endif // EEPROM_SETTINGS
#endif // ARDUINO_ARCH_ESP32
Loading

0 comments on commit e906ef8

Please sign in to comment.