Merge branch 'bugfix-2.0.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.0.x
This commit is contained in:
@@ -1049,6 +1049,10 @@
|
||||
|
||||
#define EVENT_GCODE_SD_STOP "G28XY" // G-code to run on Stop Print (e.g., "G28XY" or "G27")
|
||||
|
||||
#if ENABLED(PRINTER_EVENT_LEDS)
|
||||
#define PE_LEDS_COMPLETED_TIME (30*60) // (seconds) Time to keep the LED "done" color before restoring normal illumination
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Continue after Power-Loss (Creality3D)
|
||||
*
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
#if EITHER(EEPROM_SETTINGS, SD_FIRMWARE_UPDATE)
|
||||
|
||||
#include "../shared/persistent_store_api.h"
|
||||
#include "../shared/eeprom_api.h"
|
||||
|
||||
bool PersistentStore::access_start() { return true; }
|
||||
bool PersistentStore::access_finish() { return true; }
|
||||
@@ -57,7 +57,7 @@
|
||||
#if ENABLED(FLASH_EEPROM_EMULATION)
|
||||
|
||||
#include "../shared/Marduino.h"
|
||||
#include "../shared/persistent_store_api.h"
|
||||
#include "../shared/eeprom_api.h"
|
||||
|
||||
#define EEPROMSize 4096
|
||||
#define PagesPerGroup 128
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#if ENABLED(EEPROM_SETTINGS)
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
#include "../shared/persistent_store_api.h"
|
||||
#include "../shared/eeprom_api.h"
|
||||
|
||||
#if !defined(E2END) && ENABLED(FLASH_EEPROM_EMULATION)
|
||||
#define E2END 0xFFF // Default to Flash emulated EEPROM size (EepromEmulation_Due.cpp)
|
||||
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#if USE_EMULATED_EEPROM
|
||||
#if USE_FALLBACK_EEPROM
|
||||
#undef SRAM_EEPROM_EMULATION
|
||||
#undef SDCARD_EEPROM_EMULATION
|
||||
#define FLASH_EEPROM_EMULATION
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@
|
||||
|
||||
#if ENABLED(EEPROM_SETTINGS) && DISABLED(FLASH_EEPROM_EMULATION)
|
||||
|
||||
#include "../shared/persistent_store_api.h"
|
||||
#include "../shared/eeprom_api.h"
|
||||
#include "EEPROM.h"
|
||||
|
||||
#define EEPROM_SIZE 4096
|
||||
@@ -22,6 +22,6 @@
|
||||
#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)
|
||||
#if ENABLED(EEPROM_SETTINGS) && NONE(USE_WIRED_EEPROM, FLASH_EEPROM_EMULATION, SRAM_EEPROM_EMULATION)
|
||||
#define SDCARD_EEPROM_EMULATION
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@
|
||||
|
||||
#if ENABLED(EEPROM_SETTINGS)
|
||||
|
||||
#include "../shared/persistent_store_api.h"
|
||||
#include "../shared/eeprom_api.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#define LINUX_EEPROM_SIZE (E2END + 1)
|
||||
@@ -21,6 +21,6 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "../shared/persistent_store_api.h"
|
||||
#include "../shared/eeprom_api.h"
|
||||
|
||||
#define FLASH_EEPROM_EMULATION
|
||||
+1
-1
@@ -40,7 +40,7 @@
|
||||
|
||||
#if ENABLED(FLASH_EEPROM_EMULATION)
|
||||
|
||||
#include "persistent_store_api.h"
|
||||
#include "eeprom_api.h"
|
||||
|
||||
extern "C" {
|
||||
#include <lpc17xx_iap.h>
|
||||
+1
-1
@@ -26,7 +26,7 @@
|
||||
|
||||
#if ENABLED(SDCARD_EEPROM_EMULATION)
|
||||
|
||||
#include "persistent_store_api.h"
|
||||
#include "eeprom_api.h"
|
||||
|
||||
#include <chanfs/diskio.h>
|
||||
#include <chanfs/ff.h>
|
||||
@@ -21,6 +21,6 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#if USE_EMULATED_EEPROM && NONE(SDCARD_EEPROM_EMULATION, SRAM_EEPROM_EMULATION)
|
||||
#if USE_FALLBACK_EEPROM && NONE(SDCARD_EEPROM_EMULATION, SRAM_EEPROM_EMULATION)
|
||||
#define FLASH_EEPROM_EMULATION
|
||||
#endif
|
||||
|
||||
@@ -90,7 +90,7 @@ void HAL_init() {
|
||||
|
||||
//debug_frmwrk_init();
|
||||
//_DBG("\n\nDebug running\n");
|
||||
// Initialise the SD card chip select pins as soon as possible
|
||||
// Initialize the SD card chip select pins as soon as possible
|
||||
#if PIN_EXISTS(SS)
|
||||
OUT_WRITE(SS_PIN, HIGH);
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
/**
|
||||
* 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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(QSPI_EEPROM)
|
||||
|
||||
#include "QSPIFlash.h"
|
||||
|
||||
#define INVALID_ADDR 0xffffffff
|
||||
#define SECTOR_OF(a) (a & ~(SFLASH_SECTOR_SIZE - 1))
|
||||
#define OFFSET_OF(a) (a & (SFLASH_SECTOR_SIZE - 1))
|
||||
|
||||
Adafruit_SPIFlashBase * QSPIFlash::_flashBase = nullptr;
|
||||
uint8_t QSPIFlash::_buf[SFLASH_SECTOR_SIZE];
|
||||
uint32_t QSPIFlash::_addr = INVALID_ADDR;
|
||||
|
||||
void QSPIFlash::begin() {
|
||||
if (_flashBase != nullptr) return;
|
||||
|
||||
_flashBase = new Adafruit_SPIFlashBase(new Adafruit_FlashTransport_QSPI());
|
||||
_flashBase->begin(NULL);
|
||||
}
|
||||
|
||||
size_t QSPIFlash::size() {
|
||||
return _flashBase->size();
|
||||
}
|
||||
|
||||
uint8_t QSPIFlash::readByte(const uint32_t address) {
|
||||
if (SECTOR_OF(address) == _addr) return _buf[OFFSET_OF(address)];
|
||||
|
||||
return _flashBase->read8(address);
|
||||
}
|
||||
|
||||
void QSPIFlash::writeByte(const uint32_t address, const uint8_t value) {
|
||||
uint32_t const sector_addr = SECTOR_OF(address);
|
||||
|
||||
// Page changes, flush old and update new cache
|
||||
if (sector_addr != _addr) {
|
||||
flush();
|
||||
_addr = sector_addr;
|
||||
|
||||
// read a whole page from flash
|
||||
_flashBase->readBuffer(sector_addr, _buf, SFLASH_SECTOR_SIZE);
|
||||
}
|
||||
|
||||
_buf[OFFSET_OF(address)] = value;
|
||||
}
|
||||
|
||||
void QSPIFlash::flush() {
|
||||
if (_addr == INVALID_ADDR) return;
|
||||
|
||||
_flashBase->eraseSector(_addr / SFLASH_SECTOR_SIZE);
|
||||
_flashBase->writeBuffer(_addr, _buf, SFLASH_SECTOR_SIZE);
|
||||
|
||||
_addr = INVALID_ADDR;
|
||||
}
|
||||
|
||||
#endif // QSPI_EEPROM
|
||||
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* @file QSPIFlash.h
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2019 Ha Thach and Dean Miller for Adafruit Industries LLC
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
* Derived from Adafruit_SPIFlash class with no SdFat references
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Adafruit_SPIFlashBase.h"
|
||||
|
||||
// This class extends Adafruit_SPIFlashBase by adding caching support.
|
||||
//
|
||||
// This class will use 4096 Bytes of RAM as a block cache.
|
||||
class QSPIFlash {
|
||||
public:
|
||||
static void begin();
|
||||
static size_t size();
|
||||
static uint8_t readByte(const uint32_t address);
|
||||
static void writeByte(const uint32_t address, const uint8_t v);
|
||||
static void flush();
|
||||
|
||||
private:
|
||||
static Adafruit_SPIFlashBase * _flashBase;
|
||||
static uint8_t _buf[SFLASH_SECTOR_SIZE];
|
||||
static uint32_t _addr;
|
||||
};
|
||||
|
||||
extern QSPIFlash qspi;
|
||||
@@ -0,0 +1,66 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
*
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
* SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
|
||||
*
|
||||
* 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 __SAMD51__
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(EEPROM_SETTINGS) && NONE(QSPI_EEPROM, FLASH_EEPROM_EMULATION)
|
||||
|
||||
#include "../shared/eeprom_api.h"
|
||||
|
||||
size_t PersistentStore::capacity() { return E2END + 1; }
|
||||
|
||||
bool PersistentStore::access_start() { return true; }
|
||||
bool PersistentStore::access_finish() { return true; }
|
||||
|
||||
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
|
||||
while (size--) {
|
||||
const uint8_t v = *value;
|
||||
uint8_t * const p = (uint8_t * const)pos;
|
||||
if (v != eeprom_read_byte(p)) {
|
||||
eeprom_write_byte(p, v);
|
||||
delay(2);
|
||||
if (eeprom_read_byte(p) != v) {
|
||||
SERIAL_ECHO_MSG(STR_ERR_EEPROM_WRITE);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
crc16(crc, &v, 1);
|
||||
pos++;
|
||||
value++;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
|
||||
while (size--) {
|
||||
uint8_t c = eeprom_read_byte((uint8_t*)pos);
|
||||
if (writing) *value = c;
|
||||
crc16(crc, &c, 1);
|
||||
pos++;
|
||||
value++;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // EEPROM_SETTINGS && !(QSPI_EEPROM || FLASH_EEPROM_EMULATION)
|
||||
#endif // __SAMD51__
|
||||
@@ -0,0 +1,96 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
*
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
* SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
|
||||
*
|
||||
* 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 __SAMD51__
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(FLASH_EEPROM_EMULATION)
|
||||
|
||||
#include "../shared/eeprom_api.h"
|
||||
|
||||
#define NVMCTRL_CMD(c) do{ \
|
||||
SYNC(!NVMCTRL->STATUS.bit.READY); \
|
||||
NVMCTRL->INTFLAG.bit.DONE = true; \
|
||||
NVMCTRL->CTRLB.reg = c | NVMCTRL_CTRLB_CMDEX_KEY; \
|
||||
SYNC(NVMCTRL->INTFLAG.bit.DONE); \
|
||||
}while(0)
|
||||
#define NVMCTRL_FLUSH() do{ \
|
||||
if (NVMCTRL->SEESTAT.bit.LOAD) \
|
||||
NVMCTRL_CMD(NVMCTRL_CTRLB_CMD_SEEFLUSH); \
|
||||
}while(0)
|
||||
|
||||
size_t PersistentStore::capacity() {
|
||||
const uint8_t psz = NVMCTRL->SEESTAT.bit.PSZ,
|
||||
sblk = NVMCTRL->SEESTAT.bit.SBLK;
|
||||
|
||||
return (!psz && !sblk) ? 0
|
||||
: (psz <= 2) ? (0x200 << psz)
|
||||
: (sblk == 1 || psz == 3) ? 4096
|
||||
: (sblk == 2 || psz == 4) ? 8192
|
||||
: (sblk <= 4 || psz == 5) ? 16384
|
||||
: (sblk >= 9 && psz == 7) ? 65536
|
||||
: 32768;
|
||||
}
|
||||
|
||||
bool PersistentStore::access_start() {
|
||||
NVMCTRL->SEECFG.reg = NVMCTRL_SEECFG_WMODE_BUFFERED; // Buffered mode and segment reallocation active
|
||||
if (NVMCTRL->SEESTAT.bit.RLOCK)
|
||||
NVMCTRL_CMD(NVMCTRL_CTRLB_CMD_USEE); // Unlock E2P data write access
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PersistentStore::access_finish() {
|
||||
NVMCTRL_FLUSH();
|
||||
if (!NVMCTRL->SEESTAT.bit.LOCK)
|
||||
NVMCTRL_CMD(NVMCTRL_CTRLB_CMD_LSEE); // Lock E2P data write access
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
|
||||
while (size--) {
|
||||
const uint8_t v = *value;
|
||||
SYNC(NVMCTRL->SEESTAT.bit.BUSY);
|
||||
if (NVMCTRL->INTFLAG.bit.SEESFULL)
|
||||
NVMCTRL_FLUSH(); // Next write will trigger a sector reallocation. I need to flush 'pagebuffer'
|
||||
((volatile uint8_t *)SEEPROM_ADDR)[pos] = v;
|
||||
SYNC(!NVMCTRL->INTFLAG.bit.SEEWRC);
|
||||
crc16(crc, &v, 1);
|
||||
pos++;
|
||||
value++;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
|
||||
while (size--) {
|
||||
SYNC(NVMCTRL->SEESTAT.bit.BUSY);
|
||||
uint8_t c = ((volatile uint8_t *)SEEPROM_ADDR)[pos];
|
||||
if (writing) *value = c;
|
||||
crc16(crc, &c, 1);
|
||||
pos++;
|
||||
value++;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // FLASH_EEPROM_EMULATION
|
||||
#endif // __SAMD51__
|
||||
@@ -0,0 +1,71 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
*
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
* SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
|
||||
*
|
||||
* 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 __SAMD51__
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(QSPI_EEPROM)
|
||||
|
||||
#include "../shared/eeprom_api.h"
|
||||
|
||||
#include "QSPIFlash.h"
|
||||
|
||||
static bool initialized;
|
||||
|
||||
size_t PersistentStore::capacity() { return qspi.size(); }
|
||||
|
||||
bool PersistentStore::access_start() {
|
||||
if (!initialized) {
|
||||
qspi.begin();
|
||||
initialized = true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PersistentStore::access_finish() {
|
||||
qspi.flush();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
|
||||
while (size--) {
|
||||
const uint8_t v = *value;
|
||||
qspi.writeByte(pos, v);
|
||||
crc16(crc, &v, 1);
|
||||
pos++;
|
||||
value++;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
|
||||
while (size--) {
|
||||
uint8_t c = qspi.readByte(pos);
|
||||
if (writing) *value = c;
|
||||
crc16(crc, &c, 1);
|
||||
pos++;
|
||||
value++;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // QSPI_EEPROM
|
||||
#endif // __SAMD51__
|
||||
@@ -21,8 +21,6 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#if USE_EMULATED_EEPROM
|
||||
#undef SRAM_EEPROM_EMULATION
|
||||
#undef SDCARD_EEPROM_EMULATION
|
||||
#if USE_FALLBACK_EEPROM && NONE(SDCARD_EEPROM_EMULATION, SRAM_EEPROM_EMULATION)
|
||||
#define FLASH_EEPROM_EMULATION
|
||||
#endif
|
||||
|
||||
@@ -1,129 +0,0 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
*
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
* SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
|
||||
*
|
||||
* 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 __SAMD51__
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(EEPROM_SETTINGS)
|
||||
|
||||
#include "../shared/persistent_store_api.h"
|
||||
|
||||
#if ENABLED(FLASH_EEPROM_EMULATION)
|
||||
#define NVMCTRL_CMD(c) do{ \
|
||||
SYNC(!NVMCTRL->STATUS.bit.READY); \
|
||||
NVMCTRL->INTFLAG.bit.DONE = true; \
|
||||
NVMCTRL->CTRLB.reg = c | NVMCTRL_CTRLB_CMDEX_KEY; \
|
||||
SYNC(NVMCTRL->INTFLAG.bit.DONE); \
|
||||
}while(0)
|
||||
#define NVMCTRL_FLUSH() do{ \
|
||||
if (NVMCTRL->SEESTAT.bit.LOAD) \
|
||||
NVMCTRL_CMD(NVMCTRL_CTRLB_CMD_SEEFLUSH); \
|
||||
}while(0)
|
||||
#endif
|
||||
|
||||
bool PersistentStore::access_start() {
|
||||
#if ENABLED(FLASH_EEPROM_EMULATION)
|
||||
NVMCTRL->SEECFG.reg = NVMCTRL_SEECFG_WMODE_BUFFERED; // Buffered mode and segment reallocation active
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PersistentStore::access_finish() {
|
||||
#if ENABLED(FLASH_EEPROM_EMULATION)
|
||||
NVMCTRL_FLUSH();
|
||||
if (!NVMCTRL->SEESTAT.bit.LOCK)
|
||||
NVMCTRL_CMD(NVMCTRL_CTRLB_CMD_LSEE); // Lock E2P data write access
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
|
||||
#if ENABLED(FLASH_EEPROM_EMULATION)
|
||||
if (NVMCTRL->SEESTAT.bit.RLOCK)
|
||||
NVMCTRL_CMD(NVMCTRL_CTRLB_CMD_USEE); // Unlock E2P data write access
|
||||
#endif
|
||||
|
||||
while (size--) {
|
||||
const uint8_t v = *value;
|
||||
#if ENABLED(FLASH_EEPROM_EMULATION)
|
||||
SYNC(NVMCTRL->SEESTAT.bit.BUSY);
|
||||
if (NVMCTRL->INTFLAG.bit.SEESFULL)
|
||||
NVMCTRL_FLUSH(); // Next write will trigger a sector reallocation. I need to flush 'pagebuffer'
|
||||
((volatile uint8_t *)SEEPROM_ADDR)[pos] = v;
|
||||
SYNC(!NVMCTRL->INTFLAG.bit.SEEWRC);
|
||||
#else
|
||||
uint8_t * const p = (uint8_t * const)pos;
|
||||
if (v != eeprom_read_byte(p)) {
|
||||
eeprom_write_byte(p, v);
|
||||
delay(2);
|
||||
if (eeprom_read_byte(p) != v) {
|
||||
SERIAL_ECHO_MSG(STR_ERR_EEPROM_WRITE);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
crc16(crc, &v, 1);
|
||||
pos++;
|
||||
value++;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
|
||||
while (size--) {
|
||||
uint8_t c;
|
||||
#if ENABLED(FLASH_EEPROM_EMULATION)
|
||||
SYNC(NVMCTRL->SEESTAT.bit.BUSY);
|
||||
c = ((volatile uint8_t *)SEEPROM_ADDR)[pos];
|
||||
#else
|
||||
c = eeprom_read_byte((uint8_t*)pos);
|
||||
#endif
|
||||
if (writing) *value = c;
|
||||
crc16(crc, &c, 1);
|
||||
pos++;
|
||||
value++;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t PersistentStore::capacity() {
|
||||
#if ENABLED(FLASH_EEPROM_EMULATION)
|
||||
const uint8_t psz = NVMCTRL->SEESTAT.bit.PSZ,
|
||||
sblk = NVMCTRL->SEESTAT.bit.SBLK;
|
||||
|
||||
if (!psz && !sblk) return 0;
|
||||
else if (psz <= 2) return (0x200 << psz);
|
||||
else if (sblk == 1 || psz == 3) return 4096;
|
||||
else if (sblk == 2 || psz == 4) return 8192;
|
||||
else if (sblk <= 4 || psz == 5) return 16384;
|
||||
else if (sblk >= 9 && psz == 7) return 65536;
|
||||
else return 32768;
|
||||
#else
|
||||
return E2END + 1;
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // EEPROM_SETTINGS
|
||||
|
||||
#endif // __SAMD51__
|
||||
@@ -29,9 +29,7 @@
|
||||
* The latest version of this library can always be found at
|
||||
* http://arduiniana.org.
|
||||
*/
|
||||
|
||||
#ifndef SOFTWARESERIAL_H
|
||||
#define SOFTWARESERIAL_H
|
||||
#pragma once
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
@@ -64,7 +62,6 @@ class SoftwareSerial : public Stream {
|
||||
uint32_t delta_start = 0;
|
||||
|
||||
// static data
|
||||
static bool initialised;
|
||||
static HardwareTimer timer;
|
||||
static const IRQn_Type timer_interrupt_number;
|
||||
static uint32_t timer_interrupt_priority;
|
||||
@@ -91,7 +88,7 @@ class SoftwareSerial : public Stream {
|
||||
public:
|
||||
// public methods
|
||||
|
||||
SoftwareSerial(uint16_t receivePin, uint16_t transmitPin, bool inverse_logic = false);
|
||||
SoftwareSerial(uint16_t receivePin, uint16_t transmitPin, bool inverse_logic=false);
|
||||
virtual ~SoftwareSerial();
|
||||
void begin(long speed);
|
||||
bool listen();
|
||||
@@ -115,5 +112,3 @@ class SoftwareSerial : public Stream {
|
||||
|
||||
using Print::write;
|
||||
};
|
||||
|
||||
#endif // SOFTWARESERIAL_H
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@
|
||||
|
||||
#if BOTH(EEPROM_SETTINGS, FLASH_EEPROM_EMULATION)
|
||||
|
||||
#include "../shared/persistent_store_api.h"
|
||||
#include "../shared/eeprom_api.h"
|
||||
|
||||
|
||||
// Only STM32F4 can support wear leveling at this time
|
||||
+6
-6
@@ -24,9 +24,9 @@
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if EITHER(USE_REAL_EEPROM, SRAM_EEPROM_EMULATION)
|
||||
#if EITHER(USE_WIRED_EEPROM, SRAM_EEPROM_EMULATION)
|
||||
|
||||
#include "../shared/persistent_store_api.h"
|
||||
#include "../shared/eeprom_api.h"
|
||||
|
||||
bool PersistentStore::access_start() {
|
||||
return true;
|
||||
@@ -41,7 +41,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
|
||||
uint8_t v = *value;
|
||||
|
||||
// Save to either external EEPROM, program flash or Backup SRAM
|
||||
#if USE_REAL_EEPROM
|
||||
#if USE_WIRED_EEPROM
|
||||
// EEPROM has only ~100,000 write cycles,
|
||||
// so only write bytes that have changed!
|
||||
uint8_t * const p = (uint8_t * const)pos;
|
||||
@@ -68,7 +68,7 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t
|
||||
do {
|
||||
// Read from either external EEPROM, program flash or Backup SRAM
|
||||
const uint8_t c = (
|
||||
#if USE_REAL_EEPROM
|
||||
#if USE_WIRED_EEPROM
|
||||
eeprom_read_byte((uint8_t*)pos)
|
||||
#else
|
||||
(*(__IO uint8_t *)(BKPSRAM_BASE + ((uint8_t*)pos)))
|
||||
@@ -85,7 +85,7 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t
|
||||
|
||||
size_t PersistentStore::capacity() {
|
||||
return (
|
||||
#if USE_REAL_EEPROM
|
||||
#if USE_WIRED_EEPROM
|
||||
E2END + 1
|
||||
#else
|
||||
4096 // 4kB
|
||||
@@ -93,5 +93,5 @@ size_t PersistentStore::capacity() {
|
||||
);
|
||||
}
|
||||
|
||||
#endif // USE_REAL_EEPROM || SRAM_EEPROM_EMULATION
|
||||
#endif // USE_WIRED_EEPROM || SRAM_EEPROM_EMULATION
|
||||
#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC
|
||||
+1
-1
@@ -30,7 +30,7 @@
|
||||
|
||||
#if ENABLED(SDCARD_EEPROM_EMULATION)
|
||||
|
||||
#include "../shared/persistent_store_api.h"
|
||||
#include "../shared/eeprom_api.h"
|
||||
|
||||
#ifndef E2END
|
||||
#define E2END 0xFFF // 4KB
|
||||
@@ -22,6 +22,6 @@
|
||||
#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)
|
||||
#if ENABLED(EEPROM_SETTINGS) && NONE(USE_WIRED_EEPROM, FLASH_EEPROM_EMULATION, SRAM_EEPROM_EMULATION)
|
||||
#define SDCARD_EEPROM_EMULATION
|
||||
#endif
|
||||
|
||||
+3
-3
@@ -22,9 +22,9 @@
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if USE_REAL_EEPROM
|
||||
#if USE_WIRED_EEPROM
|
||||
|
||||
#include "../shared/persistent_store_api.h"
|
||||
#include "../shared/eeprom_api.h"
|
||||
|
||||
bool PersistentStore::access_start() {
|
||||
#if ENABLED(SPI_EEPROM)
|
||||
@@ -73,5 +73,5 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t
|
||||
|
||||
size_t PersistentStore::capacity() { return E2END + 1; }
|
||||
|
||||
#endif // USE_REAL_EEPROM
|
||||
#endif // USE_WIRED_EEPROM
|
||||
#endif // __STM32F1__
|
||||
+3
-4
@@ -31,10 +31,9 @@
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
// This is for EEPROM emulation in flash
|
||||
#if BOTH(EEPROM_SETTINGS, FLASH_EEPROM_EMULATION)
|
||||
#if ENABLED(FLASH_EEPROM_EMULATION)
|
||||
|
||||
#include "../shared/persistent_store_api.h"
|
||||
#include "../shared/eeprom_api.h"
|
||||
|
||||
#include <flash_stm32.h>
|
||||
#include <EEPROM.h>
|
||||
@@ -108,5 +107,5 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, const size_t size, uin
|
||||
|
||||
size_t PersistentStore::capacity() { return EEPROM_SIZE; }
|
||||
|
||||
#endif // EEPROM_SETTINGS && EEPROM FLASH
|
||||
#endif // FLASH_EEPROM_EMULATION
|
||||
#endif // __STM32F1__
|
||||
+1
-2
@@ -31,7 +31,7 @@
|
||||
|
||||
#if ENABLED(SDCARD_EEPROM_EMULATION)
|
||||
|
||||
#include "../shared/persistent_store_api.h"
|
||||
#include "../shared/eeprom_api.h"
|
||||
|
||||
#ifndef E2END
|
||||
#define E2END 0xFFF // 4KB
|
||||
@@ -101,5 +101,4 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, const size_t size, uin
|
||||
size_t PersistentStore::capacity() { return HAL_EEPROM_SIZE; }
|
||||
|
||||
#endif // SDCARD_EEPROM_EMULATION
|
||||
|
||||
#endif // __STM32F1__
|
||||
+1
-1
@@ -27,7 +27,7 @@
|
||||
|
||||
#if ENABLED(EEPROM_SETTINGS)
|
||||
|
||||
#include "../shared/persistent_store_api.h"
|
||||
#include "../shared/eeprom_api.h"
|
||||
|
||||
bool PersistentStore::access_start() { return true; }
|
||||
bool PersistentStore::access_finish() { return true; }
|
||||
@@ -22,7 +22,7 @@
|
||||
#pragma once
|
||||
|
||||
#if ENABLED(EEPROM_SETTINGS) && defined(STM32F7)
|
||||
#undef USE_REAL_EEPROM
|
||||
#undef USE_WIRED_EEPROM
|
||||
#undef SRAM_EEPROM_EMULATION
|
||||
#undef SDCARD_EEPROM_EMULATION
|
||||
#define FLASH_EEPROM_EMULATION
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@
|
||||
|
||||
#if ENABLED(EEPROM_SETTINGS)
|
||||
|
||||
#include "../shared/persistent_store_api.h"
|
||||
#include "../shared/eeprom_api.h"
|
||||
|
||||
bool PersistentStore::access_start() { return true; }
|
||||
bool PersistentStore::access_finish() { return true; }
|
||||
@@ -22,6 +22,6 @@
|
||||
#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)
|
||||
#if ENABLED(EEPROM_SETTINGS) && NONE(USE_WIRED_EEPROM, FLASH_EEPROM_EMULATION, SRAM_EEPROM_EMULATION)
|
||||
#define SDCARD_EEPROM_EMULATION
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@
|
||||
|
||||
#if ENABLED(EEPROM_SETTINGS)
|
||||
|
||||
#include "../shared/persistent_store_api.h"
|
||||
#include "../shared/eeprom_api.h"
|
||||
#include <avr/eeprom.h>
|
||||
|
||||
bool PersistentStore::access_start() { return true; }
|
||||
+1
-1
@@ -24,7 +24,7 @@
|
||||
|
||||
#if EITHER(EEPROM_SETTINGS, SD_FIRMWARE_UPDATE)
|
||||
|
||||
#include "persistent_store_api.h"
|
||||
#include "eeprom_api.h"
|
||||
PersistentStore persistentStore;
|
||||
|
||||
#endif
|
||||
+21
-47
@@ -210,6 +210,24 @@ bool wait_for_heatup = true;
|
||||
// For M0/M1, this flag may be cleared (by M108) to exit the wait-for-user loop
|
||||
#if HAS_RESUME_CONTINUE
|
||||
bool wait_for_user; // = false;
|
||||
|
||||
void wait_for_user_response(millis_t ms/*=0*/, const bool no_sleep/*=false*/) {
|
||||
#if DISABLED(ADVANCED_PAUSE_FEATURE)
|
||||
UNUSED(no_sleep);
|
||||
#endif
|
||||
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
||||
wait_for_user = true;
|
||||
if (ms) ms += millis(); // expire time
|
||||
while (wait_for_user && !(ms && ELAPSED(millis(), ms))) {
|
||||
idle(
|
||||
#if ENABLED(ADVANCED_PAUSE_FEATURE)
|
||||
no_sleep
|
||||
#endif
|
||||
);
|
||||
}
|
||||
wait_for_user = false;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// Inactivity shutdown
|
||||
@@ -418,52 +436,8 @@ void startOrResumeJob() {
|
||||
}
|
||||
|
||||
inline void finishSDPrinting() {
|
||||
|
||||
bool did_state = true;
|
||||
switch (card.sdprinting_done_state) {
|
||||
|
||||
case 1:
|
||||
did_state = print_job_timer.duration() < 60 || queue.enqueue_one_P(PSTR("M31"));
|
||||
break;
|
||||
|
||||
case 2:
|
||||
did_state = queue.enqueue_one_P(PSTR("M77"));
|
||||
break;
|
||||
|
||||
case 3:
|
||||
#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
|
||||
ui.set_progress_done();
|
||||
#endif
|
||||
break;
|
||||
|
||||
case 4: // Display "Click to Continue..."
|
||||
#if HAS_RESUME_CONTINUE // 30 min timeout with LCD, 1 min without
|
||||
did_state = queue.enqueue_one_P(
|
||||
print_job_timer.duration() < 60 ? PSTR("M0Q1P1") : PSTR("M0Q1S" TERN(HAS_LCD_MENU, "1800", "60"))
|
||||
);
|
||||
#endif
|
||||
break;
|
||||
|
||||
case 5:
|
||||
#if ENABLED(POWER_LOSS_RECOVERY)
|
||||
recovery.purge();
|
||||
#endif
|
||||
|
||||
#if ENABLED(SD_FINISHED_STEPPERRELEASE) && defined(SD_FINISHED_RELEASECOMMAND)
|
||||
planner.finish_and_disable();
|
||||
#endif
|
||||
|
||||
#if ENABLED(SD_REPRINT_LAST_SELECTED_FILE)
|
||||
ui.reselect_last_file();
|
||||
#endif
|
||||
|
||||
SERIAL_ECHOLNPGM(STR_FILE_PRINTED);
|
||||
|
||||
default:
|
||||
did_state = false;
|
||||
card.sdprinting_done_state = 0;
|
||||
}
|
||||
if (did_state) ++card.sdprinting_done_state;
|
||||
if (queue.enqueue_one_P(PSTR("M1001")))
|
||||
marlin_state = MF_RUNNING;
|
||||
}
|
||||
|
||||
#endif // SDSUPPORT
|
||||
@@ -1208,7 +1182,7 @@ void loop() {
|
||||
#if ENABLED(SDSUPPORT)
|
||||
card.checkautostart();
|
||||
if (card.flag.abort_sd_printing) abortSDPrinting();
|
||||
if (card.sdprinting_done_state) finishSDPrinting();
|
||||
if (marlin_state == MF_SD_COMPLETE) finishSDPrinting();
|
||||
#endif
|
||||
|
||||
queue.advance();
|
||||
|
||||
@@ -83,6 +83,7 @@ enum MarlinState : uint8_t {
|
||||
MF_PAUSED = _BV(1),
|
||||
MF_WAITING = _BV(2),
|
||||
MF_STOPPED = _BV(3),
|
||||
MF_SD_COMPLETE = _BV(4),
|
||||
MF_KILLED = _BV(7)
|
||||
};
|
||||
|
||||
@@ -98,6 +99,7 @@ extern bool wait_for_heatup;
|
||||
|
||||
#if HAS_RESUME_CONTINUE
|
||||
extern bool wait_for_user;
|
||||
void wait_for_user_response(millis_t ms=0, const bool no_sleep=false);
|
||||
#endif
|
||||
|
||||
// Inactivity shutdown timer
|
||||
|
||||
@@ -144,6 +144,7 @@
|
||||
#define BOARD_LEAPFROG_XEED2015 1321 // Leapfrog Xeed 2015
|
||||
#define BOARD_PICA_REVB 1322 // PICA Shield (original version)
|
||||
#define BOARD_PICA 1323 // PICA Shield (rev C or later)
|
||||
#define BOARD_INTAMSYS40 1324 // Intamsys 4.0 (Funmat HT)
|
||||
|
||||
//
|
||||
// ATmega1281, ATmega2561
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include "../bedlevel.h"
|
||||
|
||||
#include "../../../MarlinCore.h"
|
||||
#include "../../../HAL/shared/persistent_store_api.h"
|
||||
#include "../../../HAL/shared/eeprom_api.h"
|
||||
#include "../../../libs/hex_print_routines.h"
|
||||
#include "../../../module/configuration_store.h"
|
||||
#include "../../../lcd/ultralcd.h"
|
||||
|
||||
@@ -707,14 +707,13 @@ void MMU2::filament_runout() {
|
||||
if (recover) {
|
||||
LCD_MESSAGEPGM(MSG_MMU2_EJECT_RECOVER);
|
||||
BUZZ(200, 404);
|
||||
wait_for_user = true;
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||
host_prompt_do(PROMPT_USER_CONTINUE, PSTR("MMU2 Eject Recover"), CONTINUE_STR);
|
||||
#endif
|
||||
#if ENABLED(EXTENSIBLE_UI)
|
||||
ExtUI::onUserConfirmRequired_P(PSTR("MMU2 Eject Recover"));
|
||||
#endif
|
||||
while (wait_for_user) idle();
|
||||
wait_for_user_response();
|
||||
BUZZ(200, 404);
|
||||
BUZZ(200, 404);
|
||||
|
||||
|
||||
@@ -134,15 +134,6 @@ static bool ensure_safe_temperature(const PauseMode mode=PAUSE_MODE_SAME) {
|
||||
return thermalManager.wait_for_hotend(active_extruder);
|
||||
}
|
||||
|
||||
void do_pause_e_move(const float &length, const feedRate_t &fr_mm_s) {
|
||||
#if HAS_FILAMENT_SENSOR
|
||||
runout.reset();
|
||||
#endif
|
||||
current_position.e += length / planner.e_factor[active_extruder];
|
||||
line_to_current_position(fr_mm_s);
|
||||
planner.synchronize();
|
||||
}
|
||||
|
||||
/**
|
||||
* Load filament into the hotend
|
||||
*
|
||||
@@ -184,7 +175,6 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l
|
||||
#endif
|
||||
|
||||
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
||||
wait_for_user = true; // LCD click or M108 will clear this
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||
const char tool = '0'
|
||||
#if NUM_RUNOUT_SENSORS > 1
|
||||
@@ -218,7 +208,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l
|
||||
#endif
|
||||
|
||||
// Slow Load filament
|
||||
if (slow_load_length) do_pause_e_move(slow_load_length, FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE);
|
||||
if (slow_load_length) unscaled_e_move(slow_load_length, FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE);
|
||||
|
||||
// Fast Load Filament
|
||||
if (fast_load_length) {
|
||||
@@ -227,7 +217,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l
|
||||
planner.settings.retract_acceleration = FILAMENT_CHANGE_FAST_LOAD_ACCEL;
|
||||
#endif
|
||||
|
||||
do_pause_e_move(fast_load_length, FILAMENT_CHANGE_FAST_LOAD_FEEDRATE);
|
||||
unscaled_e_move(fast_load_length, FILAMENT_CHANGE_FAST_LOAD_FEEDRATE);
|
||||
|
||||
#if FILAMENT_CHANGE_FAST_LOAD_ACCEL > 0
|
||||
planner.settings.retract_acceleration = saved_acceleration;
|
||||
@@ -246,15 +236,15 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l
|
||||
if (show_lcd) lcd_pause_show_message(PAUSE_MESSAGE_PURGE);
|
||||
#endif
|
||||
|
||||
wait_for_user = true;
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||
host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Filament Purging..."), CONTINUE_STR);
|
||||
#endif
|
||||
#if ENABLED(EXTENSIBLE_UI)
|
||||
ExtUI::onUserConfirmRequired_P(PSTR("Filament Purging..."));
|
||||
#endif
|
||||
wait_for_user = true; // A click or M108 breaks the purge_length loop
|
||||
for (float purge_count = purge_length; purge_count > 0 && wait_for_user; --purge_count)
|
||||
do_pause_e_move(1, ADVANCED_PAUSE_PURGE_FEEDRATE);
|
||||
unscaled_e_move(1, ADVANCED_PAUSE_PURGE_FEEDRATE);
|
||||
wait_for_user = false;
|
||||
|
||||
#else
|
||||
@@ -267,7 +257,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l
|
||||
#endif
|
||||
|
||||
// Extrude filament to get into hotend
|
||||
do_pause_e_move(purge_length, ADVANCED_PAUSE_PURGE_FEEDRATE);
|
||||
unscaled_e_move(purge_length, ADVANCED_PAUSE_PURGE_FEEDRATE);
|
||||
}
|
||||
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||
@@ -332,13 +322,13 @@ bool unload_filament(const float &unload_length, const bool show_lcd/*=false*/,
|
||||
#endif
|
||||
|
||||
// Retract filament
|
||||
do_pause_e_move(-(FILAMENT_UNLOAD_PURGE_RETRACT) * mix_multiplier, (PAUSE_PARK_RETRACT_FEEDRATE) * mix_multiplier);
|
||||
unscaled_e_move(-(FILAMENT_UNLOAD_PURGE_RETRACT) * mix_multiplier, (PAUSE_PARK_RETRACT_FEEDRATE) * mix_multiplier);
|
||||
|
||||
// Wait for filament to cool
|
||||
safe_delay(FILAMENT_UNLOAD_PURGE_DELAY);
|
||||
|
||||
// Quickly purge
|
||||
do_pause_e_move((FILAMENT_UNLOAD_PURGE_RETRACT + FILAMENT_UNLOAD_PURGE_LENGTH) * mix_multiplier,
|
||||
unscaled_e_move((FILAMENT_UNLOAD_PURGE_RETRACT + FILAMENT_UNLOAD_PURGE_LENGTH) * mix_multiplier,
|
||||
(FILAMENT_UNLOAD_PURGE_FEEDRATE) * mix_multiplier);
|
||||
|
||||
// Unload filament
|
||||
@@ -347,7 +337,7 @@ bool unload_filament(const float &unload_length, const bool show_lcd/*=false*/,
|
||||
planner.settings.retract_acceleration = FILAMENT_CHANGE_UNLOAD_ACCEL;
|
||||
#endif
|
||||
|
||||
do_pause_e_move(unload_length * mix_multiplier, (FILAMENT_CHANGE_UNLOAD_FEEDRATE) * mix_multiplier);
|
||||
unscaled_e_move(unload_length * mix_multiplier, (FILAMENT_CHANGE_UNLOAD_FEEDRATE) * mix_multiplier);
|
||||
|
||||
#if FILAMENT_CHANGE_FAST_LOAD_ACCEL > 0
|
||||
planner.settings.retract_acceleration = saved_acceleration;
|
||||
@@ -437,7 +427,7 @@ bool pause_print(const float &retract, const xyz_pos_t &park_point, const float
|
||||
|
||||
// Initial retract before move to filament change position
|
||||
if (retract && thermalManager.hotEnoughToExtrude(active_extruder))
|
||||
do_pause_e_move(retract, PAUSE_PARK_RETRACT_FEEDRATE);
|
||||
unscaled_e_move(retract, PAUSE_PARK_RETRACT_FEEDRATE);
|
||||
|
||||
// Park the nozzle by moving up by z_lift and then moving to (x_pos, y_pos)
|
||||
if (!axes_need_homing())
|
||||
@@ -508,13 +498,13 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
|
||||
|
||||
// Wait for filament insert by user and press button
|
||||
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
||||
wait_for_user = true; // LCD click or M108 will clear this
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||
host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Nozzle Parked"), CONTINUE_STR);
|
||||
#endif
|
||||
#if ENABLED(EXTENSIBLE_UI)
|
||||
ExtUI::onUserConfirmRequired_P(PSTR("Nozzle Parked"));
|
||||
#endif
|
||||
wait_for_user = true; // LCD click or M108 will clear this
|
||||
while (wait_for_user) {
|
||||
#if HAS_BUZZER
|
||||
filament_change_beep(max_beep_count);
|
||||
@@ -540,8 +530,7 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
|
||||
ExtUI::onUserConfirmRequired_P(PSTR("HeaterTimeout"));
|
||||
#endif
|
||||
|
||||
// Wait for LCD click or M108
|
||||
while (wait_for_user) idle_no_sleep();
|
||||
wait_for_user_response(0, true); // Wait for LCD click or M108
|
||||
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||
host_prompt_do(PROMPT_INFO, PSTR("Reheating"));
|
||||
@@ -633,11 +622,11 @@ void resume_print(const float &slow_load_length/*=0*/, const float &fast_load_le
|
||||
#if ENABLED(FWRETRACT)
|
||||
// If retracted before goto pause
|
||||
if (fwretract.retracted[active_extruder])
|
||||
do_pause_e_move(-fwretract.settings.retract_length, fwretract.settings.retract_feedrate_mm_s);
|
||||
unscaled_e_move(-fwretract.settings.retract_length, fwretract.settings.retract_feedrate_mm_s);
|
||||
#endif
|
||||
|
||||
// If resume_position is negative
|
||||
if (resume_position.e < 0) do_pause_e_move(resume_position.e, feedRate_t(PAUSE_PARK_RETRACT_FEEDRATE));
|
||||
if (resume_position.e < 0) unscaled_e_move(resume_position.e, feedRate_t(PAUSE_PARK_RETRACT_FEEDRATE));
|
||||
|
||||
// Move XY to starting position, then Z
|
||||
do_blocking_move_to_xy(resume_position, feedRate_t(NOZZLE_PARK_XY_FEEDRATE));
|
||||
@@ -646,7 +635,7 @@ void resume_print(const float &slow_load_length/*=0*/, const float &fast_load_le
|
||||
do_blocking_move_to_z(resume_position.z, feedRate_t(NOZZLE_PARK_Z_FEEDRATE));
|
||||
|
||||
#if ADVANCED_PAUSE_RESUME_PRIME != 0
|
||||
do_pause_e_move(ADVANCED_PAUSE_RESUME_PRIME, feedRate_t(ADVANCED_PAUSE_PURGE_FEEDRATE));
|
||||
unscaled_e_move(ADVANCED_PAUSE_RESUME_PRIME, feedRate_t(ADVANCED_PAUSE_PURGE_FEEDRATE));
|
||||
#endif
|
||||
|
||||
// Now all extrusion positions are resumed and ready to be confirmed
|
||||
|
||||
@@ -83,8 +83,6 @@ extern uint8_t did_pause_print;
|
||||
#define DXC_PASS
|
||||
#endif
|
||||
|
||||
void do_pause_e_move(const float &length, const feedRate_t &fr_mm_s);
|
||||
|
||||
bool pause_print(const float &retract, const xyz_pos_t &park_point, const float &unload_length=0, const bool show_lcd=false DXC_PARAMS);
|
||||
|
||||
void wait_for_confirmation(const bool is_reload=false, const int8_t max_beep_count=0 DXC_PARAMS);
|
||||
|
||||
@@ -49,37 +49,27 @@ void TWIBus::address(const uint8_t adr) {
|
||||
|
||||
addr = adr;
|
||||
|
||||
#if ENABLED(DEBUG_TWIBUS)
|
||||
debug(PSTR("address"), adr);
|
||||
#endif
|
||||
debug(PSTR("address"), adr);
|
||||
}
|
||||
|
||||
void TWIBus::addbyte(const char c) {
|
||||
if (buffer_s >= COUNT(buffer)) return;
|
||||
buffer[buffer_s++] = c;
|
||||
#if ENABLED(DEBUG_TWIBUS)
|
||||
debug(PSTR("addbyte"), c);
|
||||
#endif
|
||||
debug(PSTR("addbyte"), c);
|
||||
}
|
||||
|
||||
void TWIBus::addbytes(char src[], uint8_t bytes) {
|
||||
#if ENABLED(DEBUG_TWIBUS)
|
||||
debug(PSTR("addbytes"), bytes);
|
||||
#endif
|
||||
debug(PSTR("addbytes"), bytes);
|
||||
while (bytes--) addbyte(*src++);
|
||||
}
|
||||
|
||||
void TWIBus::addstring(char str[]) {
|
||||
#if ENABLED(DEBUG_TWIBUS)
|
||||
debug(PSTR("addstring"), str);
|
||||
#endif
|
||||
debug(PSTR("addstring"), str);
|
||||
while (char c = *str++) addbyte(c);
|
||||
}
|
||||
|
||||
void TWIBus::send() {
|
||||
#if ENABLED(DEBUG_TWIBUS)
|
||||
debug(PSTR("send"), addr);
|
||||
#endif
|
||||
debug(PSTR("send"), addr);
|
||||
|
||||
Wire.beginTransmission(I2C_ADDRESS(addr));
|
||||
Wire.write(buffer, buffer_s);
|
||||
@@ -89,21 +79,21 @@ void TWIBus::send() {
|
||||
}
|
||||
|
||||
// static
|
||||
void TWIBus::echoprefix(uint8_t bytes, const char prefix[], uint8_t adr) {
|
||||
void TWIBus::echoprefix(uint8_t bytes, const char pref[], uint8_t adr) {
|
||||
SERIAL_ECHO_START();
|
||||
serialprintPGM(prefix);
|
||||
serialprintPGM(pref);
|
||||
SERIAL_ECHOPAIR(": from:", adr, " bytes:", bytes, " data:");
|
||||
}
|
||||
|
||||
// static
|
||||
void TWIBus::echodata(uint8_t bytes, const char prefix[], uint8_t adr) {
|
||||
echoprefix(bytes, prefix, adr);
|
||||
void TWIBus::echodata(uint8_t bytes, const char pref[], uint8_t adr) {
|
||||
echoprefix(bytes, pref, adr);
|
||||
while (bytes-- && Wire.available()) SERIAL_CHAR(Wire.read());
|
||||
SERIAL_EOL();
|
||||
}
|
||||
|
||||
void TWIBus::echobuffer(const char prefix[], uint8_t adr) {
|
||||
echoprefix(buffer_s, prefix, adr);
|
||||
void TWIBus::echobuffer(const char pref[], uint8_t adr) {
|
||||
echoprefix(buffer_s, pref, adr);
|
||||
LOOP_L_N(i, buffer_s) SERIAL_CHAR(buffer[i]);
|
||||
SERIAL_EOL();
|
||||
}
|
||||
@@ -111,15 +101,11 @@ void TWIBus::echobuffer(const char prefix[], uint8_t adr) {
|
||||
bool TWIBus::request(const uint8_t bytes) {
|
||||
if (!addr) return false;
|
||||
|
||||
#if ENABLED(DEBUG_TWIBUS)
|
||||
debug(PSTR("request"), bytes);
|
||||
#endif
|
||||
debug(PSTR("request"), bytes);
|
||||
|
||||
// requestFrom() is a blocking function
|
||||
if (Wire.requestFrom(addr, bytes) == 0) {
|
||||
#if ENABLED(DEBUG_TWIBUS)
|
||||
debug("request fail", addr);
|
||||
#endif
|
||||
debug("request fail", addr);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -127,9 +113,7 @@ bool TWIBus::request(const uint8_t bytes) {
|
||||
}
|
||||
|
||||
void TWIBus::relay(const uint8_t bytes) {
|
||||
#if ENABLED(DEBUG_TWIBUS)
|
||||
debug(PSTR("relay"), bytes);
|
||||
#endif
|
||||
debug(PSTR("relay"), bytes);
|
||||
|
||||
if (request(bytes))
|
||||
echodata(bytes, PSTR("i2c-reply"), addr);
|
||||
@@ -141,9 +125,7 @@ uint8_t TWIBus::capture(char *dst, const uint8_t bytes) {
|
||||
while (count < bytes && Wire.available())
|
||||
dst[count++] = Wire.read();
|
||||
|
||||
#if ENABLED(DEBUG_TWIBUS)
|
||||
debug(PSTR("capture"), count);
|
||||
#endif
|
||||
debug(PSTR("capture"), count);
|
||||
|
||||
return count;
|
||||
}
|
||||
@@ -156,16 +138,12 @@ void TWIBus::flush() {
|
||||
#if I2C_SLAVE_ADDRESS > 0
|
||||
|
||||
void TWIBus::receive(uint8_t bytes) {
|
||||
#if ENABLED(DEBUG_TWIBUS)
|
||||
debug(PSTR("receive"), bytes);
|
||||
#endif
|
||||
debug(PSTR("receive"), bytes);
|
||||
echodata(bytes, PSTR("i2c-receive"), 0);
|
||||
}
|
||||
|
||||
void TWIBus::reply(char str[]/*=nullptr*/) {
|
||||
#if ENABLED(DEBUG_TWIBUS)
|
||||
debug(PSTR("reply"), str);
|
||||
#endif
|
||||
debug(PSTR("reply"), str);
|
||||
|
||||
if (str) {
|
||||
reset();
|
||||
|
||||
@@ -223,7 +223,6 @@ class TWIBus {
|
||||
#endif
|
||||
|
||||
#if ENABLED(DEBUG_TWIBUS)
|
||||
|
||||
/**
|
||||
* @brief Prints a debug message
|
||||
* @details Prints a simple debug message "TWIBus::function: value"
|
||||
@@ -233,6 +232,10 @@ class TWIBus {
|
||||
static void debug(const char func[], char c);
|
||||
static void debug(const char func[], char adr[]);
|
||||
static inline void debug(const char func[], uint8_t v) { debug(func, (uint32_t)v); }
|
||||
|
||||
#else
|
||||
static inline void debug(const char[], uint32_t) {}
|
||||
static inline void debug(const char[], char) {}
|
||||
static inline void debug(const char[], char[]) {}
|
||||
static inline void debug(const char[], uint8_t) {}
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -255,28 +255,28 @@ void GcodeSuite::G28() {
|
||||
#define HAS_HOMING_CURRENT (HAS_CURRENT_HOME(X) || HAS_CURRENT_HOME(X2) || HAS_CURRENT_HOME(Y) || HAS_CURRENT_HOME(Y2))
|
||||
|
||||
#if HAS_HOMING_CURRENT
|
||||
auto debug_current = [](const char * const s, const int16_t a, const int16_t b){
|
||||
DEBUG_ECHO(s); DEBUG_ECHOLNPAIR(" current: ", a, " -> ", b);
|
||||
auto debug_current = [](PGM_P const s, const int16_t a, const int16_t b){
|
||||
serialprintPGM(s); DEBUG_ECHOLNPAIR(" current: ", a, " -> ", b);
|
||||
};
|
||||
#if HAS_CURRENT_HOME(X)
|
||||
const int16_t tmc_save_current_X = stepperX.getMilliamps();
|
||||
stepperX.rms_current(X_CURRENT_HOME);
|
||||
if (DEBUGGING(LEVELING)) debug_current("X", tmc_save_current_X, X_CURRENT_HOME);
|
||||
if (DEBUGGING(LEVELING)) debug_current(PSTR("X"), tmc_save_current_X, X_CURRENT_HOME);
|
||||
#endif
|
||||
#if HAS_CURRENT_HOME(X2)
|
||||
const int16_t tmc_save_current_X2 = stepperX2.getMilliamps();
|
||||
stepperX2.rms_current(X2_CURRENT_HOME);
|
||||
if (DEBUGGING(LEVELING)) debug_current("X2", tmc_save_current_X2, X2_CURRENT_HOME);
|
||||
if (DEBUGGING(LEVELING)) debug_current(PSTR("X2"), tmc_save_current_X2, X2_CURRENT_HOME);
|
||||
#endif
|
||||
#if HAS_CURRENT_HOME(Y)
|
||||
const int16_t tmc_save_current_Y = stepperY.getMilliamps();
|
||||
stepperY.rms_current(Y_CURRENT_HOME);
|
||||
if (DEBUGGING(LEVELING)) debug_current("Y", tmc_save_current_Y, Y_CURRENT_HOME);
|
||||
if (DEBUGGING(LEVELING)) debug_current(PSTR("Y"), tmc_save_current_Y, Y_CURRENT_HOME);
|
||||
#endif
|
||||
#if HAS_CURRENT_HOME(Y2)
|
||||
const int16_t tmc_save_current_Y2 = stepperY2.getMilliamps();
|
||||
stepperY2.rms_current(Y2_CURRENT_HOME);
|
||||
if (DEBUGGING(LEVELING)) debug_current("Y2", tmc_save_current_Y2, Y2_CURRENT_HOME);
|
||||
if (DEBUGGING(LEVELING)) debug_current(PSTR("Y2"), tmc_save_current_Y2, Y2_CURRENT_HOME);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -345,12 +345,8 @@ void GcodeSuite::G28() {
|
||||
#endif
|
||||
|
||||
// Home Y (before X)
|
||||
#if ENABLED(HOME_Y_BEFORE_X)
|
||||
|
||||
if (doY || (doX && ENABLED(CODEPENDENT_XY_HOMING)))
|
||||
homeaxis(Y_AXIS);
|
||||
|
||||
#endif
|
||||
if (ENABLED(HOME_Y_BEFORE_X) && (doY || (ENABLED(CODEPENDENT_XY_HOMING) && doX)))
|
||||
homeaxis(Y_AXIS);
|
||||
|
||||
// Home X
|
||||
if (doX || (doY && ENABLED(CODEPENDENT_XY_HOMING) && DISABLED(HOME_Y_BEFORE_X))) {
|
||||
|
||||
@@ -37,6 +37,21 @@
|
||||
#include "../../module/endstops.h"
|
||||
#include "../../feature/bedlevel/bedlevel.h"
|
||||
|
||||
#if !AXIS_CAN_CALIBRATE(X)
|
||||
#undef CALIBRATION_MEASURE_LEFT
|
||||
#undef CALIBRATION_MEASURE_RIGHT
|
||||
#endif
|
||||
|
||||
#if !AXIS_CAN_CALIBRATE(Y)
|
||||
#undef CALIBRATION_MEASURE_FRONT
|
||||
#undef CALIBRATION_MEASURE_BACK
|
||||
#endif
|
||||
|
||||
#if !AXIS_CAN_CALIBRATE(Z)
|
||||
#undef CALIBRATION_MEASURE_AT_TOP_EDGES
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* G425 backs away from the calibration object by various distances
|
||||
* depending on the confidence level:
|
||||
@@ -207,42 +222,52 @@ inline float measure(const AxisEnum axis, const int dir, const bool stop_state,
|
||||
inline void probe_side(measurements_t &m, const float uncertainty, const side_t side, const bool probe_top_at_edge=false) {
|
||||
const xyz_float_t dimensions = CALIBRATION_OBJECT_DIMENSIONS;
|
||||
AxisEnum axis;
|
||||
float dir;
|
||||
float dir = 1;
|
||||
|
||||
park_above_object(m, uncertainty);
|
||||
|
||||
switch (side) {
|
||||
case TOP: {
|
||||
const float measurement = measure(Z_AXIS, -1, true, &m.backlash[TOP], uncertainty);
|
||||
m.obj_center.z = measurement - dimensions.z / 2;
|
||||
m.obj_side[TOP] = measurement;
|
||||
return;
|
||||
}
|
||||
case RIGHT: axis = X_AXIS; dir = -1; break;
|
||||
case FRONT: axis = Y_AXIS; dir = 1; break;
|
||||
case LEFT: axis = X_AXIS; dir = 1; break;
|
||||
case BACK: axis = Y_AXIS; dir = -1; break;
|
||||
#if AXIS_CAN_CALIBRATE(Z)
|
||||
case TOP: {
|
||||
const float measurement = measure(Z_AXIS, -1, true, &m.backlash[TOP], uncertainty);
|
||||
m.obj_center.z = measurement - dimensions.z / 2;
|
||||
m.obj_side[TOP] = measurement;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#if AXIS_CAN_CALIBRATE(X)
|
||||
case LEFT: axis = X_AXIS; break;
|
||||
case RIGHT: axis = X_AXIS; dir = -1; break;
|
||||
#endif
|
||||
#if AXIS_CAN_CALIBRATE(Y)
|
||||
case FRONT: axis = Y_AXIS; break;
|
||||
case BACK: axis = Y_AXIS; dir = -1; break;
|
||||
#endif
|
||||
default: return;
|
||||
}
|
||||
|
||||
if (probe_top_at_edge) {
|
||||
// Probe top nearest the side we are probing
|
||||
current_position[axis] = m.obj_center[axis] + (-dir) * (dimensions[axis] / 2 - m.nozzle_outer_dimension[axis]);
|
||||
calibration_move();
|
||||
m.obj_side[TOP] = measure(Z_AXIS, -1, true, &m.backlash[TOP], uncertainty);
|
||||
m.obj_center.z = m.obj_side[TOP] - dimensions.z / 2;
|
||||
#if AXIS_CAN_CALIBRATE(Z)
|
||||
// Probe top nearest the side we are probing
|
||||
current_position[axis] = m.obj_center[axis] + (-dir) * (dimensions[axis] / 2 - m.nozzle_outer_dimension[axis]);
|
||||
calibration_move();
|
||||
m.obj_side[TOP] = measure(Z_AXIS, -1, true, &m.backlash[TOP], uncertainty);
|
||||
m.obj_center.z = m.obj_side[TOP] - dimensions.z / 2;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Move to safe distance to the side of the calibration object
|
||||
current_position[axis] = m.obj_center[axis] + (-dir) * (dimensions[axis] / 2 + m.nozzle_outer_dimension[axis] / 2 + uncertainty);
|
||||
calibration_move();
|
||||
if (AXIS_CAN_CALIBRATE(X) && axis == X_AXIS || AXIS_CAN_CALIBRATE(Y) && axis == Y_AXIS) {
|
||||
// Move to safe distance to the side of the calibration object
|
||||
current_position[axis] = m.obj_center[axis] + (-dir) * (dimensions[axis] / 2 + m.nozzle_outer_dimension[axis] / 2 + uncertainty);
|
||||
calibration_move();
|
||||
|
||||
// Plunge below the side of the calibration object and measure
|
||||
current_position.z = m.obj_side[TOP] - CALIBRATION_NOZZLE_TIP_HEIGHT * 0.7;
|
||||
calibration_move();
|
||||
const float measurement = measure(axis, dir, true, &m.backlash[side], uncertainty);
|
||||
m.obj_center[axis] = measurement + dir * (dimensions[axis] / 2 + m.nozzle_outer_dimension[axis] / 2);
|
||||
m.obj_side[side] = measurement;
|
||||
// Plunge below the side of the calibration object and measure
|
||||
current_position.z = m.obj_side[TOP] - (CALIBRATION_NOZZLE_TIP_HEIGHT) * 0.7f;
|
||||
calibration_move();
|
||||
const float measurement = measure(axis, dir, true, &m.backlash[side], uncertainty);
|
||||
m.obj_center[axis] = measurement + dir * (dimensions[axis] / 2 + m.nozzle_outer_dimension[axis] / 2);
|
||||
m.obj_side[side] = measurement;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -252,7 +277,7 @@ inline void probe_side(measurements_t &m, const float uncertainty, const side_t
|
||||
* uncertainty in - How far away from the calibration object to begin probing
|
||||
*/
|
||||
inline void probe_sides(measurements_t &m, const float uncertainty) {
|
||||
#ifdef CALIBRATION_MEASURE_AT_TOP_EDGES
|
||||
#if ENABLED(CALIBRATION_MEASURE_AT_TOP_EDGES)
|
||||
constexpr bool probe_top_at_edge = true;
|
||||
#else
|
||||
// Probing at the exact center only works if the center is flat. Probing on a washer
|
||||
@@ -261,18 +286,18 @@ inline void probe_sides(measurements_t &m, const float uncertainty) {
|
||||
probe_side(m, uncertainty, TOP);
|
||||
#endif
|
||||
|
||||
#ifdef CALIBRATION_MEASURE_RIGHT
|
||||
#if ENABLED(CALIBRATION_MEASURE_RIGHT)
|
||||
probe_side(m, uncertainty, RIGHT, probe_top_at_edge);
|
||||
#endif
|
||||
|
||||
#ifdef CALIBRATION_MEASURE_FRONT
|
||||
#if ENABLED(CALIBRATION_MEASURE_FRONT)
|
||||
probe_side(m, uncertainty, FRONT, probe_top_at_edge);
|
||||
#endif
|
||||
|
||||
#ifdef CALIBRATION_MEASURE_LEFT
|
||||
#if ENABLED(CALIBRATION_MEASURE_LEFT)
|
||||
probe_side(m, uncertainty, LEFT, probe_top_at_edge);
|
||||
#endif
|
||||
#ifdef CALIBRATION_MEASURE_BACK
|
||||
#if ENABLED(CALIBRATION_MEASURE_BACK)
|
||||
probe_side(m, uncertainty, BACK, probe_top_at_edge);
|
||||
#endif
|
||||
|
||||
@@ -313,7 +338,9 @@ inline void probe_sides(measurements_t &m, const float uncertainty) {
|
||||
#if ENABLED(CALIBRATION_REPORTING)
|
||||
inline void report_measured_faces(const measurements_t &m) {
|
||||
SERIAL_ECHOLNPGM("Sides:");
|
||||
SERIAL_ECHOLNPAIR(" Top: ", m.obj_side[TOP]);
|
||||
#if AXIS_CAN_CALIBRATE(Z)
|
||||
SERIAL_ECHOLNPAIR(" Top: ", m.obj_side[TOP]);
|
||||
#endif
|
||||
#if ENABLED(CALIBRATION_MEASURE_LEFT)
|
||||
SERIAL_ECHOLNPAIR(" Left: ", m.obj_side[LEFT]);
|
||||
#endif
|
||||
@@ -343,19 +370,25 @@ inline void probe_sides(measurements_t &m, const float uncertainty) {
|
||||
|
||||
inline void report_measured_backlash(const measurements_t &m) {
|
||||
SERIAL_ECHOLNPGM("Backlash:");
|
||||
#if ENABLED(CALIBRATION_MEASURE_LEFT)
|
||||
SERIAL_ECHOLNPAIR(" Left: ", m.backlash[LEFT]);
|
||||
#if AXIS_CAN_CALIBRATE(X)
|
||||
#if ENABLED(CALIBRATION_MEASURE_LEFT)
|
||||
SERIAL_ECHOLNPAIR(" Left: ", m.backlash[LEFT]);
|
||||
#endif
|
||||
#if ENABLED(CALIBRATION_MEASURE_RIGHT)
|
||||
SERIAL_ECHOLNPAIR(" Right: ", m.backlash[RIGHT]);
|
||||
#endif
|
||||
#endif
|
||||
#if ENABLED(CALIBRATION_MEASURE_RIGHT)
|
||||
SERIAL_ECHOLNPAIR(" Right: ", m.backlash[RIGHT]);
|
||||
#if AXIS_CAN_CALIBRATE(Y)
|
||||
#if ENABLED(CALIBRATION_MEASURE_FRONT)
|
||||
SERIAL_ECHOLNPAIR(" Front: ", m.backlash[FRONT]);
|
||||
#endif
|
||||
#if ENABLED(CALIBRATION_MEASURE_BACK)
|
||||
SERIAL_ECHOLNPAIR(" Back: ", m.backlash[BACK]);
|
||||
#endif
|
||||
#endif
|
||||
#if ENABLED(CALIBRATION_MEASURE_FRONT)
|
||||
SERIAL_ECHOLNPAIR(" Front: ", m.backlash[FRONT]);
|
||||
#if AXIS_CAN_CALIBRATE(Z)
|
||||
SERIAL_ECHOLNPAIR(" Top: ", m.backlash[TOP]);
|
||||
#endif
|
||||
#if ENABLED(CALIBRATION_MEASURE_BACK)
|
||||
SERIAL_ECHOLNPAIR(" Back: ", m.backlash[BACK]);
|
||||
#endif
|
||||
SERIAL_ECHOLNPAIR(" Top: ", m.backlash[TOP]);
|
||||
SERIAL_EOL();
|
||||
}
|
||||
|
||||
@@ -369,7 +402,7 @@ inline void probe_sides(measurements_t &m, const float uncertainty) {
|
||||
#if HAS_Y_CENTER
|
||||
SERIAL_ECHOLNPAIR_P(SP_Y_STR, m.pos_error.y);
|
||||
#endif
|
||||
SERIAL_ECHOLNPAIR_P(SP_Z_STR, m.pos_error.z);
|
||||
if (AXIS_CAN_CALIBRATE(Z)) SERIAL_ECHOLNPAIR_P(SP_Z_STR, m.pos_error.z);
|
||||
SERIAL_EOL();
|
||||
}
|
||||
|
||||
@@ -417,6 +450,7 @@ inline void calibrate_backlash(measurements_t &m, const float uncertainty) {
|
||||
probe_sides(m, uncertainty);
|
||||
|
||||
#if ENABLED(BACKLASH_GCODE)
|
||||
|
||||
#if HAS_X_CENTER
|
||||
backlash.distance_mm.x = (m.backlash[LEFT] + m.backlash[RIGHT]) / 2;
|
||||
#elif ENABLED(CALIBRATION_MEASURE_LEFT)
|
||||
@@ -433,18 +467,18 @@ inline void calibrate_backlash(measurements_t &m, const float uncertainty) {
|
||||
backlash.distance_mm.y = m.backlash[BACK];
|
||||
#endif
|
||||
|
||||
backlash.distance_mm.z = m.backlash[TOP];
|
||||
if (AXIS_CAN_CALIBRATE(Z)) backlash.distance_mm.z = m.backlash[TOP];
|
||||
#endif
|
||||
}
|
||||
|
||||
#if ENABLED(BACKLASH_GCODE)
|
||||
// Turn on backlash compensation and move in all
|
||||
// directions to take up any backlash
|
||||
// allowed directions to take up any backlash
|
||||
{
|
||||
// New scope for TEMPORARY_BACKLASH_CORRECTION
|
||||
TEMPORARY_BACKLASH_CORRECTION(all_on);
|
||||
TEMPORARY_BACKLASH_SMOOTHING(0.0f);
|
||||
const xyz_float_t move = { 3, 3, 3 };
|
||||
const xyz_float_t move = { AXIS_CAN_CALIBRATE(X) * 3, AXIS_CAN_CALIBRATE(Y) * 3, AXIS_CAN_CALIBRATE(Z) * 3 };
|
||||
current_position += move; calibration_move();
|
||||
current_position -= move; calibration_move();
|
||||
}
|
||||
@@ -482,26 +516,18 @@ inline void calibrate_toolhead(measurements_t &m, const float uncertainty, const
|
||||
|
||||
// Adjust the hotend offset
|
||||
#if HAS_HOTEND_OFFSET
|
||||
#if HAS_X_CENTER
|
||||
hotend_offset[extruder].x += m.pos_error.x;
|
||||
#endif
|
||||
#if HAS_Y_CENTER
|
||||
hotend_offset[extruder].y += m.pos_error.y;
|
||||
#endif
|
||||
hotend_offset[extruder].z += m.pos_error.z;
|
||||
if (ENABLED(HAS_X_CENTER) && AXIS_CAN_CALIBRATE(X)) hotend_offset[extruder].x += m.pos_error.x;
|
||||
if (ENABLED(HAS_Y_CENTER) && AXIS_CAN_CALIBRATE(Y)) hotend_offset[extruder].y += m.pos_error.y;
|
||||
if (AXIS_CAN_CALIBRATE(Z)) hotend_offset[extruder].z += m.pos_error.z;
|
||||
normalize_hotend_offsets();
|
||||
#endif
|
||||
|
||||
// Correct for positional error, so the object
|
||||
// is at the known actual spot
|
||||
planner.synchronize();
|
||||
#if HAS_X_CENTER
|
||||
update_measurements(m, X_AXIS);
|
||||
#endif
|
||||
#if HAS_Y_CENTER
|
||||
update_measurements(m, Y_AXIS);
|
||||
#endif
|
||||
update_measurements(m, Z_AXIS);
|
||||
if (ENABLED(HAS_X_CENTER) && AXIS_CAN_CALIBRATE(X)) update_measurements(m, X_AXIS);
|
||||
if (ENABLED(HAS_Y_CENTER) && AXIS_CAN_CALIBRATE(Y)) update_measurements(m, Y_AXIS);
|
||||
if (AXIS_CAN_CALIBRATE(Z)) update_measurements(m, Z_AXIS);
|
||||
|
||||
sync_plan_position();
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ void GcodeSuite::M425() {
|
||||
bool noArgs = true;
|
||||
|
||||
LOOP_XYZ(a) {
|
||||
if (parser.seen(XYZ_CHAR(a))) {
|
||||
if (CAN_CALIBRATE(a) && parser.seen(XYZ_CHAR(a))) {
|
||||
planner.synchronize();
|
||||
backlash.distance_mm[a] = parser.has_value() ? parser.value_linear_units() : backlash.get_measurement(AxisEnum(a));
|
||||
noArgs = false;
|
||||
@@ -74,7 +74,7 @@ void GcodeSuite::M425() {
|
||||
SERIAL_ECHOLNPGM("active:");
|
||||
SERIAL_ECHOLNPAIR(" Correction Amount/Fade-out: F", backlash.get_correction(), " (F1.0 = full, F0.0 = none)");
|
||||
SERIAL_ECHOPGM(" Backlash Distance (mm): ");
|
||||
LOOP_XYZ(a) {
|
||||
LOOP_XYZ(a) if (CAN_CALIBRATE(a)) {
|
||||
SERIAL_CHAR(' ', XYZ_CHAR(a));
|
||||
SERIAL_ECHO(backlash.distance_mm[a]);
|
||||
SERIAL_EOL();
|
||||
@@ -87,7 +87,7 @@ void GcodeSuite::M425() {
|
||||
#if ENABLED(MEASURE_BACKLASH_WHEN_PROBING)
|
||||
SERIAL_ECHOPGM(" Average measured backlash (mm):");
|
||||
if (backlash.has_any_measurement()) {
|
||||
LOOP_XYZ(a) if (backlash.has_measurement(AxisEnum(a))) {
|
||||
LOOP_XYZ(a) if (CAN_CALIBRATE(a) && backlash.has_measurement(AxisEnum(a))) {
|
||||
SERIAL_CHAR(' ', XYZ_CHAR(a));
|
||||
SERIAL_ECHO(backlash.get_measurement(AxisEnum(a)));
|
||||
}
|
||||
|
||||
@@ -48,14 +48,8 @@
|
||||
|
||||
#ifdef PHOTO_RETRACT_MM
|
||||
inline void e_move_m240(const float length, const feedRate_t &fr_mm_s) {
|
||||
if (length && thermalManager.hotEnoughToExtrude(active_extruder)) {
|
||||
#if ENABLED(ADVANCED_PAUSE_FEATURE)
|
||||
do_pause_e_move(length, fr_mm_s);
|
||||
#else
|
||||
current_position.e += length / planner.e_factor[active_extruder];
|
||||
line_to_current_position(fr_mm_s);
|
||||
#endif
|
||||
}
|
||||
if (length && thermalManager.hotEnoughToExtrude(active_extruder))
|
||||
unscaled_e_move(length, fr_mm_s);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -857,7 +857,11 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
|
||||
|
||||
#if ENABLED(POWER_LOSS_RECOVERY)
|
||||
case 413: M413(); break; // M413: Enable/disable/query Power-Loss Recovery
|
||||
case 1000: M1000(); break; // M1000: Resume from power-loss
|
||||
case 1000: M1000(); break; // M1000: [INTERNAL] Resume from power-loss
|
||||
#endif
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
case 1001: M1001(); break; // M1001: [INTERNAL] Handle SD completion
|
||||
#endif
|
||||
|
||||
#if ENABLED(MAX7219_GCODE)
|
||||
|
||||
@@ -968,6 +968,10 @@ private:
|
||||
static void M1000();
|
||||
#endif
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
static void M1001();
|
||||
#endif
|
||||
|
||||
#if ENABLED(MAX7219_GCODE)
|
||||
static void M7219();
|
||||
#endif
|
||||
|
||||
@@ -24,23 +24,19 @@
|
||||
|
||||
#if HAS_RESUME_CONTINUE
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../module/planner.h"
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#include "../gcode.h"
|
||||
|
||||
#include "../../module/planner.h" // for synchronize()
|
||||
#include "../../MarlinCore.h" // for wait_for_user_response()
|
||||
|
||||
#if HAS_LCD_MENU
|
||||
#include "../../lcd/ultralcd.h"
|
||||
#endif
|
||||
|
||||
#if ENABLED(EXTENSIBLE_UI)
|
||||
#elif ENABLED(EXTENSIBLE_UI)
|
||||
#include "../../lcd/extui/ui_api.h"
|
||||
#endif
|
||||
|
||||
#if HAS_LEDS_OFF_FLAG
|
||||
#include "../../feature/leds/printer_event_leds.h"
|
||||
#endif
|
||||
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||
#include "../../feature/host_actions.h"
|
||||
#endif
|
||||
@@ -56,18 +52,11 @@ void GcodeSuite::M0_M1() {
|
||||
|
||||
planner.synchronize();
|
||||
|
||||
#if HAS_LCD_MENU || HAS_LEDS_OFF_FLAG
|
||||
const bool seenQ = parser.seen('Q');
|
||||
#if HAS_LEDS_OFF_FLAG
|
||||
if (seenQ) printerEventLEDs.onPrintCompleted(); // Change LED color for Print Completed
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAS_LCD_MENU
|
||||
|
||||
if (parser.string_arg)
|
||||
ui.set_status(parser.string_arg, true);
|
||||
else if (!seenQ) {
|
||||
else {
|
||||
LCD_MESSAGEPGM(MSG_USERWAIT);
|
||||
#if ENABLED(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0
|
||||
ui.reset_progress_bar_timeout();
|
||||
@@ -75,12 +64,10 @@ void GcodeSuite::M0_M1() {
|
||||
}
|
||||
|
||||
#elif ENABLED(EXTENSIBLE_UI)
|
||||
|
||||
if (parser.string_arg)
|
||||
ExtUI::onUserConfirmRequired(parser.string_arg); // Can this take an SRAM string??
|
||||
else
|
||||
ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_USERWAIT));
|
||||
|
||||
#else
|
||||
|
||||
if (parser.string_arg) {
|
||||
@@ -90,25 +77,15 @@ void GcodeSuite::M0_M1() {
|
||||
|
||||
#endif
|
||||
|
||||
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
||||
wait_for_user = true;
|
||||
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||
host_prompt_do(PROMPT_USER_CONTINUE, parser.codenum ? PSTR("M1 Stop") : PSTR("M0 Stop"), CONTINUE_STR);
|
||||
#endif
|
||||
|
||||
if (ms > 0) ms += millis(); // wait until this time for a click
|
||||
while (wait_for_user && (ms == 0 || PENDING(millis(), ms))) idle();
|
||||
|
||||
#if HAS_LEDS_OFF_FLAG
|
||||
printerEventLEDs.onResumeAfterWait();
|
||||
#endif
|
||||
wait_for_user_response(ms);
|
||||
|
||||
#if HAS_LCD_MENU
|
||||
if (!seenQ) ui.reset_status();
|
||||
ui.reset_status();
|
||||
#endif
|
||||
|
||||
wait_for_user = false;
|
||||
}
|
||||
|
||||
#endif // HAS_RESUME_CONTINUE
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
/**
|
||||
* 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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../module/printcounter.h"
|
||||
|
||||
#if EITHER(LCD_SET_PROGRESS_MANUALLY, SD_REPRINT_LAST_SELECTED_FILE)
|
||||
#include "../../lcd/ultralcd.h"
|
||||
#endif
|
||||
|
||||
#if ENABLED(POWER_LOSS_RECOVERY)
|
||||
#include "../../feature/powerloss.h"
|
||||
#endif
|
||||
|
||||
#if HAS_LEDS_OFF_FLAG
|
||||
#include "../../feature/leds/printer_event_leds.h"
|
||||
#endif
|
||||
|
||||
#if ENABLED(EXTENSIBLE_UI)
|
||||
#include "../../lcd/extui/ui_api.h"
|
||||
#endif
|
||||
|
||||
#if ENABLED(HOST_ACTION_COMMANDS)
|
||||
#include "../../feature/host_actions.h"
|
||||
#endif
|
||||
|
||||
#if ENABLED(SD_FINISHED_STEPPERRELEASE) && defined(SD_FINISHED_RELEASECOMMAND)
|
||||
#include "../../module/planner.h"
|
||||
#endif
|
||||
|
||||
#ifndef PE_LEDS_COMPLETED_TIME
|
||||
#define PE_LEDS_COMPLETED_TIME (30*60)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* M1001: Execute actions for SD print completion
|
||||
*/
|
||||
void GcodeSuite::M1001() {
|
||||
|
||||
// Report total print time
|
||||
const bool long_print = print_job_timer.duration() > 60;
|
||||
if (long_print) gcode.process_subcommands_now_P(PSTR("M31"));
|
||||
|
||||
// Stop the print job timer
|
||||
gcode.process_subcommands_now_P(PSTR("M77"));
|
||||
|
||||
// Set the progress bar "done" state
|
||||
#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
|
||||
ui.set_progress_done();
|
||||
#endif
|
||||
|
||||
// Purge the recovery file
|
||||
#if ENABLED(POWER_LOSS_RECOVERY)
|
||||
recovery.purge();
|
||||
#endif
|
||||
|
||||
// Announce SD file completion
|
||||
SERIAL_ECHOLNPGM(STR_FILE_PRINTED);
|
||||
|
||||
// Update the status LED color
|
||||
#if HAS_LEDS_OFF_FLAG
|
||||
if (long_print) {
|
||||
printerEventLEDs.onPrintCompleted();
|
||||
#if ENABLED(EXTENSIBLE_UI)
|
||||
ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_PRINT_DONE));
|
||||
#endif
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||
host_prompt_do(PROMPT_USER_CONTINUE, GET_TEXT(MSG_PRINT_DONE), CONTINUE_STR);
|
||||
#endif
|
||||
wait_for_user_response(1000UL * TERN(HAS_LCD_MENU, PE_LEDS_COMPLETED_TIME, 30));
|
||||
printerEventLEDs.onResumeAfterWait();
|
||||
}
|
||||
#endif
|
||||
|
||||
// Wait for the queue to empty (and "clean"), inject SD_FINISHED_RELEASECOMMAND
|
||||
#if ENABLED(SD_FINISHED_STEPPERRELEASE) && defined(SD_FINISHED_RELEASECOMMAND)
|
||||
planner.finish_and_disable();
|
||||
#endif
|
||||
|
||||
// Re-select the last printed file in the UI
|
||||
#if ENABLED(SD_REPRINT_LAST_SELECTED_FILE)
|
||||
ui.reselect_last_file();
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // SDSUPPORT
|
||||
@@ -93,7 +93,7 @@
|
||||
#if EITHER(MIN_SOFTWARE_ENDSTOPS, MAX_SOFTWARE_ENDSTOPS)
|
||||
#define HAS_SOFTWARE_ENDSTOPS 1
|
||||
#endif
|
||||
#if ANY(EXTENSIBLE_UI, NEWPANEL, EMERGENCY_PARSER)
|
||||
#if ANY(EXTENSIBLE_UI, NEWPANEL, EMERGENCY_PARSER, HAS_ADC_BUTTONS)
|
||||
#define HAS_RESUME_CONTINUE 1
|
||||
#endif
|
||||
|
||||
|
||||
@@ -35,16 +35,19 @@
|
||||
#define HAS_LINEAR_E_JERK 1
|
||||
#endif
|
||||
|
||||
// If no real EEPROM, Flash emulation, or SRAM emulation is available fall back to SD emulation
|
||||
// Determine which type of 'EEPROM' is in use
|
||||
#if ENABLED(EEPROM_SETTINGS)
|
||||
#if NONE(FLASH_EEPROM_EMULATION, SRAM_EEPROM_EMULATION, SDCARD_EEPROM_EMULATION) && EITHER(I2C_EEPROM, SPI_EEPROM)
|
||||
#define USE_REAL_EEPROM 1
|
||||
// EEPROM type may be defined by compile flags, configs, HALs, or pins
|
||||
// Set additional flags to let HALs choose in their Conditionals_post.h
|
||||
#if NONE(FLASH_EEPROM_EMULATION, SRAM_EEPROM_EMULATION, SDCARD_EEPROM_EMULATION) && ANY(I2C_EEPROM, SPI_EEPROM, QSPI_EEPROM)
|
||||
#define USE_WIRED_EEPROM 1
|
||||
#else
|
||||
#define USE_EMULATED_EEPROM 1
|
||||
#define USE_FALLBACK_EEPROM 1
|
||||
#endif
|
||||
#else
|
||||
#undef I2C_EEPROM
|
||||
#undef SPI_EEPROM
|
||||
#undef QSPI_EEPROM
|
||||
#undef SDCARD_EEPROM_EMULATION
|
||||
#undef SRAM_EEPROM_EMULATION
|
||||
#undef FLASH_EEPROM_EMULATION
|
||||
@@ -136,6 +139,19 @@
|
||||
#define CORESIGN(n) (ANY(COREYX, COREZX, COREZY) ? (-(n)) : (n))
|
||||
#endif
|
||||
|
||||
// Calibration codes only for non-core axes
|
||||
#if EITHER(BACKLASH_GCODE, CALIBRATION_GCODE)
|
||||
#if IS_CORE
|
||||
#define X_AXIS_INDEX 0
|
||||
#define Y_AXIS_INDEX 1
|
||||
#define Z_AXIS_INDEX 2
|
||||
#define CAN_CALIBRATE(A,B) (A##_AXIS_INDEX == B##_INDEX)
|
||||
#else
|
||||
#define CAN_CALIBRATE(...) 1
|
||||
#endif
|
||||
#endif
|
||||
#define AXIS_CAN_CALIBRATE(A) CAN_CALIBRATE(A,NORMAL_AXIS)
|
||||
|
||||
/**
|
||||
* No adjustable bed on non-cartesians
|
||||
*/
|
||||
|
||||
@@ -35,11 +35,12 @@
|
||||
#include "Conditionals_post.h"
|
||||
#include HAL_PATH(../HAL, inc/Conditionals_post.h)
|
||||
|
||||
#include "../core/types.h" // Ahead of sanity-checks
|
||||
|
||||
#include "SanityCheck.h"
|
||||
#include HAL_PATH(../HAL, inc/SanityCheck.h)
|
||||
|
||||
// Include all core headers
|
||||
#include "../core/types.h"
|
||||
#include "../core/language.h"
|
||||
#include "../core/utility.h"
|
||||
#include "../core/serial.h"
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
* version was tagged.
|
||||
*/
|
||||
#ifndef STRING_DISTRIBUTION_DATE
|
||||
#define STRING_DISTRIBUTION_DATE "2020-03-26"
|
||||
#define STRING_DISTRIBUTION_DATE "2020-03-31"
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
||||
@@ -252,7 +252,7 @@ void InterfaceSettingsScreen::loadSettings(const char *buff) {
|
||||
}
|
||||
|
||||
#ifdef ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE
|
||||
#include "../../../../../HAL/shared/persistent_store_api.h"
|
||||
#include "../../../../../HAL/shared/eeprom_api.h"
|
||||
|
||||
bool restoreEEPROM() {
|
||||
uint8_t data[ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE];
|
||||
|
||||
@@ -352,6 +352,7 @@ namespace Language_en {
|
||||
PROGMEM Language_Str MSG_PRINT_PAUSED = _UxGT("Print Paused");
|
||||
PROGMEM Language_Str MSG_PRINTING = _UxGT("Printing...");
|
||||
PROGMEM Language_Str MSG_PRINT_ABORTED = _UxGT("Print Aborted");
|
||||
PROGMEM Language_Str MSG_PRINT_DONE = _UxGT("Print Done");
|
||||
PROGMEM Language_Str MSG_NO_MOVE = _UxGT("No Move.");
|
||||
PROGMEM Language_Str MSG_KILLED = _UxGT("KILLED. ");
|
||||
PROGMEM Language_Str MSG_STOPPED = _UxGT("STOPPED. ");
|
||||
|
||||
@@ -93,7 +93,7 @@ namespace Language_fr {
|
||||
PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Allumer alim.");
|
||||
PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Eteindre alim.");
|
||||
PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Extrusion");
|
||||
PROGMEM Language_Str MSG_RETRACT = _UxGT("Rétraction");
|
||||
PROGMEM Language_Str MSG_RETRACT = _UxGT("Rétractation");
|
||||
PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Déplacer un axe");
|
||||
PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Régler Niv. lit");
|
||||
PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Niveau du lit");
|
||||
@@ -317,7 +317,7 @@ namespace Language_fr {
|
||||
PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Moteurs bloqués");
|
||||
PROGMEM Language_Str MSG_KILLED = _UxGT("KILLED");
|
||||
PROGMEM Language_Str MSG_STOPPED = _UxGT("STOPPÉ");
|
||||
PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Rétraction mm");
|
||||
PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Rétractation mm");
|
||||
PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Ech. rétr. mm");
|
||||
PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Vit. rétract°");
|
||||
PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Saut Z mm");
|
||||
|
||||
@@ -84,7 +84,7 @@ void menu_cancelobject();
|
||||
START_MENU();
|
||||
BACK_ITEM(MSG_ADVANCED_SETTINGS);
|
||||
#define EDIT_CURRENT_PWM(LABEL,I) EDIT_ITEM_P(long5, PSTR(LABEL), &stepper.motor_current_setting[I], 100, 2000, stepper.refresh_motor_power)
|
||||
#if PIN_EXISTS(MOTOR_CURRENT_PWM_XY)
|
||||
#if ANY_PIN(MOTOR_CURRENT_PWM_XY, MOTOR_CURRENT_PWM_X, MOTOR_CURRENT_PWM_Y)
|
||||
EDIT_CURRENT_PWM(STR_X STR_Y, 0);
|
||||
#endif
|
||||
#if PIN_EXISTS(MOTOR_CURRENT_PWM_Z)
|
||||
|
||||
@@ -39,9 +39,9 @@ void menu_backlash() {
|
||||
EDIT_ITEM_FAST(percent, MSG_BACKLASH_CORRECTION, &backlash.correction, all_off, all_on);
|
||||
|
||||
#define EDIT_BACKLASH_DISTANCE(N) EDIT_ITEM_FAST(float43, MSG_BACKLASH_##N, &backlash.distance_mm[_AXIS(N)], 0.0f, 9.9f);
|
||||
EDIT_BACKLASH_DISTANCE(A);
|
||||
EDIT_BACKLASH_DISTANCE(B);
|
||||
EDIT_BACKLASH_DISTANCE(C);
|
||||
if (AXIS_CAN_CALIBRATE(A)) EDIT_BACKLASH_DISTANCE(A);
|
||||
if (AXIS_CAN_CALIBRATE(B)) EDIT_BACKLASH_DISTANCE(B);
|
||||
if (AXIS_CAN_CALIBRATE(C)) EDIT_BACKLASH_DISTANCE(C);
|
||||
|
||||
#ifdef BACKLASH_SMOOTHING_MM
|
||||
EDIT_ITEM_FAST(float43, MSG_BACKLASH_SMOOTHING, &backlash.smoothing_mm, 0.0f, 9.9f);
|
||||
|
||||
@@ -61,16 +61,14 @@ void _man_probe_pt(const xy_pos_t &xy) {
|
||||
|
||||
float lcd_probe_pt(const xy_pos_t &xy) {
|
||||
_man_probe_pt(xy);
|
||||
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
||||
ui.defer_status_screen();
|
||||
wait_for_user = true;
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||
host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Delta Calibration in progress"), CONTINUE_STR);
|
||||
#endif
|
||||
#if ENABLED(EXTENSIBLE_UI)
|
||||
ExtUI::onUserConfirmRequired_P(PSTR("Delta Calibration in progress"));
|
||||
#endif
|
||||
while (wait_for_user) idle();
|
||||
wait_for_user_response();
|
||||
ui.goto_previous_screen_no_defer();
|
||||
return current_position.z;
|
||||
}
|
||||
|
||||
+10
-12
@@ -776,6 +776,13 @@ void MarlinUI::update() {
|
||||
// If the action button is pressed...
|
||||
static bool wait_for_unclick; // = false
|
||||
|
||||
auto do_click = [&]{
|
||||
wait_for_unclick = true; // - Set debounce flag to ignore continous clicks
|
||||
lcd_clicked = !wait_for_user && !no_reentry; // - Keep the click if not waiting for a user-click
|
||||
wait_for_user = false; // - Any click clears wait for user
|
||||
quick_feedback(); // - Always make a click sound
|
||||
};
|
||||
|
||||
#if ENABLED(TOUCH_BUTTONS)
|
||||
if (touch_buttons) {
|
||||
RESET_STATUS_TIMEOUT();
|
||||
@@ -796,12 +803,8 @@ void MarlinUI::update() {
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!wait_for_unclick && (buttons & EN_C)) { // OK button, if not waiting for a debounce release:
|
||||
wait_for_unclick = true; // - Set debounce flag to ignore continous clicks
|
||||
lcd_clicked = !wait_for_user && !no_reentry; // - Keep the click if not waiting for a user-click
|
||||
wait_for_user = false; // - Any click clears wait for user
|
||||
quick_feedback(); // - Always make a click sound
|
||||
}
|
||||
else if (!wait_for_unclick && (buttons & EN_C)) // OK button, if not waiting for a debounce release:
|
||||
do_click();
|
||||
}
|
||||
else // keep wait_for_unclick value
|
||||
|
||||
@@ -810,12 +813,7 @@ void MarlinUI::update() {
|
||||
{
|
||||
// Integrated LCD click handling via button_pressed
|
||||
if (!external_control && button_pressed()) {
|
||||
if (!wait_for_unclick) { // If not waiting for a debounce release:
|
||||
wait_for_unclick = true; // - Set debounce flag to ignore continous clicks
|
||||
lcd_clicked = !wait_for_user && !no_reentry; // - Keep the click if not waiting for a user-click
|
||||
wait_for_user = false; // - Any click clears wait for user
|
||||
quick_feedback(); // - Always make a click sound
|
||||
}
|
||||
if (!wait_for_unclick) do_click(); // Handle the click
|
||||
}
|
||||
else
|
||||
wait_for_unclick = false;
|
||||
|
||||
@@ -312,7 +312,7 @@ const char* ftostr52sign(const float &f) {
|
||||
|
||||
// Convert signed float to string with +12.345 format
|
||||
const char* ftostr53sign(const float &f) {
|
||||
long i = (f * 1000 + (f < 0 ? -5: 5)) / 10;
|
||||
long i = (f * 10000 + (f < 0 ? -5: 5)) / 10;
|
||||
conv[0] = MINUSOR(i, '+');
|
||||
conv[1] = DIGIMOD(i, 10000);
|
||||
conv[2] = DIGIMOD(i, 1000);
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
#include "../MarlinCore.h"
|
||||
|
||||
#if EITHER(EEPROM_SETTINGS, SD_FIRMWARE_UPDATE)
|
||||
#include "../HAL/shared/persistent_store_api.h"
|
||||
#include "../HAL/shared/eeprom_api.h"
|
||||
#endif
|
||||
|
||||
#include "probe.h"
|
||||
@@ -127,6 +127,11 @@
|
||||
void M710_report(const bool forReplay);
|
||||
#endif
|
||||
|
||||
#define HAS_CASE_LIGHT_BRIGHTNESS (ENABLED(CASE_LIGHT_MENU) && DISABLED(CASE_LIGHT_NO_BRIGHTNESS))
|
||||
#if HAS_CASE_LIGHT_BRIGHTNESS
|
||||
#include "../feature/caselight.h"
|
||||
#endif
|
||||
|
||||
#pragma pack(push, 1) // No padding between variables
|
||||
|
||||
typedef struct { uint16_t X, Y, Z, X2, Y2, Z2, Z3, Z4, E0, E1, E2, E3, E4, E5; } tmc_stepper_current_t;
|
||||
@@ -376,6 +381,13 @@ typedef struct SettingsDataStruct {
|
||||
uint8_t extui_data[ExtUI::eeprom_data_size];
|
||||
#endif
|
||||
|
||||
//
|
||||
// HAS_CASE_LIGHT_BRIGHTNESS
|
||||
//
|
||||
#if HAS_CASE_LIGHT_BRIGHTNESS
|
||||
uint8_t case_light_brightness;
|
||||
#endif
|
||||
|
||||
} SettingsData;
|
||||
|
||||
//static_assert(sizeof(SettingsData) <= E2END + 1, "EEPROM too small to contain SettingsData!");
|
||||
@@ -441,6 +453,10 @@ void MarlinSettings::postprocess() {
|
||||
planner.recalculate_max_e_jerk();
|
||||
#endif
|
||||
|
||||
#if HAS_CASE_LIGHT_BRIGHTNESS
|
||||
update_case_light();
|
||||
#endif
|
||||
|
||||
// Refresh steps_to_mm with the reciprocal of axis_steps_per_mm
|
||||
// and init stepper.count[], planner.position[] with current_position
|
||||
planner.refresh_positioning();
|
||||
@@ -1309,6 +1325,13 @@ void MarlinSettings::postprocess() {
|
||||
}
|
||||
#endif
|
||||
|
||||
//
|
||||
// Case Light Brightness
|
||||
//
|
||||
#if HAS_CASE_LIGHT_BRIGHTNESS
|
||||
EEPROM_WRITE(case_light_brightness);
|
||||
#endif
|
||||
|
||||
//
|
||||
// Validate CRC and Data Size
|
||||
//
|
||||
@@ -2163,6 +2186,14 @@ void MarlinSettings::postprocess() {
|
||||
}
|
||||
#endif
|
||||
|
||||
//
|
||||
// Case Light Brightness
|
||||
//
|
||||
#if HAS_CASE_LIGHT_BRIGHTNESS
|
||||
_FIELD_TEST(case_light_brightness);
|
||||
EEPROM_READ(case_light_brightness);
|
||||
#endif
|
||||
|
||||
eeprom_error = size_error(eeprom_index - (EEPROM_OFFSET));
|
||||
if (eeprom_error) {
|
||||
DEBUG_ECHO_START();
|
||||
@@ -2458,6 +2489,14 @@ void MarlinSettings::reset() {
|
||||
ExtUI::onFactoryReset();
|
||||
#endif
|
||||
|
||||
//
|
||||
// Case Light Brightness
|
||||
//
|
||||
|
||||
#if HAS_CASE_LIGHT_BRIGHTNESS
|
||||
case_light_brightness = CASE_LIGHT_DEFAULT_BRIGHTNESS;
|
||||
#endif
|
||||
|
||||
//
|
||||
// Magnetic Parking Extruder
|
||||
//
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include "../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(EEPROM_SETTINGS)
|
||||
#include "../HAL/shared/persistent_store_api.h"
|
||||
#include "../HAL/shared/eeprom_api.h"
|
||||
#endif
|
||||
|
||||
class MarlinSettings {
|
||||
|
||||
@@ -55,6 +55,10 @@
|
||||
#include "../lcd/ultralcd.h"
|
||||
#endif
|
||||
|
||||
#if HAS_FILAMENT_SENSOR
|
||||
#include "../feature/runout.h"
|
||||
#endif
|
||||
|
||||
#if ENABLED(SENSORLESS_HOMING)
|
||||
#include "../feature/tmc_util.h"
|
||||
#endif
|
||||
@@ -332,6 +336,17 @@ void line_to_current_position(const feedRate_t &fr_mm_s/*=feedrate_mm_s*/) {
|
||||
planner.buffer_line(current_position, fr_mm_s, active_extruder);
|
||||
}
|
||||
|
||||
#if EXTRUDERS
|
||||
void unscaled_e_move(const float &length, const feedRate_t &fr_mm_s) {
|
||||
#if HAS_FILAMENT_SENSOR
|
||||
runout.reset();
|
||||
#endif
|
||||
current_position.e += length / planner.e_factor[active_extruder];
|
||||
line_to_current_position(fr_mm_s);
|
||||
planner.synchronize();
|
||||
}
|
||||
#endif
|
||||
|
||||
#if IS_KINEMATIC
|
||||
|
||||
/**
|
||||
|
||||
@@ -184,6 +184,10 @@ void sync_plan_position_e();
|
||||
*/
|
||||
void line_to_current_position(const feedRate_t &fr_mm_s=feedrate_mm_s);
|
||||
|
||||
#if EXTRUDERS
|
||||
void unscaled_e_move(const float &length, const feedRate_t &fr_mm_s);
|
||||
#endif
|
||||
|
||||
void prepare_line_to_destination();
|
||||
|
||||
void _internal_move_to_destination(const feedRate_t &fr_mm_s=0.0f
|
||||
|
||||
@@ -1519,10 +1519,6 @@ void Planner::check_axes_activity() {
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
#if ENABLED(SKEW_CORRECTION)
|
||||
unskew(raw);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // HAS_LEVELING
|
||||
|
||||
@@ -35,7 +35,7 @@ Stopwatch print_job_timer; // Global Print Job Timer instance
|
||||
|
||||
#include "printcounter.h"
|
||||
#include "../MarlinCore.h"
|
||||
#include "../HAL/shared/persistent_store_api.h"
|
||||
#include "../HAL/shared/eeprom_api.h"
|
||||
|
||||
#if HAS_BUZZER && SERVICE_WARNING_BUZZES > 0
|
||||
#include "../libs/buzzer.h"
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
// Print debug messages with M111 S2
|
||||
//#define DEBUG_PRINTCOUNTER
|
||||
|
||||
#if USE_REAL_EEPROM
|
||||
#if USE_WIRED_EEPROM
|
||||
// round up address to next page boundary (assuming 32 byte pages)
|
||||
#define STATS_EEPROM_ADDRESS 0x40
|
||||
#else
|
||||
@@ -57,7 +57,7 @@ class PrintCounter: public Stopwatch {
|
||||
private:
|
||||
typedef Stopwatch super;
|
||||
|
||||
#if USE_REAL_EEPROM || defined(CPU_32_BIT)
|
||||
#if USE_WIRED_EEPROM || defined(CPU_32_BIT)
|
||||
typedef uint32_t eeprom_address_t;
|
||||
#else
|
||||
typedef uint16_t eeprom_address_t;
|
||||
|
||||
@@ -134,12 +134,10 @@ xyz_pos_t Probe::offset; // Initialized by settings.load()
|
||||
LCD_MESSAGEPGM(MSG_MANUAL_DEPLOY_TOUCHMI);
|
||||
ui.return_to_status();
|
||||
|
||||
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
||||
wait_for_user = true; // LCD click or M108 will clear this
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||
host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Deploy TouchMI probe."), CONTINUE_STR);
|
||||
host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Deploy TouchMI"), CONTINUE_STR);
|
||||
#endif
|
||||
while (wait_for_user) idle();
|
||||
wait_for_user_response();
|
||||
ui.reset_status();
|
||||
ui.goto_screen(prev_screen);
|
||||
|
||||
@@ -297,15 +295,13 @@ FORCE_INLINE void probe_specific_action(const bool deploy) {
|
||||
serialprintPGM(ds_str);
|
||||
SERIAL_EOL();
|
||||
|
||||
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
||||
wait_for_user = true;
|
||||
#if ENABLED(HOST_PROMPT_SUPPORT)
|
||||
host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Stow Probe"), CONTINUE_STR);
|
||||
#endif
|
||||
#if ENABLED(EXTENSIBLE_UI)
|
||||
ExtUI::onUserConfirmRequired_P(PSTR("Stow Probe"));
|
||||
#endif
|
||||
while (wait_for_user) idle();
|
||||
wait_for_user_response();
|
||||
ui.reset_status();
|
||||
|
||||
} while(
|
||||
|
||||
@@ -856,7 +856,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
|
||||
}
|
||||
else {
|
||||
#if ENABLED(ADVANCED_PAUSE_FEATURE)
|
||||
do_pause_e_move(-toolchange_settings.swap_length, MMM_TO_MMS(toolchange_settings.retract_speed));
|
||||
unscaled_e_move(-toolchange_settings.swap_length, MMM_TO_MMS(toolchange_settings.retract_speed));
|
||||
#else
|
||||
current_position.e -= toolchange_settings.swap_length / planner.e_factor[old_tool];
|
||||
planner.buffer_line(current_position, MMM_TO_MMS(toolchange_settings.retract_speed), old_tool);
|
||||
@@ -991,8 +991,8 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
|
||||
#if ENABLED(TOOLCHANGE_FILAMENT_SWAP)
|
||||
if (should_swap && !too_cold) {
|
||||
#if ENABLED(ADVANCED_PAUSE_FEATURE)
|
||||
do_pause_e_move(toolchange_settings.swap_length, MMM_TO_MMS(toolchange_settings.prime_speed));
|
||||
do_pause_e_move(toolchange_settings.extra_prime, ADVANCED_PAUSE_PURGE_FEEDRATE);
|
||||
unscaled_e_move(toolchange_settings.swap_length, MMM_TO_MMS(toolchange_settings.prime_speed));
|
||||
unscaled_e_move(toolchange_settings.extra_prime, ADVANCED_PAUSE_PURGE_FEEDRATE);
|
||||
#else
|
||||
current_position.e += toolchange_settings.swap_length / planner.e_factor[new_tool];
|
||||
planner.buffer_line(current_position, MMM_TO_MMS(toolchange_settings.prime_speed), new_tool);
|
||||
|
||||
@@ -0,0 +1,152 @@
|
||||
/**
|
||||
* 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
|
||||
|
||||
/**
|
||||
* Intamsys Funmat HT V4.0 Mainboard
|
||||
* 4988 Drivers Tested
|
||||
* 2208 version exists and may or may not work
|
||||
*/
|
||||
|
||||
#ifndef __AVR_ATmega2560__
|
||||
#error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'"
|
||||
#endif
|
||||
|
||||
#define BOARD_INFO_NAME "Intamsys 4.0"
|
||||
|
||||
//
|
||||
// Servos
|
||||
//
|
||||
#define SERVO0_PIN 12 // Uses High Temp Present Jumper Pin
|
||||
|
||||
//
|
||||
// Limit Switches
|
||||
//
|
||||
#define X_STOP_PIN 22
|
||||
#define Y_STOP_PIN 26
|
||||
#define Z_MIN_PIN 29
|
||||
#define Z_MAX_PIN 69
|
||||
|
||||
#ifndef Z_MIN_PROBE_PIN
|
||||
#define Z_MIN_PROBE_PIN 69
|
||||
#endif
|
||||
|
||||
#define FIL_RUNOUT_PIN 10
|
||||
|
||||
//
|
||||
// Steppers
|
||||
//
|
||||
#define X_STEP_PIN 25
|
||||
#define X_DIR_PIN 23
|
||||
#define X_ENABLE_PIN 27 // 44
|
||||
|
||||
#define Y_STEP_PIN 32 // 33
|
||||
#define Y_DIR_PIN 33 // 31, 32
|
||||
#define Y_ENABLE_PIN 31 // 32
|
||||
|
||||
#define Z_STEP_PIN 35 // 35
|
||||
#define Z_DIR_PIN 36
|
||||
#define Z_ENABLE_PIN 34 // 34
|
||||
|
||||
#define E0_STEP_PIN 42
|
||||
#define E0_DIR_PIN 43
|
||||
#define E0_ENABLE_PIN 37
|
||||
|
||||
#define E1_STEP_PIN 49
|
||||
#define E1_DIR_PIN 47
|
||||
#define E1_ENABLE_PIN 48
|
||||
|
||||
#define MOTOR_CURRENT_PWM_X_PIN 11
|
||||
#define MOTOR_CURRENT_PWM_Y_PIN 44
|
||||
#define MOTOR_CURRENT_PWM_Z_PIN 45
|
||||
#define MOTOR_CURRENT_PWM_E_PIN 46
|
||||
|
||||
// Motor current PWM conversion, PWM value = MotorCurrentSetting * 255 / range
|
||||
#ifndef MOTOR_CURRENT_PWM_RANGE
|
||||
#define MOTOR_CURRENT_PWM_RANGE 2000
|
||||
#endif
|
||||
#define DEFAULT_PWM_MOTOR_CURRENT { 1300, 1300, 1250 }
|
||||
|
||||
//
|
||||
// Temperature Sensors
|
||||
//
|
||||
#define TEMP_0_PIN 8 // Analog Input D62
|
||||
#define TEMP_BED_PIN 10 // Analog Input D64
|
||||
|
||||
#define TEMP_CHAMBER_PIN 9 // Analog Input D63
|
||||
|
||||
//
|
||||
// Heaters / Fans
|
||||
//
|
||||
#define HEATER_0_PIN 2 // PWM
|
||||
#define HEATER_BED_PIN 4 // PWM
|
||||
#define HEATER_CHAMBER_PIN 3 // PWM
|
||||
#define FAN_PIN 7 // PWM
|
||||
|
||||
//
|
||||
// Misc. Functions
|
||||
//
|
||||
#define SDSS 53
|
||||
#define SD_DETECT_PIN 39
|
||||
|
||||
#if ENABLED(CASE_LIGHT_ENABLE)
|
||||
#define CASE_LIGHT_PIN 8
|
||||
#endif
|
||||
|
||||
#if ENABLED(PSU_CONTROL)
|
||||
#define PS_ON_PIN 38 // UPS Module
|
||||
#endif
|
||||
|
||||
//
|
||||
// LCD Controller
|
||||
//
|
||||
|
||||
#define BEEPER_PIN 18
|
||||
|
||||
#if HAS_SPI_LCD
|
||||
#define LCD_PINS_RS 20
|
||||
#define LCD_PINS_ENABLE 30
|
||||
#define LCD_PINS_D4 14
|
||||
#define LCD_PINS_D5 21
|
||||
#define LCD_PINS_D6 5
|
||||
#define LCD_PINS_D7 6
|
||||
#define BTN_EN1 40
|
||||
#define BTN_EN2 41
|
||||
#define BTN_ENC 19
|
||||
#endif
|
||||
|
||||
///////////////////// SPARE HEADERS //////////////
|
||||
|
||||
/**
|
||||
*
|
||||
* J25
|
||||
* 1 D54
|
||||
* 2 D55
|
||||
* 3 D56
|
||||
* 4 D57
|
||||
* 5 D58
|
||||
* 6 D59
|
||||
* 7 D60
|
||||
* 8 D61
|
||||
|
||||
Hotend High Temp Connected : D12
|
||||
*/
|
||||
@@ -258,6 +258,8 @@
|
||||
#include "mega/pins_PICA.h" // ATmega2560 env:mega2560
|
||||
#elif MB(PICA_REVB)
|
||||
#include "mega/pins_PICAOLD.h" // ATmega2560 env:mega2560
|
||||
#elif MB(INTAMSYS40)
|
||||
#include "mega/pins_INTAMSYS40.h" // ATmega2560 env:mega2560
|
||||
|
||||
//
|
||||
// ATmega1281, ATmega2561
|
||||
|
||||
@@ -72,6 +72,10 @@
|
||||
#define Z_MIN_PROBE_PIN 30
|
||||
#endif
|
||||
|
||||
#ifndef FIL_RUNOUT_PIN
|
||||
#define FIL_RUNOUT_PIN 5
|
||||
#endif
|
||||
|
||||
//
|
||||
// Steppers
|
||||
//
|
||||
@@ -153,6 +157,13 @@
|
||||
#define SPINDLE_LASER_ENA_PIN 31 // Pullup!
|
||||
#define SPINDLE_DIR_PIN 32
|
||||
|
||||
//
|
||||
// SPI for Max6675 or Max31855 Thermocouple
|
||||
//
|
||||
#ifndef MAX6675_SS_PIN
|
||||
#define MAX6675_SS_PIN 32 // SPINDLE_DIR_PIN / STAT_LED_BLUE_PIN
|
||||
#endif
|
||||
|
||||
//
|
||||
// M7/M8/M9 - Coolant Control
|
||||
//
|
||||
|
||||
@@ -169,11 +169,11 @@
|
||||
#define TEMP_BED_PIN 14 // Analog Input
|
||||
#endif
|
||||
|
||||
//
|
||||
// SPI for Max6675 or Max31855 Thermocouple
|
||||
#if DISABLED(SDSUPPORT)
|
||||
#define MAX6675_SS_PIN 66 // Don't use 53 if using Display/SD card
|
||||
#else
|
||||
#define MAX6675_SS_PIN 66 // Don't use 49 (SD_DETECT_PIN)
|
||||
//
|
||||
#ifndef MAX6675_SS_PIN
|
||||
#define MAX6675_SS_PIN 66 // Don't use 53 if using Display/SD card (SDSS) or 49 (SD_DETECT_PIN)
|
||||
#endif
|
||||
|
||||
//
|
||||
|
||||
@@ -66,13 +66,13 @@
|
||||
#define RAMPS_D8_PIN TRIGORILLA_FAN0_PIN
|
||||
#else
|
||||
// EEB
|
||||
#define RAMPS_D8_PINTRIGORILLA_HEATER_BED_PIN
|
||||
#define RAMPS_D8_PIN TRIGORILLA_HEATER_BED_PIN
|
||||
#define FAN_PIN TRIGORILLA_FAN0_PIN // Override pin 4 in pins_RAMPS.h
|
||||
#endif
|
||||
#elif TEMP_SENSOR_BED
|
||||
// EFB (Anycubic Kossel default)
|
||||
#define RAMPS_D9_PIN TRIGORILLA_FAN0_PIN
|
||||
#define RAMPS_D8_PINTRIGORILLA_HEATER_BED_PIN
|
||||
#define RAMPS_D8_PIN TRIGORILLA_HEATER_BED_PIN
|
||||
#else
|
||||
// EFF
|
||||
#define RAMPS_D9_PIN TRIGORILLA_FAN1_PIN
|
||||
@@ -83,7 +83,7 @@
|
||||
#define FAN1_PIN TRIGORILLA_FAN1_PIN
|
||||
#endif
|
||||
#define FAN2_PIN TRIGORILLA_FAN2_PIN
|
||||
#define ORIG_E0_AUTO_FAN_PINTRIGORILLA_FAN2_PIN // Used in Anycubic Kossel example config
|
||||
#define ORIG_E0_AUTO_FAN_PIN TRIGORILLA_FAN2_PIN // Used in Anycubic Kossel example config
|
||||
|
||||
#include "pins_RAMPS.h"
|
||||
|
||||
|
||||
@@ -44,8 +44,9 @@
|
||||
//
|
||||
// EEPROM
|
||||
//
|
||||
#define E2END 0x7FFF // 32Kb (24lc256)
|
||||
//#define QSPI_EEPROM // Use AGCM4 onboard QSPI EEPROM (Uses 4K of RAM)
|
||||
#define I2C_EEPROM // EEPROM on I2C-0
|
||||
#define E2END 0x7FFF // 32K (24lc256)
|
||||
|
||||
//
|
||||
// Limit Switches
|
||||
|
||||
@@ -178,14 +178,14 @@
|
||||
//#define E4_HARDWARE_SERIAL Serial1
|
||||
|
||||
// Unused servo pins may be repurposed with SoftwareSerialM
|
||||
//#define X_SERIAL_TX_PIN PF8 // SERVO3_PIN
|
||||
//#define Y_SERIAL_TX_PIN PF9 // SERVO2_PIN
|
||||
//#define Z_SERIAL_TX_PIN PA1 // SERVO1_PIN
|
||||
//#define E0_SERIAL_TX_PIN PC3 // SERVO0_PIN
|
||||
//#define X_SERIAL_RX_PIN X_SERIAL_TX_PIN
|
||||
//#define Y_SERIAL_RX_PIN Y_SERIAL_TX_PIN
|
||||
//#define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN
|
||||
//#define E0_SERIAL_RX_PIN E0_SERIAL_TX_PIN
|
||||
//#define X_SERIAL_TX_PIN PF8 // SERVO3_PIN
|
||||
//#define Y_SERIAL_TX_PIN PF9 // SERVO2_PIN
|
||||
//#define Z_SERIAL_TX_PIN PA1 // SERVO1_PIN
|
||||
//#define E0_SERIAL_TX_PIN PC3 // SERVO0_PIN
|
||||
//#define X_SERIAL_RX_PIN X_SERIAL_TX_PIN
|
||||
//#define Y_SERIAL_RX_PIN Y_SERIAL_TX_PIN
|
||||
//#define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN
|
||||
//#define E0_SERIAL_RX_PIN E0_SERIAL_TX_PIN
|
||||
|
||||
// Reduce baud rate for software serial reliability
|
||||
#if HAS_TMC_SW_SERIAL
|
||||
|
||||
@@ -49,7 +49,6 @@
|
||||
// public:
|
||||
|
||||
card_flags_t CardReader::flag;
|
||||
uint8_t CardReader::sdprinting_done_state;
|
||||
char CardReader::filename[FILENAME_LENGTH], CardReader::longFilename[LONG_FILENAME_LENGTH];
|
||||
int8_t CardReader::autostart_index;
|
||||
|
||||
@@ -1089,7 +1088,7 @@ void CardReader::fileHasFinished() {
|
||||
presort();
|
||||
#endif
|
||||
|
||||
sdprinting_done_state = 1;
|
||||
marlin_state = MF_SD_COMPLETE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,6 @@ typedef struct {
|
||||
|
||||
class CardReader {
|
||||
public:
|
||||
static uint8_t sdprinting_done_state;
|
||||
static card_flags_t flag; // Flags (above)
|
||||
static char filename[FILENAME_LENGTH], // DOS 8.3 filename of the selected item
|
||||
longFilename[LONG_FILENAME_LENGTH]; // Long name of the selected item
|
||||
|
||||
@@ -12,43 +12,6 @@ set -e
|
||||
#restore_configs
|
||||
#exec_test $1 $2 "Default Configuration"
|
||||
|
||||
#
|
||||
# Test 2 extruders (one MAX6675) and heated bed on basic RAMPS 1.4
|
||||
# Test a "Fix Mounted" Probe with Safe Homing, some arc options,
|
||||
# linear bed leveling, M48, leveling debug, and firmware retraction.
|
||||
#
|
||||
restore_configs
|
||||
opt_set MOTHERBOARD BOARD_RAMPS_14_EEB
|
||||
opt_set EXTRUDERS 2
|
||||
opt_set TEMP_SENSOR_0 -2
|
||||
opt_set TEMP_SENSOR_1 1
|
||||
opt_set TEMP_SENSOR_BED 2
|
||||
opt_set TEMP_SENSOR_PROBE 1
|
||||
opt_add TEMP_PROBE_PIN 12
|
||||
opt_set TEMP_SENSOR_CHAMBER 3
|
||||
opt_add HEATER_CHAMBER_PIN 45
|
||||
opt_set GRID_MAX_POINTS_X 16
|
||||
opt_set FANMUX0_PIN 53
|
||||
opt_disable USE_WATCHDOG
|
||||
opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER LCD_PROGRESS_BAR LCD_PROGRESS_BAR_TEST \
|
||||
FIX_MOUNTED_PROBE Z_SAFE_HOMING CODEPENDENT_XY_HOMING PIDTEMPBED \
|
||||
PROBING_HEATERS_OFF PROBING_FANS_OFF PROBING_STEPPERS_OFF WAIT_FOR_BED_HEATER \
|
||||
EEPROM_SETTINGS SDSUPPORT SD_REPRINT_LAST_SELECTED_FILE BINARY_FILE_TRANSFER \
|
||||
BLINKM PCA9632 RGB_LED RGB_LED_R_PIN RGB_LED_G_PIN RGB_LED_B_PIN LED_CONTROL_MENU \
|
||||
NEOPIXEL_LED CASE_LIGHT_ENABLE CASE_LIGHT_USE_NEOPIXEL CASE_LIGHT_MENU \
|
||||
PID_PARAMS_PER_HOTEND PID_AUTOTUNE_MENU PID_EDIT_MENU LCD_SHOW_E_TOTAL \
|
||||
PRINTCOUNTER SERVICE_NAME_1 SERVICE_INTERVAL_1 LEVEL_BED_CORNERS \
|
||||
NOZZLE_PARK_FEATURE FILAMENT_RUNOUT_SENSOR FILAMENT_RUNOUT_DISTANCE_MM \
|
||||
ADVANCED_PAUSE_FEATURE FILAMENT_LOAD_UNLOAD_GCODES FILAMENT_UNLOAD_ALL_EXTRUDERS \
|
||||
AUTO_BED_LEVELING_BILINEAR Z_MIN_PROBE_REPEATABILITY_TEST DISTINCT_E_FACTORS \
|
||||
SKEW_CORRECTION SKEW_CORRECTION_FOR_Z SKEW_CORRECTION_GCODE \
|
||||
BACKLASH_COMPENSATION BACKLASH_GCODE BAUD_RATE_GCODE BEZIER_CURVE_SUPPORT \
|
||||
FWRETRACT ARC_P_CIRCLES CNC_WORKSPACE_PLANES CNC_COORDINATE_SYSTEMS \
|
||||
PSU_CONTROL AUTO_POWER_CONTROL POWER_LOSS_RECOVERY POWER_LOSS_PIN POWER_LOSS_STATE \
|
||||
SLOW_PWM_HEATERS THERMAL_PROTECTION_CHAMBER LIN_ADVANCE EXTRA_LIN_ADVANCE_K \
|
||||
HOST_ACTION_COMMANDS HOST_PROMPT_SUPPORT PINS_DEBUGGING MAX7219_DEBUG M114_DETAIL
|
||||
exec_test $1 $2 "RAMPS | EXTRUDERS 2 | CHAR LCD + SD | FIX Probe | ABL-Linear | Advanced Pause | PLR | LEDs ..."
|
||||
|
||||
#
|
||||
# Test a probeless build of AUTO_BED_LEVELING_UBL, with lots of extruders
|
||||
#
|
||||
|
||||
@@ -33,5 +33,40 @@ opt_enable USE_XMAX_PLUG USE_YMAX_PLUG USE_ZMAX_PLUG \
|
||||
opt_disable MIN_SOFTWARE_ENDSTOP_Z MAX_SOFTWARE_ENDSTOPS
|
||||
exec_test $1 $2 "Rambo CNC Configuration"
|
||||
|
||||
#
|
||||
# Lots of options - Formerly the first Mega2560 test
|
||||
#
|
||||
restore_configs
|
||||
opt_set MOTHERBOARD BOARD_RAMBO
|
||||
opt_set EXTRUDERS 2
|
||||
opt_set TEMP_SENSOR_0 -2
|
||||
opt_set TEMP_SENSOR_1 1
|
||||
opt_set TEMP_SENSOR_BED 2
|
||||
opt_set TEMP_SENSOR_PROBE 1
|
||||
opt_add TEMP_PROBE_PIN 12
|
||||
opt_set TEMP_SENSOR_CHAMBER 3
|
||||
opt_add HEATER_CHAMBER_PIN 45
|
||||
opt_set GRID_MAX_POINTS_X 16
|
||||
opt_set FANMUX0_PIN 53
|
||||
opt_disable USE_WATCHDOG
|
||||
opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER LCD_PROGRESS_BAR LCD_PROGRESS_BAR_TEST \
|
||||
FIX_MOUNTED_PROBE Z_SAFE_HOMING CODEPENDENT_XY_HOMING PIDTEMPBED \
|
||||
PROBING_HEATERS_OFF PROBING_FANS_OFF PROBING_STEPPERS_OFF WAIT_FOR_BED_HEATER \
|
||||
EEPROM_SETTINGS SDSUPPORT SD_REPRINT_LAST_SELECTED_FILE BINARY_FILE_TRANSFER \
|
||||
BLINKM PCA9632 RGB_LED RGB_LED_R_PIN RGB_LED_G_PIN RGB_LED_B_PIN LED_CONTROL_MENU \
|
||||
NEOPIXEL_LED CASE_LIGHT_ENABLE CASE_LIGHT_USE_NEOPIXEL CASE_LIGHT_MENU \
|
||||
PID_PARAMS_PER_HOTEND PID_AUTOTUNE_MENU PID_EDIT_MENU LCD_SHOW_E_TOTAL \
|
||||
PRINTCOUNTER SERVICE_NAME_1 SERVICE_INTERVAL_1 LEVEL_BED_CORNERS \
|
||||
NOZZLE_PARK_FEATURE FILAMENT_RUNOUT_SENSOR FILAMENT_RUNOUT_DISTANCE_MM \
|
||||
ADVANCED_PAUSE_FEATURE FILAMENT_LOAD_UNLOAD_GCODES FILAMENT_UNLOAD_ALL_EXTRUDERS \
|
||||
AUTO_BED_LEVELING_BILINEAR Z_MIN_PROBE_REPEATABILITY_TEST DISTINCT_E_FACTORS \
|
||||
SKEW_CORRECTION SKEW_CORRECTION_FOR_Z SKEW_CORRECTION_GCODE \
|
||||
BACKLASH_COMPENSATION BACKLASH_GCODE BAUD_RATE_GCODE BEZIER_CURVE_SUPPORT \
|
||||
FWRETRACT ARC_P_CIRCLES CNC_WORKSPACE_PLANES CNC_COORDINATE_SYSTEMS \
|
||||
PSU_CONTROL AUTO_POWER_CONTROL POWER_LOSS_RECOVERY POWER_LOSS_PIN POWER_LOSS_STATE \
|
||||
SLOW_PWM_HEATERS THERMAL_PROTECTION_CHAMBER LIN_ADVANCE EXTRA_LIN_ADVANCE_K \
|
||||
HOST_ACTION_COMMANDS HOST_PROMPT_SUPPORT PINS_DEBUGGING MAX7219_DEBUG M114_DETAIL
|
||||
exec_test $1 $2 "RAMBO | EXTRUDERS 2 | CHAR LCD + SD | FIX Probe | ABL-Linear | Advanced Pause | PLR | LEDs ..."
|
||||
|
||||
# clean up
|
||||
restore_configs
|
||||
|
||||
+5
-4
@@ -301,7 +301,7 @@ extra_scripts = buildroot/share/PlatformIO/scripts/STM32F103RC_SKR_MINI.py
|
||||
src_filter = ${common.default_src_filter} +<src/HAL/STM32F1>
|
||||
lib_deps = ${common.lib_deps}
|
||||
SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip
|
||||
USBComposite_stm32f1@==0.91
|
||||
USBComposite for STM32F1@==0.91
|
||||
lib_ignore = Adafruit NeoPixel, SPI
|
||||
monitor_speed = 115200
|
||||
|
||||
@@ -316,7 +316,7 @@ extra_scripts = buildroot/share/PlatformIO/scripts/STM32F103RC_SKR_MINI.py
|
||||
src_filter = ${common.default_src_filter} +<src/HAL/STM32F1>
|
||||
lib_deps = ${common.lib_deps}
|
||||
SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip
|
||||
USBComposite_stm32f1@==0.91
|
||||
USBComposite for STM32F1@==0.91
|
||||
lib_ignore = Adafruit NeoPixel, SPI
|
||||
monitor_speed = 115200
|
||||
|
||||
@@ -332,7 +332,7 @@ extra_scripts = buildroot/share/PlatformIO/scripts/STM32F103RC_SKR_MINI.py
|
||||
src_filter = ${common.default_src_filter} +<src/HAL/STM32F1>
|
||||
lib_deps = ${common.lib_deps}
|
||||
SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip
|
||||
USBComposite_stm32f1@==0.91
|
||||
USBComposite for STM32F1@==0.91
|
||||
lib_ignore = Adafruit NeoPixel, SPI
|
||||
monitor_speed = 115200
|
||||
|
||||
@@ -348,7 +348,7 @@ extra_scripts = buildroot/share/PlatformIO/scripts/STM32F103RC_SKR_MINI.py
|
||||
src_filter = ${common.default_src_filter} +<src/HAL/STM32F1>
|
||||
lib_deps = ${common.lib_deps}
|
||||
SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip
|
||||
USBComposite_stm32f1@==0.91
|
||||
USBComposite for STM32F1@==0.91
|
||||
lib_ignore = Adafruit NeoPixel, SPI
|
||||
monitor_speed = 115200
|
||||
|
||||
@@ -792,6 +792,7 @@ build_unflags = -std=gnu++11
|
||||
src_filter = ${common.default_src_filter} +<src/HAL/SAMD51>
|
||||
lib_deps = ${common.lib_deps}
|
||||
SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip
|
||||
Adafruit_SPIFlash=https://github.com/adafruit/Adafruit_SPIFlash/archive/master.zip
|
||||
debug_tool = jlink
|
||||
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user