cleaning git

This commit is contained in:
Xavier Perignon
2020-06-15 14:24:57 +02:00
parent dcf352c27d
commit ba2f460a43
1542 changed files with 1832 additions and 2701 deletions

View File

@@ -1,43 +0,0 @@
---
name: Bug report
about: Report a bug in Marlin
title: "[BUG] (short description)"
labels: ''
assignees: ''
---
<!--
Have you read Marlin's Code of Conduct? By filing an Issue, you are expected to comply with it, including treating everyone with respect: https://github.com/MarlinFirmware/Marlin/blob/master/.github/code_of_conduct.md
Do you want to ask a question? Are you looking for support? Please don't post here. Instead please use one of the support links at https://github.com/MarlinFirmware/Marlin/issues/new/choose
Before filing an issue be sure to test the "bugfix" branches to see whether the issue has been resolved.
-->
### Bug Description
<!-- Description of the bug -->
### My Configurations
**Required:** Please include a ZIP file containing your `Configuration.h` and `Configuration_adv.h` files.
### Steps to Reproduce
<!-- Please describe the steps needed to reproduce the issue -->
1. [First Step]
2. [Second Step]
3. [and so on...]
**Expected behavior:** [What you expect to happen]
**Actual behavior:** [What actually happens]
#### Additional Information
* Provide pictures or links to videos that clearly demonstrate the issue.
* See [How Can I Contribute](#how-can-i-contribute) for additional guidelines.

View File

@@ -1,17 +0,0 @@
blank_issues_enabled: false
contact_links:
- name: Marlin Documentation
url: http://marlinfw.org/
about: Lots of documentation on installing and using Marlin.
- name: MarlinFirmware Facebook group
url: https://www.facebook.com/groups/1049718498464482
about: Please ask and answer questions here.
- name: Marlin on Discord
url: https://discord.gg/n5NJ59y
about: Join the Discord server for support and discussion.
- name: Marlin Discussion Forum
url: http://forums.reprap.org/list.php?415
about: A searchable web forum hosted by RepRap dot org.
- name: Marlin Videos on YouTube
url: https://www.youtube.com/results?search_query=marlin+firmware
about: Tutorials and more from Marlin users all around the world. Great for new users!

View File

@@ -1,35 +0,0 @@
---
name: Feature request
about: Request a Feature
title: "[FR] (feature request title)"
labels: ''
assignees: ''
---
<!--
Have you read Marlin's Code of Conduct? By filing an Issue, you are expected to comply with it, including treating everyone with respect: https://github.com/MarlinFirmware/Marlin/blob/master/.github/code_of_conduct.md
Do you want to ask a question? Are you looking for support? Please don't post here. Instead please use one of the support links at https://github.com/MarlinFirmware/Marlin/issues/new/choose
Before filing an issue be sure to test the "bugfix" branches to see whether the issue has been resolved.
-->
### Description
<!-- Description of the requested feature -->
### Feature Workflow
<!-- Please describe the feature's behavior, user interaction, etc. -->
1. [First Action]
2. [Second Action]
3. [and so on...]
#### Additional Information
* Provide pictures or links that demonstrate a similar feature or concept.
* See [How Can I Contribute](#how-can-i-contribute) for additional guidelines.

View File

@@ -1,16 +0,0 @@
# NO SUPPORT REQUESTS PLEASE
Support Requests posted here will be automatically closed!
This Issue Queue is for Marlin bug reports and development-related issues, and we prefer not to handle user-support questions here. See https://github.com/MarlinFirmware/Marlin/blob/1.1.x/.github/contributing.md#i-dont-want-to-read-this-whole-thing-i-just-have-a-question.
For best results getting help with configuration and troubleshooting, please use the following resources:
- RepRap.org Marlin Forum http://forums.reprap.org/list.php?415
- Tom's 3D Forums https://discuss.toms3d.org/
- Facebook Group "Marlin Firmware" https://www.facebook.com/groups/1049718498464482/
- Facebook Group "Marlin Firmware for 3D Printers" https://www.facebook.com/groups/3Dtechtalk/
- Marlin Configuration https://www.youtube.com/results?search_query=marlin+configuration on YouTube
- Marlin Discord server. Join link: https://discord.gg/n5NJ59y
After seeking help from the community, if the consensus points to to a bug in Marlin, then you should post a Bug Report at https://github.com/MarlinFirmware/Marlin/issues/new/choose).

View File

@@ -1,7 +0,0 @@
Thanks for your contribution! Unfortunately we can't accept PRs directed at release branches. We make patches to the bugfix branches and only later do we push them out as releases.
Please redo this PR starting with the `bugfix-2.0.x` branch and be careful to target `bugfix-2.0.x` when resubmitting the PR.
It may help to set your fork's default branch to `bugfix-2.0.x`.
See [this page](http://marlinfw.org/docs/development/getting_started_pull_requests.html) for full instructions.

View File

@@ -1,34 +0,0 @@
#
# bump-date.yml
# Bump the distribution date once per day
#
name: Bump Distribution Date
on:
schedule:
- cron: '0 0 * * *'
jobs:
bump_date:
runs-on: ubuntu-latest
steps:
- name: Check out bugfix-2.0.x
uses: actions/checkout@v2
with:
ref: bugfix-2.0.x
- name: Bump Distribution Date
run: |
# Inline Bump Script
[[ "$GITHUB_REPOSITORY" == "MarlinFirmware/Marlin" ]] || exit 0
DIST=$( date +"%Y-%m-%d" )
eval "sed -E -i 's/(#define +STRING_DISTRIBUTION_DATE) .*$/\1 \"$DIST\"/g' Marlin/src/inc/Version.h" && \
git config user.name "${GITHUB_ACTOR}" && \
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" && \
git add . && \
git commit -m "[cron] Bump distribution date ($DIST)" && \
git push

View File

@@ -1,27 +0,0 @@
#
# comment-pr.yml
# Add a comment to any PR directed to a release branch
#
name: PR Bad Target
on:
pull_request:
branches:
- 1.0.x
- 1.1.x
- 2.0.x
jobs:
bad_target:
name: PR Bad Target
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: harupy/comment-on-pr@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: bad-target.md

View File

@@ -1,206 +0,0 @@
/**
* 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/>.
*
*/
/**
* The PWM module is only used to generate interrupts at specified times. It
* is NOT used to directly toggle pins. The ISR writes to the pin assigned to
* that interrupt.
*
* All PWMs use the same repetition rate. The G2 needs about 10KHz min in order to
* not have obvious ripple on the Vref signals.
*
* The data structures are setup to minimize the computation done by the ISR which
* minimizes ISR execution time. Execution times are 0.8 to 1.1 microseconds.
*
* FIve PWM interrupt sources are used. Channel 0 sets the base period. All Vref
* signals are set active when this counter overflows and resets to zero. The compare
* values in channels 1-4 are set to give the desired duty cycle for that Vref pin.
* When counter 0 matches the compare value then that channel generates an interrupt.
* The ISR checks the source of the interrupt and sets the corresponding pin inactive.
*
* Some jitter in the Vref signal is OK so the interrupt priority is left at its default value.
*/
#include "../../../inc/MarlinConfig.h"
#if MB(PRINTRBOARD_G2)
#include "G2_PWM.h"
#if PIN_EXISTS(MOTOR_CURRENT_PWM_X)
#define G2_PWM_X 1
#else
#define G2_PWM_X 0
#endif
#if PIN_EXISTS(MOTOR_CURRENT_PWM_Y)
#define G2_PWM_Y 1
#else
#define G2_PWM_Y 0
#endif
#if PIN_EXISTS(MOTOR_CURRENT_PWM_Z)
#define G2_PWM_Z 1
#else
#define G2_PWM_Z 0
#endif
#if PIN_EXISTS(MOTOR_CURRENT_PWM_E)
#define G2_PWM_E 1
#else
#define G2_PWM_E 0
#endif
#define G2_MASK_X(V) (G2_PWM_X * (V))
#define G2_MASK_Y(V) (G2_PWM_Y * (V))
#define G2_MASK_Z(V) (G2_PWM_Z * (V))
#define G2_MASK_E(V) (G2_PWM_E * (V))
volatile uint32_t *SODR_A = &PIOA->PIO_SODR,
*SODR_B = &PIOB->PIO_SODR,
*CODR_A = &PIOA->PIO_CODR,
*CODR_B = &PIOB->PIO_CODR;
PWM_map ISR_table[NUM_PWMS] = PWM_MAP_INIT;
void Stepper::digipot_init() {
#if PIN_EXISTS(MOTOR_CURRENT_PWM_X)
OUT_WRITE(MOTOR_CURRENT_PWM_X_PIN, 0); // init pins
#endif
#if PIN_EXISTS(MOTOR_CURRENT_PWM_Y)
OUT_WRITE(MOTOR_CURRENT_PWM_Y_PIN, 0);
#endif
#if G2_PWM_Z
OUT_WRITE(MOTOR_CURRENT_PWM_Z_PIN, 0);
#endif
#if G2_PWM_E
OUT_WRITE(MOTOR_CURRENT_PWM_E_PIN, 0);
#endif
#define WPKEY (0x50574D << 8) // “PWM” in ASCII
#define WPCMD_DIS_SW 0 // command to disable Write Protect SW
#define WPRG_ALL (PWM_WPCR_WPRG0 | PWM_WPCR_WPRG1 | PWM_WPCR_WPRG2 | PWM_WPCR_WPRG3 | PWM_WPCR_WPRG4 | PWM_WPCR_WPRG5) // all Write Protect Groups
#define PWM_CLOCK_F F_CPU / 1000000UL // set clock to 1MHz
PMC->PMC_PCER1 = PMC_PCER1_PID36; // enable PWM controller clock (disabled on power up)
PWM->PWM_WPCR = WPKEY | WPRG_ALL | WPCMD_DIS_SW; // enable setting of all PWM registers
PWM->PWM_CLK = PWM_CLOCK_F; // enable CLK_A and set it to 1MHz, leave CLK_B disabled
PWM->PWM_CH_NUM[0].PWM_CMR = 0b1011; // set channel 0 to Clock A input & to left aligned
if (G2_PWM_X) PWM->PWM_CH_NUM[1].PWM_CMR = 0b1011; // set channel 1 to Clock A input & to left aligned
if (G2_PWM_Y) PWM->PWM_CH_NUM[2].PWM_CMR = 0b1011; // set channel 2 to Clock A input & to left aligned
if (G2_PWM_Z) PWM->PWM_CH_NUM[3].PWM_CMR = 0b1011; // set channel 3 to Clock A input & to left aligned
if (G2_PWM_E) PWM->PWM_CH_NUM[4].PWM_CMR = 0b1011; // set channel 4 to Clock A input & to left aligned
PWM->PWM_CH_NUM[0].PWM_CPRD = PWM_PERIOD_US; // set channel 0 Period
PWM->PWM_IER2 = PWM_IER1_CHID0; // generate interrupt when counter0 overflows
PWM->PWM_IER2 = PWM_IER2_CMPM0
| G2_MASK_X(PWM_IER2_CMPM1)
| G2_MASK_Y(PWM_IER2_CMPM2)
| G2_MASK_Z(PWM_IER2_CMPM3)
| G2_MASK_E(PWM_IER2_CMPM4)
; // generate interrupt on compare event
if (G2_PWM_X) PWM->PWM_CMP[1].PWM_CMPV = 0x010000000LL | G2_VREF_COUNT(G2_VREF(motor_current_setting[0])); // interrupt when counter0 == CMPV - used to set Motor 1 PWM inactive
if (G2_PWM_Y) PWM->PWM_CMP[2].PWM_CMPV = 0x010000000LL | G2_VREF_COUNT(G2_VREF(motor_current_setting[0])); // interrupt when counter0 == CMPV - used to set Motor 2 PWM inactive
if (G2_PWM_Z) PWM->PWM_CMP[3].PWM_CMPV = 0x010000000LL | G2_VREF_COUNT(G2_VREF(motor_current_setting[1])); // interrupt when counter0 == CMPV - used to set Motor 3 PWM inactive
if (G2_PWM_E) PWM->PWM_CMP[4].PWM_CMPV = 0x010000000LL | G2_VREF_COUNT(G2_VREF(motor_current_setting[2])); // interrupt when counter0 == CMPV - used to set Motor 4 PWM inactive
if (G2_PWM_X) PWM->PWM_CMP[1].PWM_CMPM = 0x0001; // enable compare event
if (G2_PWM_Y) PWM->PWM_CMP[2].PWM_CMPM = 0x0001; // enable compare event
if (G2_PWM_Z) PWM->PWM_CMP[3].PWM_CMPM = 0x0001; // enable compare event
if (G2_PWM_E) PWM->PWM_CMP[4].PWM_CMPM = 0x0001; // enable compare event
PWM->PWM_SCM = PWM_SCM_UPDM_MODE0 | PWM_SCM_SYNC0
| G2_MASK_X(PWM_SCM_SYNC1)
| G2_MASK_Y(PWM_SCM_SYNC2)
| G2_MASK_Z(PWM_SCM_SYNC3)
| G2_MASK_E(PWM_SCM_SYNC4)
; // sync 1-4 with 0, use mode 0 for updates
PWM->PWM_ENA = PWM_ENA_CHID0
| G2_MASK_X(PWM_ENA_CHID1)
| G2_MASK_Y(PWM_ENA_CHID2)
| G2_MASK_Z(PWM_ENA_CHID3)
| G2_MASK_E(PWM_ENA_CHID4)
; // enable channels used by G2
PWM->PWM_IER1 = PWM_IER1_CHID0
| G2_MASK_X(PWM_IER1_CHID1)
| G2_MASK_Y(PWM_IER1_CHID2)
| G2_MASK_Z(PWM_IER1_CHID3)
| G2_MASK_E(PWM_IER1_CHID4)
; // enable interrupts for channels used by G2
NVIC_EnableIRQ(PWM_IRQn); // Enable interrupt handler
NVIC_SetPriority(PWM_IRQn, NVIC_EncodePriority(0, 10, 0)); // normal priority for PWM module (can stand some jitter on the Vref signals)
}
void Stepper::digipot_current(const uint8_t driver, const int16_t current) {
if (!(PWM->PWM_CH_NUM[0].PWM_CPRD == PWM_PERIOD_US)) digipot_init(); // Init PWM system if needed
switch (driver) {
case 0:
if (G2_PWM_X) PWM->PWM_CMP[1].PWM_CMPVUPD = 0x010000000LL | G2_VREF_COUNT(G2_VREF(current)); // update X & Y
if (G2_PWM_Y) PWM->PWM_CMP[2].PWM_CMPVUPD = 0x010000000LL | G2_VREF_COUNT(G2_VREF(current));
if (G2_PWM_X) PWM->PWM_CMP[1].PWM_CMPMUPD = 0x0001; // enable compare event
if (G2_PWM_Y) PWM->PWM_CMP[2].PWM_CMPMUPD = 0x0001; // enable compare event
if (G2_PWM_X || G2_PWM_Y) PWM->PWM_SCUC = PWM_SCUC_UPDULOCK; // tell the PWM controller to update the values on the next cycle
break;
case 1:
if (G2_PWM_Z) {
PWM->PWM_CMP[3].PWM_CMPVUPD = 0x010000000LL | G2_VREF_COUNT(G2_VREF(current)); // update Z
PWM->PWM_CMP[3].PWM_CMPMUPD = 0x0001; // enable compare event
PWM->PWM_SCUC = PWM_SCUC_UPDULOCK; // tell the PWM controller to update the values on the next cycle
}
break;
default:
if (G2_PWM_E) {
PWM->PWM_CMP[4].PWM_CMPVUPD = 0x010000000LL | G2_VREF_COUNT(G2_VREF(current)); // update E
PWM->PWM_CMP[4].PWM_CMPMUPD = 0x0001; // enable compare event
PWM->PWM_SCUC = PWM_SCUC_UPDULOCK; // tell the PWM controller to update the values on the next cycle
}
break;
}
}
volatile uint32_t PWM_ISR1_STATUS, PWM_ISR2_STATUS;
void PWM_Handler() {
PWM_ISR1_STATUS = PWM->PWM_ISR1;
PWM_ISR2_STATUS = PWM->PWM_ISR2;
if (PWM_ISR1_STATUS & PWM_IER1_CHID0) { // CHAN_0 interrupt
if (G2_PWM_X) *ISR_table[0].set_register = ISR_table[0].write_mask; // set X to active
if (G2_PWM_Y) *ISR_table[1].set_register = ISR_table[1].write_mask; // set Y to active
if (G2_PWM_Z) *ISR_table[2].set_register = ISR_table[2].write_mask; // set Z to active
if (G2_PWM_E) *ISR_table[3].set_register = ISR_table[3].write_mask; // set E to active
}
else {
if (G2_PWM_X && (PWM_ISR2_STATUS & PWM_IER2_CMPM1)) *ISR_table[0].clr_register = ISR_table[0].write_mask; // set X to inactive
if (G2_PWM_Y && (PWM_ISR2_STATUS & PWM_IER2_CMPM2)) *ISR_table[1].clr_register = ISR_table[1].write_mask; // set Y to inactive
if (G2_PWM_Z && (PWM_ISR2_STATUS & PWM_IER2_CMPM3)) *ISR_table[2].clr_register = ISR_table[2].write_mask; // set Z to inactive
if (G2_PWM_E && (PWM_ISR2_STATUS & PWM_IER2_CMPM4)) *ISR_table[3].clr_register = ISR_table[3].write_mask; // set E to inactive
}
return;
}
#endif // PRINTRBOARD_G2

View File

@@ -1,78 +0,0 @@
/**
* 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

View File

@@ -1,51 +0,0 @@
/**
* @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;

View File

@@ -1,66 +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) && 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__

View File

@@ -1,96 +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(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__

View File

@@ -1,71 +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(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__

View File

@@ -1,109 +0,0 @@
/**
* 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

View File

@@ -1,165 +0,0 @@
/*****************
* main_menu.cpp *
*****************/
/****************************************************************************
* Written By Mark Pelletier 2017 - Aleph Objects, Inc. *
* Written By Marcio Teixeira 2018 - Aleph Objects, Inc. *
* Written By Marcio Teixeira 2019 - Cocoa Press *
* *
* 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. *
* *
* To view a copy of the GNU General Public License, go to the following *
* location: <http://www.gnu.org/licenses/>. *
****************************************************************************/
#include "../config.h"
#if ENABLED(TOUCH_UI_FTDI_EVE) && !defined(TOUCH_UI_LULZBOT_BIO)
#include "screens.h"
using namespace FTDI;
using namespace Theme;
void MainMenu::onRedraw(draw_mode_t what) {
if (what & BACKGROUND) {
CommandProcessor cmd;
cmd.cmd(CLEAR_COLOR_RGB(Theme::bg_color))
.cmd(CLEAR(true,true,true));
}
#ifdef TOUCH_UI_PORTRAIT
#define GRID_ROWS 8
#define GRID_COLS 2
#define ABOUT_PRINTER_POS BTN_POS(1,1), BTN_SIZE(2,1)
#define ADVANCED_SETTINGS_POS BTN_POS(1,2), BTN_SIZE(2,1)
#define FILAMENTCHANGE_POS BTN_POS(1,3), BTN_SIZE(2,1)
#define TEMPERATURE_POS BTN_POS(1,4), BTN_SIZE(2,1)
#define MOVE_AXIS_POS BTN_POS(1,5), BTN_SIZE(1,1)
#define DISABLE_STEPPERS_POS BTN_POS(2,5), BTN_SIZE(1,1)
#define AUTO_HOME_POS BTN_POS(1,6), BTN_SIZE(1,1)
#define CLEAN_NOZZLE_POS BTN_POS(2,6), BTN_SIZE(1,1)
#define LEVEL_BED_POS BTN_POS(1,7), BTN_SIZE(1,1)
#define LEVEL_AXIS_POS BTN_POS(2,7), BTN_SIZE(1,1)
#define BACK_POS BTN_POS(1,8), BTN_SIZE(2,1)
#else
#define GRID_ROWS 6
#define GRID_COLS 2
#define ADVANCED_SETTINGS_POS BTN_POS(1,1), BTN_SIZE(1,1)
#define ABOUT_PRINTER_POS BTN_POS(2,1), BTN_SIZE(1,1)
#define AUTO_HOME_POS BTN_POS(1,2), BTN_SIZE(1,1)
#define CLEAN_NOZZLE_POS BTN_POS(2,2), BTN_SIZE(1,1)
#define MOVE_AXIS_POS BTN_POS(1,3), BTN_SIZE(1,1)
#define DISABLE_STEPPERS_POS BTN_POS(2,3), BTN_SIZE(1,1)
#define TEMPERATURE_POS BTN_POS(1,4), BTN_SIZE(1,1)
#define FILAMENTCHANGE_POS BTN_POS(2,4), BTN_SIZE(1,1)
#define LEVEL_BED_POS BTN_POS(1,5), BTN_SIZE(1,1)
#define LEVEL_AXIS_POS BTN_POS(2,5), BTN_SIZE(1,1)
#define BACK_POS BTN_POS(1,6), BTN_SIZE(2,1)
#endif
if (what & FOREGROUND) {
CommandProcessor cmd;
cmd.colors(normal_btn)
.font(Theme::font_medium)
.tag(2).button( AUTO_HOME_POS, GET_TEXT_F(MSG_AUTO_HOME))
.enabled(
#if ANY(NOZZLE_CLEAN_FEATURE, TOUCH_UI_COCOA_PRESS)
1
#endif
)
.tag(3).button( CLEAN_NOZZLE_POS, GET_TEXT_F(
#if ENABLED(TOUCH_UI_COCOA_PRESS)
MSG_PREHEAT_1
#else
MSG_CLEAN_NOZZLE
#endif
))
.tag(4).button( MOVE_AXIS_POS, GET_TEXT_F(MSG_MOVE_AXIS))
.tag(5).button( DISABLE_STEPPERS_POS, GET_TEXT_F(MSG_DISABLE_STEPPERS))
.tag(6).button( TEMPERATURE_POS, GET_TEXT_F(MSG_TEMPERATURE))
.enabled(
#if DISABLED(TOUCH_UI_LULZBOT_BIO)
1
#endif
)
.tag(7).button( FILAMENTCHANGE_POS, GET_TEXT_F(
#if ENABLED(TOUCH_UI_COCOA_PRESS)
MSG_CASE_LIGHT
#else
MSG_FILAMENTCHANGE
#endif
))
.tag(8).button( ADVANCED_SETTINGS_POS, GET_TEXT_F(MSG_ADVANCED_SETTINGS))
.enabled(
#ifdef PRINTCOUNTER
1
#endif
)
.enabled(
#ifdef AXIS_LEVELING_COMMANDS
1
#endif
)
.tag(9).button( LEVEL_AXIS_POS, GET_TEXT_F(MSG_AUTOLEVEL_X_AXIS))
.enabled(
#ifdef HAS_LEVELING
1
#endif
)
.tag(10).button( LEVEL_BED_POS, GET_TEXT_F(MSG_LEVEL_BED))
.tag(11).button( ABOUT_PRINTER_POS, GET_TEXT_F(MSG_INFO_MENU))
.colors(action_btn)
.tag(1).button( BACK_POS, GET_TEXT_F(MSG_BACK));
}
}
bool MainMenu::onTouchEnd(uint8_t tag) {
using namespace ExtUI;
switch (tag) {
case 1: SaveSettingsDialogBox::promptToSaveSettings(); break;
case 2: SpinnerDialogBox::enqueueAndWait_P(F("G28")); break;
#if ENABLED(TOUCH_UI_COCOA_PRESS)
case 3: GOTO_SCREEN(PreheatMenu); break;
#elif ENABLED(NOZZLE_CLEAN_FEATURE)
case 3: injectCommands_P(PSTR("G12")); GOTO_SCREEN(StatusScreen); break;
#endif
case 4: GOTO_SCREEN(MoveAxisScreen); break;
case 5: injectCommands_P(PSTR("M84")); break;
case 6: GOTO_SCREEN(TemperatureScreen); break;
#if ENABLED(TOUCH_UI_COCOA_PRESS) && HAS_CASE_LIGHT
case 7: GOTO_SCREEN(CaseLightScreen); break;
#else
case 7: GOTO_SCREEN(ChangeFilamentScreen); break;
#endif
case 8: GOTO_SCREEN(AdvancedSettingsMenu); break;
#ifdef AXIS_LEVELING_COMMANDS
case 9: SpinnerDialogBox::enqueueAndWait_P(F(AXIS_LEVELING_COMMANDS)); break;
#endif
#ifdef HAS_LEVELING
case 10: SpinnerDialogBox::enqueueAndWait_P(F(
#ifdef BED_LEVELING_COMMANDS
BED_LEVELING_COMMANDS
#else
"G29"
#endif
)); break;
#endif
case 11: GOTO_SCREEN(AboutScreen); break;
default:
return false;
}
return true;
}
#endif // TOUCH_UI_FTDI_EVE

View File

@@ -1,83 +0,0 @@
/********************
* preheat_menu.cpp *
********************/
/****************************************************************************
* Written By Marcio Teixeira 2020 - Cocoa Press *
* *
* 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. *
* *
* To view a copy of the GNU General Public License, go to the following *
* location: <http://www.gnu.org/licenses/>. *
****************************************************************************/
#include "../config.h"
#if ENABLED(TOUCH_UI_FTDI_EVE) && defined(TOUCH_UI_COCOA_PRESS)
#include "screens.h"
using namespace FTDI;
using namespace ExtUI;
using namespace Theme;
void PreheatMenu::onRedraw(draw_mode_t what) {
if (what & BACKGROUND) {
CommandProcessor cmd;
cmd.cmd(CLEAR_COLOR_RGB(Theme::bg_color))
.cmd(CLEAR(true,true,true))
.tag(0);
}
#define GRID_ROWS 3
#define GRID_COLS 2
if (what & FOREGROUND) {
CommandProcessor cmd;
cmd.cmd(COLOR_RGB(bg_text_enabled))
.font(Theme::font_medium)
.text ( BTN_POS(1,1), BTN_SIZE(2,1), GET_TEXT_F(MSG_PREHEAT_1))
.colors(normal_btn)
.tag(2).button( BTN_POS(1,2), BTN_SIZE(1,1), F("Dark Chocolate"))
.tag(3).button( BTN_POS(2,2), BTN_SIZE(1,1), F("Milk Chocolate"))
.tag(4).button( BTN_POS(1,3), BTN_SIZE(1,1), F("White Chocolate"))
.colors(action_btn)
.tag(1) .button( BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_BACK));
}
}
bool PreheatMenu::onTouchEnd(uint8_t tag) {
switch (tag) {
case 1: GOTO_PREVIOUS(); break;
case 2:
#ifdef COCOA_PRESS_PREHEAT_DARK_CHOCOLATE_SCRIPT
injectCommands_P(PSTR(COCOA_PRESS_PREHEAT_DARK_CHOCOLATE_SCRIPT));
#endif
GOTO_SCREEN(PreheatTimerScreen);
break;
case 3:
#ifdef COCOA_PRESS_PREHEAT_MILK_CHOCOLATE_SCRIPT
injectCommands_P(PSTR(COCOA_PRESS_PREHEAT_MILK_CHOCOLATE_SCRIPT));
#endif
GOTO_SCREEN(PreheatTimerScreen);
break;
case 4:
#ifdef COCOA_PRESS_PREHEAT_WHITE_CHOCOLATE_SCRIPT
injectCommands_P(PSTR(COCOA_PRESS_PREHEAT_WHITE_CHOCOLATE_SCRIPT));
#endif
GOTO_SCREEN(PreheatTimerScreen);
break;
default: return false;
}
return true;
}
#endif // TOUCH_UI_FTDI_EVE

View File

@@ -1,177 +0,0 @@
/************
* colors.h *
************/
/****************************************************************************
* Written By Mark Pelletier 2017 - Aleph Objects, Inc. *
* Written By Marcio Teixeira 2018 - Aleph Objects, Inc. *
* Written By Marcio Teixeira 2019 - Cocoa Press *
* *
* 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. *
* *
* To view a copy of the GNU General Public License, go to the following *
* location: <http://www.gnu.org/licenses/>. *
****************************************************************************/
#pragma once
namespace Theme {
#if ENABLED(TOUCH_UI_COCOA_THEME)
constexpr int accent_hue = 23;
// Browns and Oranges
constexpr uint32_t accent_color_1 = hsl_to_rgb(12.8,0.597,0.263); // Darkest
constexpr uint32_t accent_color_2 = hsl_to_rgb(12.8,0.597,0.263);
constexpr uint32_t accent_color_3 = hsl_to_rgb( 9.6,0.664,0.443);
constexpr uint32_t accent_color_4 = hsl_to_rgb(16.3,0.873,0.537);
constexpr uint32_t accent_color_5 = hsl_to_rgb(23.0,0.889,0.539);
constexpr uint32_t accent_color_6 = hsl_to_rgb(23.0,0.889,0.539); // Lightest
#else
// Use linear accent colors
#if ANY(TOUCH_UI_ROYAL_THEME, TOUCH_UI_FROZEN_THEME)
// Dark blue accent colors
constexpr int accent_hue = 216;
constexpr float accent_sat = 0.7;
#else
// Green accent colors
constexpr int accent_hue = 68;
constexpr float accent_sat = 0.68;
#endif
// Shades of accent color
constexpr uint32_t accent_color_0 = hsl_to_rgb(accent_hue, accent_sat, 0.15); // Darkest
constexpr uint32_t accent_color_1 = hsl_to_rgb(accent_hue, accent_sat, 0.26);
constexpr uint32_t accent_color_2 = hsl_to_rgb(accent_hue, accent_sat, 0.39);
constexpr uint32_t accent_color_3 = hsl_to_rgb(accent_hue, accent_sat, 0.52);
constexpr uint32_t accent_color_4 = hsl_to_rgb(accent_hue, accent_sat, 0.65);
constexpr uint32_t accent_color_5 = hsl_to_rgb(accent_hue, accent_sat, 0.78);
constexpr uint32_t accent_color_6 = hsl_to_rgb(accent_hue, accent_sat, 0.91); // Lightest
#endif
// Shades of gray
constexpr float gray_sat = 0.14;
constexpr uint32_t gray_color_0 = hsl_to_rgb(accent_hue, gray_sat, 0.15); // Darkest
constexpr uint32_t gray_color_1 = hsl_to_rgb(accent_hue, gray_sat, 0.26);
constexpr uint32_t gray_color_2 = hsl_to_rgb(accent_hue, gray_sat, 0.39);
constexpr uint32_t gray_color_3 = hsl_to_rgb(accent_hue, gray_sat, 0.52);
constexpr uint32_t gray_color_4 = hsl_to_rgb(accent_hue, gray_sat, 0.65);
constexpr uint32_t gray_color_5 = hsl_to_rgb(accent_hue, gray_sat, 0.78);
constexpr uint32_t gray_color_6 = hsl_to_rgb(accent_hue, gray_sat, 0.91); // Lightest
#if ENABLED(TOUCH_UI_ROYAL_THEME)
constexpr uint32_t theme_darkest = accent_color_1;
constexpr uint32_t theme_dark = accent_color_4;
constexpr uint32_t bg_color = gray_color_0;
constexpr uint32_t axis_label = gray_color_1;
constexpr uint32_t bg_text_enabled = accent_color_6;
constexpr uint32_t bg_text_disabled = gray_color_0;
constexpr uint32_t bg_normal = accent_color_4;
constexpr uint32_t fg_disabled = gray_color_0;
constexpr uint32_t fg_normal = accent_color_0;
constexpr uint32_t fg_action = accent_color_1;
constexpr uint32_t logo_bg_rgb = accent_color_1;
constexpr uint32_t logo_fill_rgb = accent_color_0;
constexpr uint32_t logo_stroke_rgb = accent_color_4;
#elif ANY(TOUCH_UI_COCOA_THEME, TOUCH_UI_FROZEN_THEME)
constexpr uint32_t theme_darkest = accent_color_1;
constexpr uint32_t theme_dark = accent_color_4;
constexpr uint32_t bg_color = 0xFFFFFF;
constexpr uint32_t axis_label = gray_color_5;
constexpr uint32_t bg_text_enabled = accent_color_1;
constexpr uint32_t bg_text_disabled = gray_color_1;
constexpr uint32_t bg_normal = accent_color_4;
constexpr uint32_t fg_disabled = gray_color_6;
constexpr uint32_t fg_normal = accent_color_1;
constexpr uint32_t fg_action = accent_color_4;
constexpr uint32_t logo_bg_rgb = accent_color_5;
constexpr uint32_t logo_fill_rgb = accent_color_6;
constexpr uint32_t logo_stroke_rgb = accent_color_2;
#else
constexpr uint32_t theme_darkest = gray_color_1;
constexpr uint32_t theme_dark = gray_color_2;
constexpr uint32_t bg_color = gray_color_1;
constexpr uint32_t axis_label = gray_color_2;
constexpr uint32_t bg_text_enabled = 0xFFFFFF;
constexpr uint32_t bg_text_disabled = gray_color_2;
constexpr uint32_t bg_normal = gray_color_1;
constexpr uint32_t fg_disabled = gray_color_1;
constexpr uint32_t fg_normal = gray_color_2;
constexpr uint32_t fg_action = accent_color_2;
constexpr uint32_t logo_bg_rgb = accent_color_4;
constexpr uint32_t logo_fill_rgb = accent_color_3;
constexpr uint32_t logo_stroke_rgb = 0x000000;
#endif
constexpr uint32_t shadow_rgb = gray_color_6;
constexpr uint32_t stroke_rgb = accent_color_1;
constexpr uint32_t fill_rgb = accent_color_3;
constexpr uint32_t syringe_rgb = accent_color_5;
#if ENABLED(TOUCH_UI_ROYAL_THEME)
constexpr uint32_t x_axis = hsl_to_rgb(0, 1.00, 0.26);
constexpr uint32_t y_axis = hsl_to_rgb(120, 1.00, 0.13);
constexpr uint32_t z_axis = hsl_to_rgb(240, 1.00, 0.10);
#else
constexpr uint32_t x_axis = hsl_to_rgb(0, 1.00, 0.5);
constexpr uint32_t y_axis = hsl_to_rgb(120, 1.00, 0.37);
constexpr uint32_t z_axis = hsl_to_rgb(240, 1.00, 0.37);
#endif
constexpr uint32_t e_axis = axis_label;
constexpr uint32_t feedrate = axis_label;
constexpr uint32_t other = axis_label;
// Status screen
constexpr uint32_t progress = axis_label;
constexpr uint32_t status_msg = axis_label;
#if ENABLED(TOUCH_UI_ROYAL_THEME)
constexpr uint32_t fan_speed = hsl_to_rgb(240, 0.5, 0.13);
constexpr uint32_t temp = hsl_to_rgb(343, 1.0, 0.23);
#else
constexpr uint32_t fan_speed = hsl_to_rgb(204, 0.47, 0.41);
constexpr uint32_t temp = hsl_to_rgb(311, 0.51, 0.35);
#endif
constexpr uint32_t disabled_icon = gray_color_1;
// Calibration Registers Screen
constexpr uint32_t transformA = 0x3010D0;
constexpr uint32_t transformB = 0x4010D0;
constexpr uint32_t transformC = 0x5010D0;
constexpr uint32_t transformD = 0x6010D0;
constexpr uint32_t transformE = 0x7010D0;
constexpr uint32_t transformF = 0x8010D0;
constexpr uint32_t transformVal = 0x104010;
constexpr btn_colors disabled_btn = {.bg = bg_color, .grad = fg_disabled, .fg = fg_disabled, .rgb = fg_disabled };
constexpr btn_colors normal_btn = {.bg = fg_action, .grad = 0xFFFFFF, .fg = fg_normal, .rgb = 0xFFFFFF };
constexpr btn_colors action_btn = {.bg = bg_color, .grad = 0xFFFFFF, .fg = fg_action, .rgb = 0xFFFFFF };
constexpr btn_colors red_btn = {.bg = 0xFF5555, .grad = 0xFFFFFF, .fg = 0xFF0000, .rgb = 0xFFFFFF };
constexpr btn_colors ui_slider = {.bg = theme_darkest, .grad = 0xFFFFFF, .fg = theme_dark, .rgb = accent_color_3 };
constexpr btn_colors ui_toggle = {.bg = theme_darkest, .grad = 0xFFFFFF, .fg = theme_dark, .rgb = 0xFFFFFF };
// Temperature color scale
const rgb_t cool_rgb ( 0, 0, 0);
const rgb_t low_rgb (128, 0, 0);
const rgb_t med_rgb (255, 128, 0);
const rgb_t high_rgb (255, 255, 128);
};

View File

@@ -1,152 +0,0 @@
/**
* 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
*/

View File

@@ -1,76 +0,0 @@
# Marlin 3D Printer Firmware
![GitHub](https://img.shields.io/github/license/marlinfirmware/marlin.svg)
![GitHub contributors](https://img.shields.io/github/contributors/marlinfirmware/marlin.svg)
![GitHub Release Date](https://img.shields.io/github/release-date/marlinfirmware/marlin.svg)
[![Build Status](https://github.com/MarlinFirmware/Marlin/workflows/CI/badge.svg?branch=bugfix-2.0.x)](https://github.com/MarlinFirmware/Marlin/actions)
<img align="right" width=175 src="buildroot/share/pixmaps/logo/marlin-250.png" />
Additional documentation can be found at the [Marlin Home Page](http://marlinfw.org/).
Please let us know if Marlin misbehaves in any way. Volunteers are standing by!
## Marlin 2.0
Marlin 2.0 takes this popular RepRap firmware to the next level by adding support for much faster 32-bit and ARM-based boards while improving support for 8-bit AVR boards. Read about Marlin's decision to use a "Hardware Abstraction Layer" below.
Download earlier versions of Marlin on the [Releases page](https://github.com/MarlinFirmware/Marlin/releases).
## Building Marlin 2.0
To build Marlin 2.0 you'll need [Arduino IDE 1.8.8 or newer](https://www.arduino.cc/en/main/software) or [PlatformIO](http://docs.platformio.org/en/latest/ide.html#platformio-ide). Detailed build and install instructions are posted at:
- [Installing Marlin (Arduino)](http://marlinfw.org/docs/basics/install_arduino.html)
- [Installing Marlin (VSCode)](http://marlinfw.org/docs/basics/install_platformio_vscode.html).
### Supported Platforms
Platform|MCU|Example Boards
--------|---|-------
[Arduino AVR](https://www.arduino.cc/)|ATmega|RAMPS, Melzi, RAMBo
[Teensy++ 2.0](http://www.microchip.com/wwwproducts/en/AT90USB1286)|AT90USB1286|Printrboard
[Arduino Due](https://www.arduino.cc/en/Guide/ArduinoDue)|SAM3X8E|RAMPS-FD, RADDS, RAMPS4DUE
[LPC1768](http://www.nxp.com/products/microcontrollers-and-processors/arm-based-processors-and-mcus/lpc-cortex-m-mcus/lpc1700-cortex-m3/512kb-flash-64kb-sram-ethernet-usb-lqfp100-package:LPC1768FBD100)|ARM® Cortex-M3|MKS SBASE, Re-ARM, Selena Compact
[LPC1769](https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/lpc1700-cortex-m3/512kb-flash-64kb-sram-ethernet-usb-lqfp100-package:LPC1769FBD100)|ARM® Cortex-M3|Smoothieboard, Azteeg X5 mini, TH3D EZBoard
[STM32F103](https://www.st.com/en/microcontrollers-microprocessors/stm32f103.html)|ARM® Cortex-M3|Malyan M200, GTM32 Pro, MKS Robin, BTT SKR Mini
[STM32F401](https://www.st.com/en/microcontrollers-microprocessors/stm32f401.html)|ARM® Cortex-M4|ARMED, Rumba32, SKR Pro, Lerdge, FYSETC S6
[STM32F7x6](https://www.st.com/en/microcontrollers-microprocessors/stm32f7x6.html)|ARM® Cortex-M7|The Borg, RemRam V1
[SAMD51P20A](https://www.adafruit.com/product/4064)|ARM® Cortex-M4|Adafruit Grand Central M4
[Teensy 3.5](https://www.pjrc.com/store/teensy35.html)|ARM® Cortex-M4|
[Teensy 3.6](https://www.pjrc.com/store/teensy36.html)|ARM® Cortex-M4|
## Submitting Changes
- Submit **Bug Fixes** as Pull Requests to the ([bugfix-2.0.x](https://github.com/MarlinFirmware/Marlin/tree/bugfix-2.0.x)) branch.
- Submit **New Features** to the ([dev-2.1.x](https://github.com/MarlinFirmware/Marlin/tree/dev-2.1.x)) branch.
- Follow the [Coding Standards](http://marlinfw.org/docs/development/coding_standards.html) to gain points with the maintainers.
- Please submit your questions and concerns to the [Issue Queue](https://github.com/MarlinFirmware/Marlin/issues).
## Marlin Support
For best results getting help with configuration and troubleshooting, please use the following resources:
- [Marlin Documentation](http://marlinfw.org) - Official Marlin documentation
- [Marlin Discord](https://discord.gg/n5NJ59y) - Discuss issues with Marlin users and developers
- Facebook Group ["Marlin Firmware"](https://www.facebook.com/groups/1049718498464482/)
- RepRap.org [Marlin Forum](http://forums.reprap.org/list.php?415)
- [Tom's 3D Forums](https://discuss.toms3d.org/)
- Facebook Group ["Marlin Firmware for 3D Printers"](https://www.facebook.com/groups/3Dtechtalk/)
- [Marlin Configuration](https://www.youtube.com/results?search_query=marlin+configuration) on YouTube
## Credits
The current Marlin dev team consists of:
- Scott Lahteine [[@thinkyhead](https://github.com/thinkyhead)] - USA &nbsp; [Donate](http://www.thinkyhead.com/donate-to-marlin) / Flattr: [![Flattr Scott](http://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=thinkyhead&url=https://github.com/MarlinFirmware/Marlin&title=Marlin&language=&tags=github&category=software)
- Roxanne Neufeld [[@Roxy-3D](https://github.com/Roxy-3D)] - USA
- Chris Pepper [[@p3p](https://github.com/p3p)] - UK
- Bob Kuhn [[@Bob-the-Kuhn](https://github.com/Bob-the-Kuhn)] - USA
- João Brazio [[@jbrazio](https://github.com/jbrazio)] - Portugal
- Erik van der Zalm [[@ErikZalm](https://github.com/ErikZalm)] - Netherlands &nbsp; [![Flattr Erik](http://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=ErikZalm&url=https://github.com/MarlinFirmware/Marlin&title=Marlin&language=&tags=github&category=software)
## License
Marlin is published under the [GPL license](/LICENSE) because we believe in open development. The GPL comes with both rights and obligations. Whether you use Marlin firmware as the driver for your open or closed-source product, you must keep Marlin open, and you must provide your compatible Marlin source code to end users upon request. The most straightforward way to comply with the Marlin license is to make a fork of Marlin on Github, perform your modifications, and direct users to your modified fork.
While we can't prevent the use of this code in products (3D printers, CNC, etc.) that are closed source or crippled by a patent, we would prefer that you choose another firmware or, better yet, make your own.

View File

@@ -1,72 +0,0 @@
#!/usr/bin/env bash
#
# Build tests for AVR ATmega2560 RAMBo
#
# exit on first failure
set -e
#
# Build with the default configurations
#
restore_configs
opt_set MOTHERBOARD BOARD_EINSY_RAMBO
opt_set X_DRIVER_TYPE TMC2130
opt_set Y_DRIVER_TYPE TMC2130
opt_set Z_DRIVER_TYPE TMC2130
opt_set E0_DRIVER_TYPE TMC2130
exec_test $1 $2 "Default Configuration"
#
# Full size Rambo Dual Endstop CNC
#
restore_configs
opt_set MOTHERBOARD BOARD_RAMBO
opt_set EXTRUDERS 0
opt_set TEMP_SENSOR_0 999
opt_set DUMMY_THERMISTOR_999_VALUE 170
opt_set DIGIPOT_MOTOR_CURRENT '{ 120, 120, 120, 120, 120 }'
opt_enable USE_XMAX_PLUG USE_YMAX_PLUG USE_ZMAX_PLUG \
REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER REVERSE_ENCODER_DIRECTION SDSUPPORT EEPROM_SETTINGS \
S_CURVE_ACCELERATION X_DUAL_STEPPER_DRIVERS X_DUAL_ENDSTOPS Y_DUAL_STEPPER_DRIVERS Y_DUAL_ENDSTOPS \
ADAPTIVE_STEP_SMOOTHING CNC_COORDINATE_SYSTEMS GCODE_MOTION_MODES
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

View File

@@ -1,3 +0,0 @@
# Where have all the configurations gone?
## https://github.com/MarlinFirmware/Configurations/archive/release-2.0.5.zip

View File

@@ -0,0 +1,31 @@
<!--
Have you read Marlin's Code of Conduct? By filing an Issue, you are expected to comply with it, including treating everyone with respect: https://github.com/MarlinFirmware/Marlin/blob/bugfix-2.0.x/.github/code_of_conduct.md
Do you want to ask a question? Are you looking for support? Please don't post here. Instead please use the Marlin Firmware forum at http://forums.reprap.org/list.php?415 or the Marlin Facebook Group https://www.facebook.com/groups/1049718498464482/ or the Marlin Discord Server https://discord.gg/n5NJ59y.
Before filing an issue be sure to test the 1.1 and/or 2.0 "bugfix" branches to see whether the issue is already addressed.
-->
### Description
<!-- Description of the bug or requested feature -->
### Steps to Reproduce
<!-- If this is a Bug Report, please describe the steps needed to reproduce the issue -->
1. [First Step]
2. [Second Step]
3. [and so on...]
**Expected behavior:** [What you expect to happen]
**Actual behavior:** [What actually happens]
#### Additional Information
* Include a ZIP file containing your `Configuration.h` and `Configuration_adv.h` files.
* Provide pictures or links to videos that clearly demonstrate the issue.
* See [How Can I Contribute](#how-can-i-contribute) for additional guidelines.

View File

@@ -71,7 +71,7 @@
// @section info // @section info
// Author info of this build printed to the host during boot and M115 // Author info of this build printed to the host during boot and M115
#define STRING_CONFIG_H_AUTHOR "(BIGTREETECH, Ender-3)" // Who made the changes. #define STRING_CONFIG_H_AUTHOR "(BIGTREETECH, SKR-mini-E3-V2.0)" // Who made the changes.
//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) //#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes)
/** /**
@@ -108,6 +108,7 @@
/** /**
* Select a secondary serial port on the board to use for communication with the host. * Select a secondary serial port on the board to use for communication with the host.
*
* :[-1, 0, 1, 2, 3, 4, 5, 6, 7] * :[-1, 0, 1, 2, 3, 4, 5, 6, 7]
*/ */
#define SERIAL_PORT_2 -1 #define SERIAL_PORT_2 -1
@@ -128,11 +129,11 @@
// Choose the name from boards.h that matches your setup // Choose the name from boards.h that matches your setup
#ifndef MOTHERBOARD #ifndef MOTHERBOARD
#define MOTHERBOARD BOARD_BTT_SKR_MINI_E3_V1_2 #define MOTHERBOARD BOARD_BTT_SKR_MINI_E3_V2_0
#endif #endif
// Name displayed in the LCD "Ready" message and Info menu // Name displayed in the LCD "Ready" message and Info menu
#define CUSTOM_MACHINE_NAME "Ender-3" #define CUSTOM_MACHINE_NAME "SKR-mini-E3-V2.0"
// Printer's unique ID, used by some programs to differentiate between machines. // Printer's unique ID, used by some programs to differentiate between machines.
// Choose your own or use a service like http://www.uuidgenerator.net/version4 // Choose your own or use a service like http://www.uuidgenerator.net/version4
@@ -323,7 +324,7 @@
//#define PSU_NAME "Power Supply" //#define PSU_NAME "Power Supply"
#if ENABLED(PSU_CONTROL) #if ENABLED(PSU_CONTROL)
#define PSU_ACTIVE_HIGH false // Set 'false' for ATX, 'true' for X-Box #define PSU_ACTIVE_HIGH true // Set 'false' for ATX, 'true' for X-Box
//#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80
//#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power //#define PSU_POWERUP_DELAY 100 // (ms) Delay for the PSU to warm up to full power
@@ -473,7 +474,7 @@
#if ENABLED(PIDTEMP) #if ENABLED(PIDTEMP)
//#define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM) //#define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM)
//#define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM) //#define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM)
//#define PID_DEBUG // Sends debug data to the serial port. Use 'M303 D' to toggle activation. //#define PID_DEBUG // Sends debug data to the serial port. Use M303 D to toggle activation.
//#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
//#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
//#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
@@ -482,7 +483,6 @@
// is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
// If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
// Creality Ender-3 // Creality Ender-3
#define DEFAULT_Kp 21.73 #define DEFAULT_Kp 21.73
#define DEFAULT_Ki 1.54 #define DEFAULT_Ki 1.54
@@ -525,9 +525,9 @@
//120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
//from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10) //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)
#define DEFAULT_bedKp 10.00 //#define DEFAULT_bedKp 10.00
#define DEFAULT_bedKi .023 //#define DEFAULT_bedKi .023
#define DEFAULT_bedKd 305.4 //#define DEFAULT_bedKd 305.4
//120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
//from pidautotune //from pidautotune
@@ -536,6 +536,9 @@
//#define DEFAULT_bedKd 1675.16 //#define DEFAULT_bedKd 1675.16
// FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles.
#define DEFAULT_bedKp 50.71
#define DEFAULT_bedKi 9.88
#define DEFAULT_bedKd 173.43
#endif // PIDTEMPBED #endif // PIDTEMPBED
// @section extruder // @section extruder
@@ -610,7 +613,7 @@
//#define USE_ZMAX_PLUG //#define USE_ZMAX_PLUG
// Enable pullup for all endstops to prevent a floating state // Enable pullup for all endstops to prevent a floating state
//#define ENDSTOPPULLUPS #define ENDSTOPPULLUPS
#if DISABLED(ENDSTOPPULLUPS) #if DISABLED(ENDSTOPPULLUPS)
// Disable ENDSTOPPULLUPS to set pullups individually // Disable ENDSTOPPULLUPS to set pullups individually
//#define ENDSTOPPULLUP_XMAX //#define ENDSTOPPULLUP_XMAX
@@ -791,7 +794,7 @@
* http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html * http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html
*/ */
#if DISABLED(CLASSIC_JERK) #if DISABLED(CLASSIC_JERK)
#define JUNCTION_DEVIATION_MM 0.08 // (mm) Distance from real junction edge #define JUNCTION_DEVIATION_MM 0.08 // (mm) Distance from real junction edge
#endif #endif
/** /**
@@ -818,7 +821,7 @@
* *
* Enable this option for a probe connected to the Z Min endstop pin. * Enable this option for a probe connected to the Z Min endstop pin.
*/ */
//#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
/** /**
* Z_MIN_PROBE_PIN * Z_MIN_PROBE_PIN
@@ -874,7 +877,7 @@
/** /**
* The BLTouch probe uses a Hall effect sensor and emulates a servo. * The BLTouch probe uses a Hall effect sensor and emulates a servo.
*/ */
//#define BLTOUCH #define BLTOUCH
/** /**
* Touch-MI Probe by hotends.fr * Touch-MI Probe by hotends.fr
@@ -946,11 +949,11 @@
* *
* Specify a Probe position as { X, Y, Z } * Specify a Probe position as { X, Y, Z }
*/ */
#define NOZZLE_TO_PROBE_OFFSET {-25,-20, -1.85 } #define NOZZLE_TO_PROBE_OFFSET { -40, -10, -2.0 }
// Most probes should stay away from the edges of the bed, but // Most probes should stay away from the edges of the bed, but
// with NOZZLE_AS_PROBE this can be negative for a wider probing area. // with NOZZLE_AS_PROBE this can be negative for a wider probing area.
#define MIN_PROBE_EDGE 20 #define MIN_PROBE_EDGE 10
// X and Y axis travel speed (mm/m) between probes // X and Y axis travel speed (mm/m) between probes
#define XY_PROBE_SPEED 8000 #define XY_PROBE_SPEED 8000
@@ -1133,7 +1136,7 @@
//#define FILAMENT_RUNOUT_SENSOR //#define FILAMENT_RUNOUT_SENSOR
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if ENABLED(FILAMENT_RUNOUT_SENSOR)
#define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each.
#define FIL_RUNOUT_INVERTING false // Set to true to invert the logic of the sensor. #define FIL_RUNOUT_INVERTING true // Set to true to invert the logic of the sensor.
#define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins.
//#define FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. //#define FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins.
@@ -1144,7 +1147,7 @@
// After a runout is detected, continue printing this length of filament // After a runout is detected, continue printing this length of filament
// before executing the runout script. Useful for a sensor at the end of // before executing the runout script. Useful for a sensor at the end of
// a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead. // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead.
//#define FILAMENT_RUNOUT_DISTANCE_MM 25 //#define FILAMENT_RUNOUT_DISTANCE_MM 7
#ifdef FILAMENT_RUNOUT_DISTANCE_MM #ifdef FILAMENT_RUNOUT_DISTANCE_MM
// Enable this option to use an encoder disc that toggles the runout pin // Enable this option to use an encoder disc that toggles the runout pin
@@ -1194,15 +1197,15 @@
*/ */
//#define AUTO_BED_LEVELING_3POINT //#define AUTO_BED_LEVELING_3POINT
//#define AUTO_BED_LEVELING_LINEAR //#define AUTO_BED_LEVELING_LINEAR
//#define AUTO_BED_LEVELING_BILINEAR #define AUTO_BED_LEVELING_BILINEAR
//#define AUTO_BED_LEVELING_UBL //#define AUTO_BED_LEVELING_UBL
#define MESH_BED_LEVELING //#define MESH_BED_LEVELING
/** /**
* Normally G28 leaves leveling disabled on completion. Enable * Normally G28 leaves leveling disabled on completion. Enable
* this option to have G28 restore the prior leveling state. * this option to have G28 restore the prior leveling state.
*/ */
#define RESTORE_LEVELING_AFTER_G28 //#define RESTORE_LEVELING_AFTER_G28
/** /**
* Enable detailed logging of G28, G29, M48, etc. * Enable detailed logging of G28, G29, M48, etc.
@@ -1241,7 +1244,7 @@
#if EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR) #if EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR)
// Set the number of grid points per dimension. // Set the number of grid points per dimension.
#define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_X 5
#define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X
// Probe along the Y axis, advancing X after each column // Probe along the Y axis, advancing X after each column
@@ -1301,7 +1304,7 @@
* Add a bed leveling sub-menu for ABL or MBL. * Add a bed leveling sub-menu for ABL or MBL.
* Include a guided procedure if manual probing is enabled. * Include a guided procedure if manual probing is enabled.
*/ */
#define LCD_BED_LEVELING //#define LCD_BED_LEVELING
#if ENABLED(LCD_BED_LEVELING) #if ENABLED(LCD_BED_LEVELING)
#define MESH_EDIT_Z_STEP 0.025 // (mm) Step size while manually probing Z axis. #define MESH_EDIT_Z_STEP 0.025 // (mm) Step size while manually probing Z axis.
@@ -1310,7 +1313,7 @@
#endif #endif
// Add a menu item to move between bed corners for manual bed adjustment // Add a menu item to move between bed corners for manual bed adjustment
#define LEVEL_BED_CORNERS //#define LEVEL_BED_CORNERS
#if ENABLED(LEVEL_BED_CORNERS) #if ENABLED(LEVEL_BED_CORNERS)
#define LEVEL_CORNERS_INSET_LFRB { 30, 30, 30, 30 } // (mm) Left, Front, Right, Back insets #define LEVEL_CORNERS_INSET_LFRB { 30, 30, 30, 30 } // (mm) Left, Front, Right, Back insets
@@ -1346,7 +1349,7 @@
// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). // - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28).
// - Prevent Z homing when the Z probe is outside bed area. // - Prevent Z homing when the Z probe is outside bed area.
// //
//#define Z_SAFE_HOMING #define Z_SAFE_HOMING
#if ENABLED(Z_SAFE_HOMING) #if ENABLED(Z_SAFE_HOMING)
#define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28). #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28).
@@ -1354,7 +1357,7 @@
#endif #endif
// Homing speeds (mm/m) // Homing speeds (mm/m)
#define HOMING_FEEDRATE_XY (20*60) #define HOMING_FEEDRATE_XY (50*60)
#define HOMING_FEEDRATE_Z (4*60) #define HOMING_FEEDRATE_Z (4*60)
// Validate that endstops are triggered on homing moves // Validate that endstops are triggered on homing moves
@@ -1432,7 +1435,7 @@
* M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes) * M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes)
* M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.) * M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.)
*/ */
#define EEPROM_SETTINGS // Persistent storage with M500 and M501 #define EEPROM_SETTINGS // Persistent storage with M500 and M501
//#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! //#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release!
#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. #define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM.
#define EEPROM_BOOT_SILENT // Keep M503 quiet and only give errors during first load #define EEPROM_BOOT_SILENT // Keep M503 quiet and only give errors during first load
@@ -1446,9 +1449,9 @@
// When enabled Marlin will send a busy status message to the host // When enabled Marlin will send a busy status message to the host
// every couple of seconds when it can't accept commands. // every couple of seconds when it can't accept commands.
// //
#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages //#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages
#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113. //#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113.
#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating //#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating
// //
// G20/G21 Inch mode support // G20/G21 Inch mode support
@@ -1464,7 +1467,7 @@
// Preheat Constants // Preheat Constants
#define PREHEAT_1_LABEL "PLA" #define PREHEAT_1_LABEL "PLA"
#define PREHEAT_1_TEMP_HOTEND 180 #define PREHEAT_1_TEMP_HOTEND 185
#define PREHEAT_1_TEMP_BED 45 #define PREHEAT_1_TEMP_BED 45
#define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255 #define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255
@@ -1484,7 +1487,7 @@
* P1 Raise the nozzle always to Z-park height. * P1 Raise the nozzle always to Z-park height.
* P2 Raise the nozzle by Z-park amount, limited to Z_MAX_POS. * P2 Raise the nozzle by Z-park amount, limited to Z_MAX_POS.
*/ */
//#define NOZZLE_PARK_FEATURE #define NOZZLE_PARK_FEATURE
#if ENABLED(NOZZLE_PARK_FEATURE) #if ENABLED(NOZZLE_PARK_FEATURE)
// Specify a park position as { X, Y, Z_raise } // Specify a park position as { X, Y, Z_raise }
@@ -1588,7 +1591,7 @@
* *
* View the current statistics with M78. * View the current statistics with M78.
*/ */
#define PRINTCOUNTER //#define PRINTCOUNTER
//============================================================================= //=============================================================================
//============================= LCD and SD support ============================ //============================= LCD and SD support ============================
@@ -1663,7 +1666,7 @@
* *
* Use CRC checks and retries on the SD communication. * Use CRC checks and retries on the SD communication.
*/ */
#define SD_CHECK_AND_RETRY //#define SD_CHECK_AND_RETRY
/** /**
* LCD Menu Items * LCD Menu Items
@@ -1726,7 +1729,7 @@
// //
// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. // Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu.
// //
#define INDIVIDUAL_AXIS_HOMING_MENU //#define INDIVIDUAL_AXIS_HOMING_MENU
// //
// SPEAKER/BUZZER // SPEAKER/BUZZER
@@ -2190,13 +2193,13 @@
#endif #endif
// Support for Adafruit Neopixel LED driver // Support for Adafruit Neopixel LED driver
//#define NEOPIXEL_LED #define NEOPIXEL_LED
#if ENABLED(NEOPIXEL_LED) #if ENABLED(NEOPIXEL_LED)
#define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) #define NEOPIXEL_TYPE NEO_GRB // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h)
#define NEOPIXEL_PIN 4 // LED driving pin //#define NEOPIXEL_PIN 4 // LED driving pin
//#define NEOPIXEL2_TYPE NEOPIXEL_TYPE //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE
//#define NEOPIXEL2_PIN 5 //#define NEOPIXEL2_PIN 5
#define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used #define NEOPIXEL_PIXELS 10 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used
#define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once.
#define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255)
//#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup

View File

@@ -277,7 +277,7 @@
#endif #endif
// Extra options for the M114 "Current Position" report // Extra options for the M114 "Current Position" report
//#define M114_DETAIL // Use 'M114` for details to check planner calculations #define M114_DETAIL // Use 'M114` for details to check planner calculations
//#define M114_REALTIME // Real current position based on forward kinematics //#define M114_REALTIME // Real current position based on forward kinematics
//#define M114_LEGACY // M114 used to synchronize on every call. Enable if needed. //#define M114_LEGACY // M114 used to synchronize on every call. Enable if needed.
@@ -340,9 +340,8 @@
* *
* The fan turns on automatically whenever any driver is enabled and turns * The fan turns on automatically whenever any driver is enabled and turns
* off (or reduces to idle speed) shortly after drivers are turned off. * off (or reduces to idle speed) shortly after drivers are turned off.
*
*/ */
//#define USE_CONTROLLER_FAN #define USE_CONTROLLER_FAN
#if ENABLED(USE_CONTROLLER_FAN) #if ENABLED(USE_CONTROLLER_FAN)
//#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan //#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan
//#define CONTROLLER_FAN_USE_Z_ONLY // With this option only the Z axis is considered //#define CONTROLLER_FAN_USE_Z_ONLY // With this option only the Z axis is considered
@@ -350,7 +349,7 @@
#define CONTROLLERFAN_SPEED_ACTIVE 255 // (0-255) Active speed, used when any motor is enabled #define CONTROLLERFAN_SPEED_ACTIVE 255 // (0-255) Active speed, used when any motor is enabled
#define CONTROLLERFAN_SPEED_IDLE 0 // (0-255) Idle speed, used when motors are disabled #define CONTROLLERFAN_SPEED_IDLE 0 // (0-255) Idle speed, used when motors are disabled
#define CONTROLLERFAN_IDLE_TIME 60 // (seconds) Extra time to keep the fan running after disabling motors #define CONTROLLERFAN_IDLE_TIME 60 // (seconds) Extra time to keep the fan running after disabling motors
//#define CONTROLLER_FAN_EDITABLE // Enable M710 configurable settings #define CONTROLLER_FAN_EDITABLE // Enable M710 configurable settings
#if ENABLED(CONTROLLER_FAN_EDITABLE) #if ENABLED(CONTROLLER_FAN_EDITABLE)
#define CONTROLLER_FAN_MENU // Enable the Controller Fan submenu #define CONTROLLER_FAN_MENU // Enable the Controller Fan submenu
#endif #endif
@@ -595,7 +594,7 @@
#define Y_HOME_BUMP_MM 5 #define Y_HOME_BUMP_MM 5
#define Z_HOME_BUMP_MM 2 #define Z_HOME_BUMP_MM 2
#define HOMING_BUMP_DIVISOR { 2, 2, 4 } // Re-Bump Speed Divisor (Divides the Homing Feedrate) #define HOMING_BUMP_DIVISOR { 2, 2, 4 } // Re-Bump Speed Divisor (Divides the Homing Feedrate)
//#define QUICK_HOME // If homing includes X and Y, do a diagonal move initially #define QUICK_HOME // If homing includes X and Y, do a diagonal move initially
//#define HOMING_BACKOFF_MM { 2, 2, 2 } // (mm) Move away from the endstops after homing //#define HOMING_BACKOFF_MM { 2, 2, 2 } // (mm) Move away from the endstops after homing
// When G28 is called, this option will make Y home before X // When G28 is called, this option will make Y home before X
@@ -680,7 +679,7 @@
// Define probe X and Y positions for Z1, Z2 [, Z3 [, Z4]] // Define probe X and Y positions for Z1, Z2 [, Z3 [, Z4]]
// If not defined, probe limits will be used. // If not defined, probe limits will be used.
// Override with 'M422 S<index> X<pos> Y<pos>' // Override with 'M422 S<index> X<pos> Y<pos>'
#define Z_STEPPER_ALIGN_XY { { 10, 190 }, { 100, 10 }, { 190, 190 } } //#define Z_STEPPER_ALIGN_XY { { 10, 190 }, { 100, 10 }, { 190, 190 } }
/** /**
* Orientation for the automatically-calculated probe positions. * Orientation for the automatically-calculated probe positions.
@@ -715,14 +714,14 @@
// Define one position per Z stepper in stepper driver order. // Define one position per Z stepper in stepper driver order.
#define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } } #define Z_STEPPER_ALIGN_STEPPER_XY { { 210.7, 102.5 }, { 152.6, 220.0 }, { 94.5, 102.5 } }
#else #else
// Amplification factor. Used to scale the correction step up or down in case // Amplification factor. Used to scale the correction step up or down.
// the stepper (spindle) position is farther out than the test point. // In case the stepper (spindle) position is further out than the test point.
#define Z_STEPPER_ALIGN_AMP 1.0 // Use a value > 1.0 NOTE: This may cause instability! // Use a value > 1. NOTE: This may cause instability
#define Z_STEPPER_ALIGN_AMP 1.0
#endif #endif
// On a 300mm bed a 5% grade would give a misalignment of ~1.5cm
#define G34_MAX_GRADE 5 // (%) Maximum incline that G34 will handle #define G34_MAX_GRADE 5 // (%) Maximum incline that G34 will handle
#define Z_STEPPER_ALIGN_ITERATIONS 5 // Number of iterations to apply during alignment #define Z_STEPPER_ALIGN_ITERATIONS 3 // Number of iterations to apply during alignment
#define Z_STEPPER_ALIGN_ACC 0.02 // Stop iterating early if the accuracy is better than this #define Z_STEPPER_ALIGN_ACC 0.02 // Stop iterating early if the accuracy is better than this
#define RESTORE_LEVELING_AFTER_G34 // Restore leveling after G34 is done? #define RESTORE_LEVELING_AFTER_G34 // Restore leveling after G34 is done?
// After G34, re-home Z (G28 Z) or just calculate it from the last probe heights? // After G34, re-home Z (G28 Z) or just calculate it from the last probe heights?
@@ -760,6 +759,7 @@
// Minimum time that a segment needs to take if the buffer is emptied // Minimum time that a segment needs to take if the buffer is emptied
#define DEFAULT_MINSEGMENTTIME 20000 // (ms) #define DEFAULT_MINSEGMENTTIME 20000 // (ms)
// If defined the movements slow down when the look ahead buffer is only half full
// Slow down the machine if the look ahead buffer is (by default) half full. // Slow down the machine if the look ahead buffer is (by default) half full.
// Increase the slowdown divisor for larger buffer sizes. // Increase the slowdown divisor for larger buffer sizes.
#define SLOWDOWN #define SLOWDOWN
@@ -976,7 +976,7 @@
* LED Control Menu * LED Control Menu
* Add LED Control to the LCD menu * Add LED Control to the LCD menu
*/ */
//#define LED_CONTROL_MENU #define LED_CONTROL_MENU
#if ENABLED(LED_CONTROL_MENU) #if ENABLED(LED_CONTROL_MENU)
#define LED_COLOR_PRESETS // Enable the Preset Color menu option #define LED_COLOR_PRESETS // Enable the Preset Color menu option
#if ENABLED(LED_COLOR_PRESETS) #if ENABLED(LED_COLOR_PRESETS)
@@ -1049,10 +1049,6 @@
#define EVENT_GCODE_SD_STOP "G28XY" // G-code to run on Stop Print (e.g., "G28XY" or "G27") #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) * Continue after Power-Loss (Creality3D)
* *
@@ -1060,17 +1056,14 @@
* during SD printing. If the recovery file is found at boot time, present * during SD printing. If the recovery file is found at boot time, present
* an option on the LCD screen to continue the print from the last-known * an option on the LCD screen to continue the print from the last-known
* point in the file. * point in the file.
*
* If the machine reboots when resuming a print you may need to replace or
* reformat the SD card. (Bad sectors delay startup triggering the watchdog.)
*/ */
#define POWER_LOSS_RECOVERY #define POWER_LOSS_RECOVERY
#if ENABLED(POWER_LOSS_RECOVERY) #if ENABLED(POWER_LOSS_RECOVERY)
#define PLR_ENABLED_DEFAULT true // Power Loss Recovery enabled by default. (Set with 'M413 Sn' & M500) #define PLR_ENABLED_DEFAULT true // Power Loss Recovery enabled by default. (Set with 'M413 Sn' & M500)
//#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss
//#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS)
//#define POWER_LOSS_PIN PC12 // Pin to detect power loss. Set to -1 to disable default pin on boards without module. //#define POWER_LOSS_PIN 44 // Pin to detect power loss. Set to -1 to disable default pin on boards without module.
//#define POWER_LOSS_STATE LOW // State of pin indicating power loss //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss
//#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate
#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume #define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume
#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. #define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power.
@@ -1132,7 +1125,7 @@
* This feature must be enabled with "M540 S1" or from the LCD menu. * This feature must be enabled with "M540 S1" or from the LCD menu.
* To have any effect, endstops must be enabled during SD printing. * To have any effect, endstops must be enabled during SD printing.
*/ */
//#define SD_ABORT_ON_ENDSTOP_HIT #define SD_ABORT_ON_ENDSTOP_HIT
/** /**
* This option makes it easier to print the same SD Card file again. * This option makes it easier to print the same SD Card file again.
@@ -1197,16 +1190,18 @@
// Add an optimized binary file transfer mode, initiated with 'M28 B1' // Add an optimized binary file transfer mode, initiated with 'M28 B1'
//#define BINARY_FILE_TRANSFER //#define BINARY_FILE_TRANSFER
/** #if HAS_SDCARD_CONNECTION
* Set this option to one of the following (or the board's defaults apply): /**
* * Set this option to one of the following (or the board's defaults apply):
* LCD - Use the SD drive in the external LCD controller. *
* ONBOARD - Use the SD drive on the control board. (No SD_DETECT_PIN. M21 to init.) * LCD - Use the SD drive in the external LCD controller.
* CUSTOM_CABLE - Use a custom cable to access the SD (as defined in a pins file). * ONBOARD - Use the SD drive on the control board. (No SD_DETECT_PIN. M21 to init.)
* * CUSTOM_CABLE - Use a custom cable to access the SD (as defined in a pins file).
* :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ] *
*/ * :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ]
//#define SDCARD_CONNECTION ONBOARD */
#define SDCARD_CONNECTION ONBOARD
#endif
#endif // SDSUPPORT #endif // SDSUPPORT
@@ -1477,7 +1472,7 @@
#define BABYSTEP_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion. #define BABYSTEP_MULTIPLICATOR_Z 1 // Babysteps are very small. Increase for faster motion.
#define BABYSTEP_MULTIPLICATOR_XY 1 #define BABYSTEP_MULTIPLICATOR_XY 1
#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping.
#if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING)
#define DOUBLECLICK_MAX_INTERVAL 1250 // Maximum interval between clicks, in milliseconds. #define DOUBLECLICK_MAX_INTERVAL 1250 // Maximum interval between clicks, in milliseconds.
// Note: Extra time may be added to mitigate controller latency. // Note: Extra time may be added to mitigate controller latency.
@@ -1515,7 +1510,7 @@
* See http://marlinfw.org/docs/features/lin_advance.html for full instructions. * See http://marlinfw.org/docs/features/lin_advance.html for full instructions.
* Mention @Sebastianv650 on GitHub to alert the author of any issues. * Mention @Sebastianv650 on GitHub to alert the author of any issues.
*/ */
#define LIN_ADVANCE //#define LIN_ADVANCE
#if ENABLED(LIN_ADVANCE) #if ENABLED(LIN_ADVANCE)
//#define EXTRA_LIN_ADVANCE_K // Enable for second linear advance constants //#define EXTRA_LIN_ADVANCE_K // Enable for second linear advance constants
#define LIN_ADVANCE_K 0.0 // Unit: mm compression per 1mm/s extruder speed #define LIN_ADVANCE_K 0.0 // Unit: mm compression per 1mm/s extruder speed
@@ -1629,7 +1624,7 @@
// //
// G2/G3 Arc Support // G2/G3 Arc Support
// //
//#define ARC_SUPPORT // Disable this feature to save ~3226 bytes //#define ARC_SUPPORT // Disable this feature to save ~3226 bytes
#if ENABLED(ARC_SUPPORT) #if ENABLED(ARC_SUPPORT)
#define MM_PER_ARC_SEGMENT 1 // (mm) Length (or minimum length) of each arc segment #define MM_PER_ARC_SEGMENT 1 // (mm) Length (or minimum length) of each arc segment
//#define ARC_SEGMENTS_PER_R 1 // Max segment length, MM_PER = Min //#define ARC_SEGMENTS_PER_R 1 // Max segment length, MM_PER = Min
@@ -1716,16 +1711,16 @@
// The number of linear motions that can be in the plan at any give time. // The number of linear motions that can be in the plan at any give time.
// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2 (e.g. 8, 16, 32) because shifts and ors are used to do the ring-buffering. // THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2 (e.g. 8, 16, 32) because shifts and ors are used to do the ring-buffering.
#if ENABLED(SDSUPPORT) #if ENABLED(SDSUPPORT)
#define BLOCK_BUFFER_SIZE 16 // SD,LCD,Buttons take more memory, block buffer needs to be smaller #define BLOCK_BUFFER_SIZE 32 // SD,LCD,Buttons take more memory, block buffer needs to be smaller
#else #else
#define BLOCK_BUFFER_SIZE 16 // maximize block buffer #define BLOCK_BUFFER_SIZE 32 // maximize block buffer
#endif #endif
// @section serial // @section serial
// The ASCII buffer for serial input // The ASCII buffer for serial input
#define MAX_CMD_SIZE 96 #define MAX_CMD_SIZE 96
#define BUFSIZE 4 #define BUFSIZE 32
// Transmission to Host Buffer Size // Transmission to Host Buffer Size
// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. // To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0.
@@ -1734,7 +1729,7 @@
// For debug-echo: 128 bytes for the optimal speed. // For debug-echo: 128 bytes for the optimal speed.
// Other output doesn't need to be that speedy. // Other output doesn't need to be that speedy.
// :[0, 2, 4, 8, 16, 32, 64, 128, 256] // :[0, 2, 4, 8, 16, 32, 64, 128, 256]
#define TX_BUFFER_SIZE 0 #define TX_BUFFER_SIZE 32
// Host Receive Buffer Size // Host Receive Buffer Size
// Without XON/XOFF flow control (see SERIAL_XON_XOFF below) 32 bytes should be enough. // Without XON/XOFF flow control (see SERIAL_XON_XOFF below) 32 bytes should be enough.
@@ -1868,7 +1863,7 @@
* Requires NOZZLE_PARK_FEATURE. * Requires NOZZLE_PARK_FEATURE.
* This feature is required for the default FILAMENT_RUNOUT_SCRIPT. * This feature is required for the default FILAMENT_RUNOUT_SCRIPT.
*/ */
//#define ADVANCED_PAUSE_FEATURE #define ADVANCED_PAUSE_FEATURE
#if ENABLED(ADVANCED_PAUSE_FEATURE) #if ENABLED(ADVANCED_PAUSE_FEATURE)
#define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate. #define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate.
#define PAUSE_PARK_RETRACT_LENGTH 2 // (mm) Initial retract. #define PAUSE_PARK_RETRACT_LENGTH 2 // (mm) Initial retract.
@@ -1906,7 +1901,7 @@
#define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed. #define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed.
#define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change. #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change.
//#define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. #define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change.
//#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change
#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. #define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu.
@@ -2046,7 +2041,7 @@
#if AXIS_IS_TMC(X) #if AXIS_IS_TMC(X)
#define X_CURRENT 580 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_CURRENT 580 // (mA) RMS current. Multiply by 1.414 for peak current.
#define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing #define X_CURRENT_HOME 1000 // (mA) RMS current for sensorless homing
#define X_MICROSTEPS 16 // 0..256 #define X_MICROSTEPS 16 // 0..256
#define X_RSENSE 0.11 #define X_RSENSE 0.11
#define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ... #define X_CHAIN_POS -1 // <=0 : Not chained. 1 : MCU MOSI connected. 2 : Next in chain, ...
@@ -2062,7 +2057,7 @@
#if AXIS_IS_TMC(Y) #if AXIS_IS_TMC(Y)
#define Y_CURRENT 580 #define Y_CURRENT 580
#define Y_CURRENT_HOME Y_CURRENT #define Y_CURRENT_HOME 1000
#define Y_MICROSTEPS 16 #define Y_MICROSTEPS 16
#define Y_RSENSE 0.11 #define Y_RSENSE 0.11
#define Y_CHAIN_POS -1 #define Y_CHAIN_POS -1
@@ -2078,7 +2073,7 @@
#if AXIS_IS_TMC(Z) #if AXIS_IS_TMC(Z)
#define Z_CURRENT 580 #define Z_CURRENT 580
#define Z_CURRENT_HOME Z_CURRENT #define Z_CURRENT_HOME 1000
#define Z_MICROSTEPS 16 #define Z_MICROSTEPS 16
#define Z_RSENSE 0.11 #define Z_RSENSE 0.11
#define Z_CHAIN_POS -1 #define Z_CHAIN_POS -1
@@ -2207,14 +2202,14 @@
* on the same serial port, either here or in your board's pins file. * on the same serial port, either here or in your board's pins file.
*/ */
#define X_SLAVE_ADDRESS 0 #define X_SLAVE_ADDRESS 0
#define Y_SLAVE_ADDRESS 0 #define Y_SLAVE_ADDRESS 2
#define Z_SLAVE_ADDRESS 0 #define Z_SLAVE_ADDRESS 1
#define X2_SLAVE_ADDRESS 0 #define X2_SLAVE_ADDRESS 0
#define Y2_SLAVE_ADDRESS 0 #define Y2_SLAVE_ADDRESS 0
#define Z2_SLAVE_ADDRESS 0 #define Z2_SLAVE_ADDRESS 0
#define Z3_SLAVE_ADDRESS 0 #define Z3_SLAVE_ADDRESS 0
#define Z4_SLAVE_ADDRESS 0 #define Z4_SLAVE_ADDRESS 0
#define E0_SLAVE_ADDRESS 0 #define E0_SLAVE_ADDRESS 3
#define E1_SLAVE_ADDRESS 0 #define E1_SLAVE_ADDRESS 0
#define E2_SLAVE_ADDRESS 0 #define E2_SLAVE_ADDRESS 0
#define E3_SLAVE_ADDRESS 0 #define E3_SLAVE_ADDRESS 0
@@ -2288,7 +2283,7 @@
#define X2_HYBRID_THRESHOLD 100 #define X2_HYBRID_THRESHOLD 100
#define Y_HYBRID_THRESHOLD 100 #define Y_HYBRID_THRESHOLD 100
#define Y2_HYBRID_THRESHOLD 100 #define Y2_HYBRID_THRESHOLD 100
#define Z_HYBRID_THRESHOLD 3 #define Z_HYBRID_THRESHOLD 10
#define Z2_HYBRID_THRESHOLD 3 #define Z2_HYBRID_THRESHOLD 3
#define Z3_HYBRID_THRESHOLD 3 #define Z3_HYBRID_THRESHOLD 3
#define Z4_HYBRID_THRESHOLD 3 #define Z4_HYBRID_THRESHOLD 3
@@ -2328,12 +2323,12 @@
#if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING) #if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING)
// TMC2209: 0...255. TMC2130: -64...63 // TMC2209: 0...255. TMC2130: -64...63
#define X_STALL_SENSITIVITY 8 #define X_STALL_SENSITIVITY 75
#define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY
#define Y_STALL_SENSITIVITY 8 #define Y_STALL_SENSITIVITY 75
//#define Z_STALL_SENSITIVITY 8 #define Z_STALL_SENSITIVITY 65
//#define SPI_ENDSTOPS // TMC2130 only //#define SPI_ENDSTOPS // TMC2130 only
//#define IMPROVE_HOMING_RELIABILITY #define IMPROVE_HOMING_RELIABILITY
#endif #endif
/** /**
@@ -2346,7 +2341,7 @@
* Enable M122 debugging command for TMC stepper drivers. * Enable M122 debugging command for TMC stepper drivers.
* M122 S0/1 will enable continous reporting. * M122 S0/1 will enable continous reporting.
*/ */
#define TMC_DEBUG //#define TMC_DEBUG
/** /**
* You can set your own advanced settings by filling in predefined functions. * You can set your own advanced settings by filling in predefined functions.

View File

@@ -28,7 +28,7 @@
/** /**
* Marlin release version identifier * Marlin release version identifier
*/ */
//#define SHORT_BUILD_VERSION "2.0.5.3" //#define SHORT_BUILD_VERSION "bugfix-2.0.x"
/** /**
* Verbose version identifier which should contain a reference to the location * Verbose version identifier which should contain a reference to the location
@@ -41,7 +41,7 @@
* here we define this default string as the date where the latest release * here we define this default string as the date where the latest release
* version was tagged. * version was tagged.
*/ */
//#define STRING_DISTRIBUTION_DATE "2020-01-31" //#define STRING_DISTRIBUTION_DATE "2019-07-10"
/** /**
* Defines a generic printer name to be output to the LCD after booting Marlin. * Defines a generic printer name to be output to the LCD after booting Marlin.

View File

@@ -98,9 +98,9 @@
#define SET_INPUT(IO) _SET_INPUT(IO) #define SET_INPUT(IO) _SET_INPUT(IO)
#define SET_INPUT_PULLUP(IO) do{ _SET_INPUT(IO); _WRITE(IO, HIGH); }while(0) #define SET_INPUT_PULLUP(IO) do{ _SET_INPUT(IO); _WRITE(IO, HIGH); }while(0)
#define SET_INPUT_PULLDOWN SET_INPUT
#define SET_OUTPUT(IO) _SET_OUTPUT(IO) #define SET_OUTPUT(IO) _SET_OUTPUT(IO)
#define SET_PWM SET_OUTPUT
#define SET_PWM(IO) SET_OUTPUT(IO)
#define IS_INPUT(IO) _IS_INPUT(IO) #define IS_INPUT(IO) _IS_INPUT(IO)
#define IS_OUTPUT(IO) _IS_OUTPUT(IO) #define IS_OUTPUT(IO) _IS_OUTPUT(IO)

View File

@@ -25,7 +25,7 @@
#if EITHER(EEPROM_SETTINGS, SD_FIRMWARE_UPDATE) #if EITHER(EEPROM_SETTINGS, SD_FIRMWARE_UPDATE)
#include "../shared/eeprom_api.h" #include "../shared/persistent_store_api.h"
bool PersistentStore::access_start() { return true; } bool PersistentStore::access_start() { return true; }
bool PersistentStore::access_finish() { return true; } bool PersistentStore::access_finish() { return true; }

View File

@@ -57,7 +57,7 @@
#if ENABLED(FLASH_EEPROM_EMULATION) #if ENABLED(FLASH_EEPROM_EMULATION)
#include "../shared/Marduino.h" #include "../shared/Marduino.h"
#include "../shared/eeprom_api.h" #include "../shared/persistent_store_api.h"
#define EEPROMSize 4096 #define EEPROMSize 4096
#define PagesPerGroup 128 #define PagesPerGroup 128

View File

@@ -39,7 +39,7 @@
#include <stdint.h> #include <stdint.h>
// Define MYSERIAL0/1 before MarlinSerial includes! // Define MYSERIAL0/1 before MarlinSerial includes!
#if SERIAL_PORT == -1 || ENABLED(EMERGENCY_PARSER) #if SERIAL_PORT == -1
#define MYSERIAL0 customizedSerial1 #define MYSERIAL0 customizedSerial1
#elif SERIAL_PORT == 0 #elif SERIAL_PORT == 0
#define MYSERIAL0 Serial #define MYSERIAL0 Serial
@@ -56,7 +56,7 @@
#ifdef SERIAL_PORT_2 #ifdef SERIAL_PORT_2
#if SERIAL_PORT_2 == SERIAL_PORT #if SERIAL_PORT_2 == SERIAL_PORT
#error "SERIAL_PORT_2 must be different from SERIAL_PORT. Please update your configuration." #error "SERIAL_PORT_2 must be different from SERIAL_PORT. Please update your configuration."
#elif SERIAL_PORT_2 == -1 || ENABLED(EMERGENCY_PARSER) #elif SERIAL_PORT_2 == -1
#define MYSERIAL1 customizedSerial2 #define MYSERIAL1 customizedSerial2
#elif SERIAL_PORT_2 == 0 #elif SERIAL_PORT_2 == 0
#define MYSERIAL1 Serial #define MYSERIAL1 Serial
@@ -94,6 +94,7 @@
#endif #endif
#endif #endif
#include "MarlinSerial.h" #include "MarlinSerial.h"
#include "MarlinSerialUSB.h" #include "MarlinSerialUSB.h"

View File

@@ -629,13 +629,23 @@ void MarlinSerial<Cfg>::printFloat(double number, uint8_t digits) {
// If not using the USB port as serial port // If not using the USB port as serial port
#if SERIAL_PORT >= 0 #if SERIAL_PORT >= 0
template class MarlinSerial<MarlinSerialCfg<SERIAL_PORT>>; // Define
MarlinSerial<MarlinSerialCfg<SERIAL_PORT>> customizedSerial1; // Instantiate // Preinstantiate
template class MarlinSerial<MarlinSerialCfg<SERIAL_PORT>>;
// Instantiate
MarlinSerial<MarlinSerialCfg<SERIAL_PORT>> customizedSerial1;
#endif #endif
#if defined(SERIAL_PORT_2) && SERIAL_PORT_2 >= 0 #ifdef SERIAL_PORT_2
template class MarlinSerial<MarlinSerialCfg<SERIAL_PORT_2>>; // Define
MarlinSerial<MarlinSerialCfg<SERIAL_PORT_2>> customizedSerial2; // Instantiate // Preinstantiate
template class MarlinSerial<MarlinSerialCfg<SERIAL_PORT_2>>;
// Instantiate
MarlinSerial<MarlinSerialCfg<SERIAL_PORT_2>> customizedSerial2;
#endif #endif
#endif // ARDUINO_ARCH_SAM #endif // ARDUINO_ARCH_SAM

View File

@@ -172,9 +172,13 @@ struct MarlinSerialCfg {
}; };
#if SERIAL_PORT >= 0 #if SERIAL_PORT >= 0
extern MarlinSerial<MarlinSerialCfg<SERIAL_PORT>> customizedSerial1;
#endif
#if defined(SERIAL_PORT_2) && SERIAL_PORT_2 >= 0 extern MarlinSerial<MarlinSerialCfg<SERIAL_PORT>> customizedSerial1;
#endif // SERIAL_PORT >= 0
#ifdef SERIAL_PORT_2
extern MarlinSerial<MarlinSerialCfg<SERIAL_PORT_2>> customizedSerial2; extern MarlinSerial<MarlinSerialCfg<SERIAL_PORT_2>> customizedSerial2;
#endif #endif

View File

@@ -29,7 +29,7 @@
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
#if HAS_USB_SERIAL #if SERIAL_PORT == -1
#include "MarlinSerialUSB.h" #include "MarlinSerialUSB.h"
@@ -283,12 +283,8 @@ void MarlinSerialUSB::printFloat(double number, uint8_t digits) {
} }
// Preinstantiate // Preinstantiate
#if SERIAL_PORT == -1 MarlinSerialUSB customizedSerial1;
MarlinSerialUSB customizedSerial1;
#endif #endif // SERIAL_PORT == -1
#if SERIAL_PORT_2 == -1
MarlinSerialUSB customizedSerial2;
#endif
#endif // HAS_USB_SERIAL
#endif // ARDUINO_ARCH_SAM #endif // ARDUINO_ARCH_SAM

View File

@@ -28,7 +28,7 @@
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
#if HAS_USB_SERIAL #if SERIAL_PORT == -1
#include <WString.h> #include <WString.h>
@@ -88,12 +88,6 @@ private:
static void printFloat(double, uint8_t); static void printFloat(double, uint8_t);
}; };
#if SERIAL_PORT == -1 extern MarlinSerialUSB customizedSerial1;
extern MarlinSerialUSB customizedSerial1;
#endif
#if SERIAL_PORT_2 == -1 #endif // SERIAL_PORT == -1
extern MarlinSerialUSB customizedSerial2;
#endif
#endif // HAS_USB_SERIAL

View File

@@ -166,7 +166,7 @@
// Set pin as output (wrapper) - reads the pin and sets the output to that value // Set pin as output (wrapper) - reads the pin and sets the output to that value
#define SET_OUTPUT(IO) _SET_OUTPUT(IO) #define SET_OUTPUT(IO) _SET_OUTPUT(IO)
// Set pin as PWM // Set pin as PWM
#define SET_PWM SET_OUTPUT #define SET_PWM(IO) SET_OUTPUT(IO)
// Check if pin is an input // Check if pin is an input
#define IS_INPUT(IO) ((digitalPinToPort(IO)->PIO_OSR & digitalPinToBitMask(IO)) == 0) #define IS_INPUT(IO) ((digitalPinToPort(IO)->PIO_OSR & digitalPinToBitMask(IO)) == 0)

View File

@@ -0,0 +1,145 @@
/**
* 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/>.
*
*/
/**
* The PWM module is only used to generate interrupts at specified times. It
* is NOT used to directly toggle pins. The ISR writes to the pin assigned to
* that interrupt.
*
* All PWMs use the same repetition rate. The G2 needs about 10KHz min in order to
* not have obvious ripple on the Vref signals.
*
* The data structures are setup to minimize the computation done by the ISR which
* minimizes ISR execution time. Execution times are 0.8 to 1.1 microseconds.
*
* FIve PWM interrupt sources are used. Channel 0 sets the base period. All Vref
* signals are set active when this counter overflows and resets to zero. The compare
* values in channels 1-4 are set to give the desired duty cycle for that Vref pin.
* When counter 0 matches the compare value then that channel generates an interrupt.
* The ISR checks the source of the interrupt and sets the corresponding pin inactive.
*
* Some jitter in the Vref signal is OK so the interrupt priority is left at its default value.
*/
#include "../../../inc/MarlinConfig.h"
#if MB(PRINTRBOARD_G2)
#include "G2_PWM.h"
volatile uint32_t *SODR_A = &PIOA->PIO_SODR,
*SODR_B = &PIOB->PIO_SODR,
*CODR_A = &PIOA->PIO_CODR,
*CODR_B = &PIOB->PIO_CODR;
PWM_map ISR_table[NUM_PWMS] = PWM_MAP_INIT;
void Stepper::digipot_init() {
OUT_WRITE(MOTOR_CURRENT_PWM_X_PIN, 0); // init pins
OUT_WRITE(MOTOR_CURRENT_PWM_Y_PIN, 0);
OUT_WRITE(MOTOR_CURRENT_PWM_Z_PIN, 0);
OUT_WRITE(MOTOR_CURRENT_PWM_E_PIN, 0);
#define WPKEY (0x50574D << 8) // “PWM” in ASCII
#define WPCMD_DIS_SW 0 // command to disable Write Protect SW
#define WPRG_ALL (PWM_WPCR_WPRG0 | PWM_WPCR_WPRG1 | PWM_WPCR_WPRG2 | PWM_WPCR_WPRG3 | PWM_WPCR_WPRG4 | PWM_WPCR_WPRG5) // all Write Protect Groups
#define PWM_CLOCK_F F_CPU / 1000000UL // set clock to 1MHz
PMC->PMC_PCER1 = PMC_PCER1_PID36; // enable PWM controller clock (disabled on power up)
PWM->PWM_WPCR = WPKEY | WPRG_ALL | WPCMD_DIS_SW; // enable setting of all PWM registers
PWM->PWM_CLK = PWM_CLOCK_F; // enable CLK_A and set it to 1MHz, leave CLK_B disabled
PWM->PWM_CH_NUM[0].PWM_CMR = 0b1011; // set channel 0 to Clock A input & to left aligned
PWM->PWM_CH_NUM[1].PWM_CMR = 0b1011; // set channel 1 to Clock A input & to left aligned
PWM->PWM_CH_NUM[2].PWM_CMR = 0b1011; // set channel 2 to Clock A input & to left aligned
PWM->PWM_CH_NUM[3].PWM_CMR = 0b1011; // set channel 3 to Clock A input & to left aligned
PWM->PWM_CH_NUM[4].PWM_CMR = 0b1011; // set channel 4 to Clock A input & to left aligned
PWM->PWM_CH_NUM[0].PWM_CPRD = PWM_PERIOD_US; // set channel 0 Period
PWM->PWM_IER2 = PWM_IER1_CHID0; // generate interrupt when counter0 overflows
PWM->PWM_IER2 = PWM_IER2_CMPM0 | PWM_IER2_CMPM1 | PWM_IER2_CMPM2 | PWM_IER2_CMPM3 | PWM_IER2_CMPM4; // generate interrupt on compare event
PWM->PWM_CMP[1].PWM_CMPV = 0x010000000LL | G2_VREF_COUNT(G2_VREF(motor_current_setting[0])); // interrupt when counter0 == CMPV - used to set Motor 1 PWM inactive
PWM->PWM_CMP[2].PWM_CMPV = 0x010000000LL | G2_VREF_COUNT(G2_VREF(motor_current_setting[0])); // interrupt when counter0 == CMPV - used to set Motor 2 PWM inactive
PWM->PWM_CMP[3].PWM_CMPV = 0x010000000LL | G2_VREF_COUNT(G2_VREF(motor_current_setting[1])); // interrupt when counter0 == CMPV - used to set Motor 3 PWM inactive
PWM->PWM_CMP[4].PWM_CMPV = 0x010000000LL | G2_VREF_COUNT(G2_VREF(motor_current_setting[2])); // interrupt when counter0 == CMPV - used to set Motor 4 PWM inactive
PWM->PWM_CMP[1].PWM_CMPM = 0x0001; // enable compare event
PWM->PWM_CMP[2].PWM_CMPM = 0x0001; // enable compare event
PWM->PWM_CMP[3].PWM_CMPM = 0x0001; // enable compare event
PWM->PWM_CMP[4].PWM_CMPM = 0x0001; // enable compare event
PWM->PWM_SCM = PWM_SCM_UPDM_MODE0 | PWM_SCM_SYNC0 | PWM_SCM_SYNC1 | PWM_SCM_SYNC2 | PWM_SCM_SYNC3 | PWM_SCM_SYNC4; // sync 1-4 with 0, use mode 0 for updates
PWM->PWM_ENA = PWM_ENA_CHID0 | PWM_ENA_CHID1 | PWM_ENA_CHID2 | PWM_ENA_CHID3 | PWM_ENA_CHID4; // enable the channels used by G2
PWM->PWM_IER1 = PWM_IER1_CHID0 | PWM_IER1_CHID1 | PWM_IER1_CHID2 | PWM_IER1_CHID3 | PWM_IER1_CHID4; // enable interrupts for the channels used by G2
NVIC_EnableIRQ(PWM_IRQn); // Enable interrupt handler
NVIC_SetPriority(PWM_IRQn, NVIC_EncodePriority(0, 10, 0)); // normal priority for PWM module (can stand some jitter on the Vref signals)
}
void Stepper::digipot_current(const uint8_t driver, const int16_t current) {
if (!(PWM->PWM_CH_NUM[0].PWM_CPRD == PWM_PERIOD_US)) digipot_init(); // Init PWM system if needed
switch (driver) {
case 0: PWM->PWM_CMP[1].PWM_CMPVUPD = 0x010000000LL | G2_VREF_COUNT(G2_VREF(current)); // update X & Y
PWM->PWM_CMP[2].PWM_CMPVUPD = 0x010000000LL | G2_VREF_COUNT(G2_VREF(current));
PWM->PWM_CMP[1].PWM_CMPMUPD = 0x0001; // enable compare event
PWM->PWM_CMP[2].PWM_CMPMUPD = 0x0001; // enable compare event
PWM->PWM_SCUC = PWM_SCUC_UPDULOCK; // tell the PWM controller to update the values on the next cycle
break;
case 1: PWM->PWM_CMP[3].PWM_CMPVUPD = 0x010000000LL | G2_VREF_COUNT(G2_VREF(current)); // update Z
PWM->PWM_CMP[3].PWM_CMPMUPD = 0x0001; // enable compare event
PWM->PWM_SCUC = PWM_SCUC_UPDULOCK; // tell the PWM controller to update the values on the next cycle
break;
default:PWM->PWM_CMP[4].PWM_CMPVUPD = 0x010000000LL | G2_VREF_COUNT(G2_VREF(current)); // update E
PWM->PWM_CMP[4].PWM_CMPMUPD = 0x0001; // enable compare event
PWM->PWM_SCUC = PWM_SCUC_UPDULOCK; // tell the PWM controller to update the values on the next cycle
break;
}
}
volatile uint32_t PWM_ISR1_STATUS, PWM_ISR2_STATUS;
void PWM_Handler() {
PWM_ISR1_STATUS = PWM->PWM_ISR1;
PWM_ISR2_STATUS = PWM->PWM_ISR2;
if (PWM_ISR1_STATUS & PWM_IER1_CHID0) { // CHAN_0 interrupt
*ISR_table[0].set_register = ISR_table[0].write_mask; // set X to active
*ISR_table[1].set_register = ISR_table[1].write_mask; // set Y to active
*ISR_table[2].set_register = ISR_table[2].write_mask; // set Z to active
*ISR_table[3].set_register = ISR_table[3].write_mask; // set E to active
}
else {
if (PWM_ISR2_STATUS & PWM_IER2_CMPM1) *ISR_table[0].clr_register = ISR_table[0].write_mask; // set X to inactive
if (PWM_ISR2_STATUS & PWM_IER2_CMPM2) *ISR_table[1].clr_register = ISR_table[1].write_mask; // set Y to inactive
if (PWM_ISR2_STATUS & PWM_IER2_CMPM3) *ISR_table[2].clr_register = ISR_table[2].write_mask; // set Z to inactive
if (PWM_ISR2_STATUS & PWM_IER2_CMPM4) *ISR_table[3].clr_register = ISR_table[3].write_mask; // set E to inactive
}
return;
}
#endif // PRINTRBOARD_G2

View File

@@ -21,7 +21,7 @@
*/ */
#pragma once #pragma once
#if USE_FALLBACK_EEPROM #if USE_EMULATED_EEPROM
#undef SRAM_EEPROM_EMULATION #undef SRAM_EEPROM_EMULATION
#undef SDCARD_EEPROM_EMULATION #undef SDCARD_EEPROM_EMULATION
#define FLASH_EEPROM_EMULATION #define FLASH_EEPROM_EMULATION

View File

@@ -27,7 +27,7 @@
#if ENABLED(EEPROM_SETTINGS) #if ENABLED(EEPROM_SETTINGS)
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
#include "../shared/eeprom_api.h" #include "../shared/persistent_store_api.h"
#if !defined(E2END) && ENABLED(FLASH_EEPROM_EMULATION) #if !defined(E2END) && ENABLED(FLASH_EEPROM_EMULATION)
#define E2END 0xFFF // Default to Flash emulated EEPROM size (EepromEmulation_Due.cpp) #define E2END 0xFFF // Default to Flash emulated EEPROM size (EepromEmulation_Due.cpp)

Some files were not shown because too many files have changed in this diff Show More