Merge remote-tracking branch 'upstream/bugfix-2.0.x' into bugfix-2.0.x

This commit is contained in:
Foxies 2020-10-31 16:52:35 +01:00
commit 16569bcb7a
66 changed files with 465 additions and 161 deletions

2
.gitattributes vendored
View file

@ -17,3 +17,5 @@
*.png binary
*.jpg binary
*.fon binary
*.bin binary
*.woff binary

View file

@ -59,7 +59,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
return false;
}
bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
do {
uint8_t c = eeprom_read_byte((uint8_t*)pos);
if (writing) *value = c;

View file

@ -996,7 +996,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
return false;
}
bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
do {
uint8_t c = ee_Read(uint32_t(pos));
if (writing) *value = c;

View file

@ -62,7 +62,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
return false;
}
bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
do {
uint8_t c = eeprom_read_byte((uint8_t*)pos);
if (writing) *value = c;

View file

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

View file

@ -78,7 +78,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
return (bytes_written != size); // return true for any error
}
bool PersistentStore::read_data(int &pos, uint8_t* value, const size_t size, uint16_t *crc, const bool writing/*=true*/) {
bool PersistentStore::read_data(int &pos, uint8_t *value, const size_t size, uint16_t *crc, const bool writing/*=true*/) {
std::size_t bytes_read = 0;
if (writing) {
for (std::size_t i = 0; i < size; i++) {

View file

@ -26,15 +26,15 @@
*/
#define NUMBER_PINS_TOTAL NUM_DIGITAL_PINS
#define pwm_details(pin) pin = pin // do nothing // print PWM details
#define pwm_status(pin) false //Print a pin's PWM status. Return true if it's currently a PWM pin.
#define IS_ANALOG(P) (DIGITAL_PIN_TO_ANALOG_PIN(P) >= 0 ? 1 : 0)
#define pwm_details(pin) NOOP // (do nothing)
#define pwm_status(pin) false // Print a pin's PWM status. Return true if it's currently a PWM pin.
#define IS_ANALOG(P) (DIGITAL_PIN_TO_ANALOG_PIN(P) >= 0 ? 1 : 0)
#define digitalRead_mod(p) digitalRead(p)
#define PRINT_PORT(p)
#define GET_ARRAY_PIN(p) pin_array[p].pin
#define GET_ARRAY_PIN(p) pin_array[p].pin
#define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%3d "), p); SERIAL_ECHO(buffer); }while(0)
#define MULTI_NAME_PAD 16 // space needed to be pretty if not first name assigned to a pin
#define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%3d "), p); SERIAL_ECHO(buffer); }while(0)
#define MULTI_NAME_PAD 16 // space needed to be pretty if not first name assigned to a pin
// active ADC function/mode/code values for PINSEL registers
constexpr int8_t ADC_pin_mode(pin_t pin) {

View file

@ -263,8 +263,9 @@ uint16_t SPIClass::transfer16(const uint16_t data) {
}
void SPIClass::end() {
// SSP_Cmd(_currentSetting->spi_d, DISABLE); // stop device or SSP_DeInit?
SSP_DeInit(_currentSetting->spi_d);
// Neither is needed for Marlin
//SSP_Cmd(_currentSetting->spi_d, DISABLE);
//SSP_DeInit(_currentSetting->spi_d);
}
void SPIClass::send(uint8_t data) {

View file

@ -119,7 +119,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
return false; // return true for any error
}
bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
const uint8_t * const buff = writing ? &value[0] : &ram_eeprom[pos];
if (writing) for (size_t i = 0; i < size; i++) value[i] = ram_eeprom[pos + i];
crc16(crc, buff, size);

View file

@ -143,7 +143,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
return bytes_written != size; // return true for any error
}
bool PersistentStore::read_data(int &pos, uint8_t* value, const size_t size, uint16_t *crc, const bool writing/*=true*/) {
bool PersistentStore::read_data(int &pos, uint8_t *value, const size_t size, uint16_t *crc, const bool writing/*=true*/) {
if (!eeprom_file_open) return true;
UINT bytes_read = 0;
FRESULT s;

View file

@ -64,7 +64,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
return false;
}
bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
do {
// Read from external EEPROM
const uint8_t c = eeprom_read_byte((uint8_t*)pos);

View file

@ -79,7 +79,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
return false;
}
bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
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];

View file

@ -56,7 +56,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
return false;
}
bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
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;

View file

@ -59,7 +59,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
return false;
}
bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
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;

View file

@ -261,7 +261,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
return false;
}
bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
do {
const uint8_t c = TERN(FLASH_EEPROM_LEVELING, ram_eeprom[pos], eeprom_buffered_read_byte(pos));
if (writing) *value = c;

View file

@ -78,7 +78,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
return false;
}
bool PersistentStore::read_data(int &pos, uint8_t* value, const size_t size, uint16_t *crc, const bool writing/*=true*/) {
bool PersistentStore::read_data(int &pos, uint8_t *value, const size_t size, uint16_t *crc, const bool writing/*=true*/) {
for (size_t i = 0; i < size; i++) {
uint8_t c = HAL_eeprom_data[pos + i];
if (writing) value[i] = c;

View file

@ -52,7 +52,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
return false;
}
bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
do {
// Read from either external EEPROM, program flash or Backup SRAM
const uint8_t c = ( *(__IO uint8_t *)(BKPSRAM_BASE + ((uint8_t*)pos)) );

View file

@ -65,7 +65,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
return false;
}
bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
do {
// Read from either external EEPROM, program flash or Backup SRAM
const uint8_t c = eeprom_read_byte((uint8_t*)pos);

View file

@ -244,3 +244,20 @@ void analogWrite(pin_t pin, int pwm_val8); // PWM only! mul by 257 in maple!?
#define PLATFORM_M997_SUPPORT
void flashFirmware(const int16_t);
#define HAL_CAN_SET_PWM_FREQ // This HAL supports PWM Frequency adjustment
/**
* set_pwm_frequency
* Set the frequency of the timer corresponding to the provided pin
* All Timer PWM pins run at the same frequency
*/
void set_pwm_frequency(const pin_t pin, int f_desired);
/**
* set_pwm_duty
* Set the PWM duty cycle of the provided pin to the provided value
* Optionally allows inverting the duty cycle [default = false]
* Optionally allows changing the maximum size of the provided value to enable finer PWM duty control [default = 255]
*/
void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size=255, const bool invert=false);

View file

@ -68,7 +68,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
return false;
}
bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
do {
uint8_t * const p = (uint8_t * const)pos;
uint8_t c = eeprom_read_byte(p);

View file

@ -101,7 +101,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
return false; // return true for any error
}
bool PersistentStore::read_data(int &pos, uint8_t* value, const size_t size, uint16_t *crc, const bool writing/*=true*/) {
bool PersistentStore::read_data(int &pos, uint8_t *value, const size_t size, uint16_t *crc, const bool writing/*=true*/) {
const uint8_t * const buff = writing ? &value[0] : &ram_eeprom[pos];
if (writing) for (size_t i = 0; i < size; i++) value[i] = ram_eeprom[pos + i];
crc16(crc, buff, size);

View file

@ -79,7 +79,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
return false;
}
bool PersistentStore::read_data(int &pos, uint8_t* value, const size_t size, uint16_t *crc, const bool writing/*=true*/) {
bool PersistentStore::read_data(int &pos, uint8_t *value, const size_t size, uint16_t *crc, const bool writing/*=true*/) {
for (size_t i = 0; i < size; i++) {
uint8_t c = HAL_eeprom_data[pos + i];
if (writing) value[i] = c;

View file

@ -72,7 +72,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
return false;
}
bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
do {
uint8_t c = eeprom_read_byte((uint8_t*)pos);
if (writing && value) *value = c;

View file

@ -0,0 +1,68 @@
/**
* 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 <https://www.gnu.org/licenses/>.
*
*/
#ifdef __STM32F1__
#include "../../inc/MarlinConfigPre.h"
#if NEEDS_HARDWARE_PWM
#include <pwm.h>
#include "HAL.h"
#include "timers.h"
void set_pwm_frequency(const pin_t pin, int f_desired) {
if (!PWM_PIN(pin)) return; // Don't proceed if no hardware timer
timer_dev *timer = PIN_MAP[pin].timer_device;
uint8_t channel = PIN_MAP[pin].timer_channel;
// Protect used timers
if (timer == get_timer_dev(TEMP_TIMER_NUM)) return;
if (timer == get_timer_dev(STEP_TIMER_NUM)) return;
#if PULSE_TIMER_NUM != STEP_TIMER_NUM
if (timer == get_timer_dev(PULSE_TIMER_NUM)) return;
#endif
if (!(timer->regs.bas->SR & TIMER_CR1_CEN)) // Ensure the timer is enabled
timer_init(timer);
timer_set_mode(timer, channel, TIMER_PWM);
uint16_t preload = 255; // Lock 255 PWM resolution for high frequencies
int32_t prescaler = (HAL_TIMER_RATE) / (preload + 1) / f_desired - 1;
if (prescaler > 65535) { // For low frequencies increase prescaler
prescaler = 65535;
preload = (HAL_TIMER_RATE) / (prescaler + 1) / f_desired - 1;
}
if (prescaler < 0) return; // Too high frequency
timer_set_reload(timer, preload);
timer_set_prescaler(timer, prescaler);
}
void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255*/, const bool invert/*=false*/) {
timer_dev *timer = PIN_MAP[pin].timer_device;
uint16_t max_val = timer->regs.bas->ARR * v / v_size;
if (invert) max_val = v_size - max_val;
pwmWrite(pin, max_val);
}
#endif // NEEDS_HARDWARE_PWM
#endif // __STM32F1__

View file

@ -25,10 +25,6 @@
* Test STM32F1-specific configuration values for errors at compile-time.
*/
#if ENABLED(FAST_PWM_FAN) || SPINDLE_LASER_FREQUENCY
#error "Features requiring Hardware PWM (FAST_PWM_FAN, SPINDLE_LASER_FREQUENCY) are not yet supported on STM32F1."
#endif
#if !defined(HAVE_SW_SERIAL) && HAS_TMC_SW_SERIAL
#warning "With TMC2208/9 consider using SoftwareSerialM with HAVE_SW_SERIAL and appropriate SS_TIMER."
#error "Missing SoftwareSerial implementation."

View file

@ -96,7 +96,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
return false;
}
bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
do {
uint8_t c = ee_read_byte((uint8_t*)pos);
if (writing) *value = c;

View file

@ -62,7 +62,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
return false;
}
bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
do {
uint8_t c = eeprom_read_byte((uint8_t*)pos);
if (writing) *value = c;

View file

@ -57,7 +57,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
return false;
}
bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
do {
uint8_t c = eeprom_read_byte((uint8_t*)pos);
if (writing) *value = c;

View file

@ -61,7 +61,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
return false;
}
bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
do {
uint8_t c = eeprom_read_byte((uint8_t*)pos);
if (writing) *value = c;

View file

@ -61,7 +61,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
return false;
}
bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
do {
uint8_t c = eeprom_read_byte((uint8_t*)pos);
if (writing) *value = c;

View file

@ -7,7 +7,7 @@
* for free and use it as they wish, with or without modifications, and in
* any context, commercially or otherwise. The only limitation is that I
* don't guarantee that the software is fit for any purpose or accept any
* liability for it's use or misuse - this software is without warranty.
* liability for its use or misuse - this software is without warranty.
***************************************************************************
* File Description: Utility functions and glue for ARM unwinding sub-modules.
**************************************************************************/

View file

@ -6,7 +6,7 @@
* for free and use it as they wish, with or without modifications, and in
* any context, commerically or otherwise. The only limitation is that I
* don't guarantee that the software is fit for any purpose or accept any
* liablity for it's use or misuse - this software is without warranty.
* liability for its use or misuse - this software is without warranty.
***************************************************************************
* File Description: Internal interface between the ARM unwinding sub-modules.
**************************************************************************/

View file

@ -7,7 +7,7 @@
* for free and use it as they wish, with or without modifications, and in
* any context, commercially or otherwise. The only limitation is that I
* don't guarantee that the software is fit for any purpose or accept any
* liability for it's use or misuse - this software is without warranty.
* liability for its use or misuse - this software is without warranty.
***************************************************************************
* File Description: Abstract interpreter for ARM mode.
**************************************************************************/

View file

@ -7,7 +7,7 @@
* for free and use it as they wish, with or without modifications, and in
* any context, commercially or otherwise. The only limitation is that I
* don't guarantee that the software is fit for any purpose or accept any
* liability for it's use or misuse - this software is without warranty.
* liability for its use or misuse - this software is without warranty.
***************************************************************************
* File Description: Abstract interpretation for Thumb mode.
**************************************************************************/

View file

@ -7,7 +7,7 @@
* for free and use it as they wish, with or without modifications, and in
* any context, commerically or otherwise. The only limitation is that I
* don't guarantee that the software is fit for any purpose or accept any
* liablity for it's use or misuse - this software is without warranty.
* liability for its use or misuse - this software is without warranty.
***************************************************************************
* File Description: Interface to the memory tracking sub-system.
**************************************************************************/

View file

@ -7,7 +7,7 @@
* for free and use it as they wish, with or without modifications, and in
* any context, commerically or otherwise. The only limitation is that I
* don't guarantee that the software is fit for any purpose or accept any
* liablity for it's use or misuse - this software is without warranty.
* liability for its use or misuse - this software is without warranty.
***************************************************************************
* File Description: Implementation of the memory tracking sub-system.
**************************************************************************/

View file

@ -7,7 +7,7 @@
* for free and use it as they wish, with or without modifications, and in
* any context, commerically or otherwise. The only limitation is that I
* don't guarantee that the software is fit for any purpose or accept any
* liablity for it's use or misuse - this software is without warranty.
* liability for its use or misuse - this software is without warranty.
***************************************************************************
* File Description: Interface to the memory tracking sub-system.
**************************************************************************/

View file

@ -7,7 +7,7 @@
* for free and use it as they wish, with or without modifications, and in
* any context, commercially or otherwise. The only limitation is that I
* don't guarantee that the software is fit for any purpose or accept any
* liability for it's use or misuse - this software is without warranty.
* liability for its use or misuse - this software is without warranty.
***************************************************************************
* File Description: Implementation of the interface into the ARM unwinder.
**************************************************************************/

View file

@ -7,7 +7,7 @@
* for free and use it as they wish, with or without modifications, and in
* any context, commerically or otherwise. The only limitation is that I
* don't guarantee that the software is fit for any purpose or accept any
* liablity for it's use or misuse - this software is without warranty.
* liability for its use or misuse - this software is without warranty.
**************************************************************************/
/** \file
* Interface to the ARM stack unwinding module.

View file

@ -7,7 +7,7 @@
* for free and use it as they wish, with or without modifications, and in
* any context, commercially or otherwise. The only limitation is that I
* don't guarantee that the software is fit for any purpose or accept any
* liability for it's use or misuse - this software is without warranty.
* liability for its use or misuse - this software is without warranty.
***************************************************************************
* File Description: Utility functions to access memory
**************************************************************************/

View file

@ -7,7 +7,7 @@
* for free and use it as they wish, with or without modifications, and in
* any context, commerically or otherwise. The only limitation is that I
* don't guarantee that the software is fit for any purpose or accept any
* liablity for it's use or misuse - this software is without warranty.
* liability for its use or misuse - this software is without warranty.
***************************************************************************
* File Description: Utility functions to access memory
**************************************************************************/

View file

@ -92,7 +92,7 @@
#define BOARD_TRIGORILLA_14_11 1136 // ... Rev 1.1 (new servo pin order)
#define BOARD_RAMPS_ENDER_4 1137 // Creality: Ender-4, CR-8
#define BOARD_RAMPS_CREALITY 1138 // Creality: CR10S, CR20, CR-X
#define BOARD_RAMPS_DAGOMA 1139 // Dagoma F5
#define BOARD_DAGOMA_F5 1139 // Dagoma F5
#define BOARD_FYSETC_F6_13 1140 // FYSETC F6 1.3
#define BOARD_FYSETC_F6_14 1141 // FYSETC F6 1.4
#define BOARD_DUPLICATOR_I3_PLUS 1142 // Wanhao Duplicator i3 Plus

View file

@ -348,7 +348,7 @@ float bilinear_z_offset(const xy_pos_t &raw) {
* Prepare a bilinear-leveled linear move on Cartesian,
* splitting the move where it crosses grid borders.
*/
void bilinear_line_to_destination(const feedRate_t scaled_fr_mm_s, uint16_t x_splits, uint16_t y_splits) {
void bilinear_line_to_destination(const feedRate_t &scaled_fr_mm_s, uint16_t x_splits, uint16_t y_splits) {
// Get current and destination cells for this line
xy_int_t c1 { CELL_INDEX(x, current_position.x), CELL_INDEX(y, current_position.y) },
c2 { CELL_INDEX(x, destination.x), CELL_INDEX(y, destination.y) };

View file

@ -54,9 +54,7 @@
size_t total = persistentStore.capacity();
int pos = 0;
const uint8_t value = 0x0;
while(total--) {
persistentStore.write_data(pos, &value, 1);
}
while (total--) persistentStore.write_data(pos, &value, 1);
persistentStore.access_finish();
#else
settings.reset();
@ -70,7 +68,7 @@
uint8_t *pointer = parser.hex_adr_val('A');
uint16_t len = parser.ushortval('C', 1);
uintptr_t addr = (uintptr_t)pointer;
NOMORE(addr, (size_t)(SRAM_SIZE - 1));
NOMORE(addr, size_t(SRAM_SIZE - 1));
NOMORE(len, SRAM_SIZE - addr);
if (parser.seenval('X')) {
// Write the hex bytes after the X
@ -91,16 +89,13 @@
uint8_t *pointer = parser.hex_adr_val('A');
uint16_t len = parser.ushortval('C', 1);
uintptr_t addr = (uintptr_t)pointer;
#ifndef MARLIN_EEPROM_SIZE
#define MARLIN_EEPROM_SIZE size_t(E2END + 1)
#endif
NOMORE(addr, (size_t)(MARLIN_EEPROM_SIZE - 1));
NOMORE(len, MARLIN_EEPROM_SIZE - addr);
NOMORE(addr, size_t(persistentStore.capacity() - 1));
NOMORE(len, persistentStore.capacity() - addr);
if (parser.seenval('X')) {
uint16_t val = parser.hex_val('X');
#if ENABLED(EEPROM_SETTINGS)
persistentStore.access_start();
while(len--) {
while (len--) {
int pos = 0;
persistentStore.write_data(pos, (uint8_t *)&val, sizeof(val));
}
@ -111,23 +106,18 @@
#endif
}
else {
while (len--) {
// Read bytes from EEPROM
#if ENABLED(EEPROM_SETTINGS)
persistentStore.access_start();
uint8_t val;
while(len--) {
int pos = 0;
if (!persistentStore.read_data(pos, (uint8_t *)&val, sizeof(val))) {
print_hex_byte(val);
}
}
SERIAL_EOL();
persistentStore.access_finish();
#else
SERIAL_ECHOLNPGM("NO EEPROM");
#endif
}
// Read bytes from EEPROM
#if ENABLED(EEPROM_SETTINGS)
persistentStore.access_start();
int pos = 0;
uint8_t val;
while (len--) if (!persistentStore.read_data(pos, &val, 1)) print_hex_byte(val);
SERIAL_EOL();
persistentStore.access_finish();
#else
SERIAL_ECHOLNPGM("NO EEPROM");
len = 0;
#endif
SERIAL_EOL();
}
} break;
@ -156,7 +146,7 @@
uint8_t *pointer = parser.hex_adr_val('A');
uint16_t len = parser.ushortval('C', 1);
uintptr_t addr = (uintptr_t)pointer;
NOMORE(addr, (size_t)(FLASH_SIZE - 1));
NOMORE(addr, size_t(FLASH_SIZE - 1));
NOMORE(len, FLASH_SIZE - addr);
if (parser.seenval('X')) {
// TODO: Write the hex bytes after the X

View file

@ -42,7 +42,7 @@
* version was tagged.
*/
#ifndef STRING_DISTRIBUTION_DATE
#define STRING_DISTRIBUTION_DATE "2020-10-28"
#define STRING_DISTRIBUTION_DATE "2020-10-31"
#endif
/**

View file

@ -119,7 +119,7 @@ namespace Language_en {
PROGMEM Language_Str MSG_CAUTION = u8"Caution:";
PROGMEM Language_Str MSG_HOT = u8"Hot!";
PROGMEM Language_Str MSG_UNLOAD_FILAMENT = u8"Unload/Retract";
PROGMEM Language_Str MSG_LOAD_FILAMENT = u8"Load/Extruder";
PROGMEM Language_Str MSG_LOAD_FILAMENT = u8"Load/Extrude";
PROGMEM Language_Str MSG_MOMENTARY = u8"Momentary";
PROGMEM Language_Str MSG_CONTINUOUS = u8"Continuous";
PROGMEM Language_Str MSG_PLEASE_WAIT = u8"Please wait...";

View file

@ -84,6 +84,7 @@ void ChangeFilamentScreen::drawTempGradient(uint16_t x, uint16_t y, uint16_t w,
}
void ChangeFilamentScreen::onEntry() {
BaseScreen::onEntry();
screen_data.ChangeFilamentScreen.e_tag = ExtUI::getActiveTool() + 10;
screen_data.ChangeFilamentScreen.t_tag = 0;
screen_data.ChangeFilamentScreen.repeat_tag = 0;

View file

@ -26,6 +26,8 @@
#include "screens.h"
#include "../../../../../feature/host_actions.h"
using namespace ExtUI;
void ConfirmAbortPrintDialogBox::onRedraw(draw_mode_t) {
@ -37,7 +39,11 @@ bool ConfirmAbortPrintDialogBox::onTouchEnd(uint8_t tag) {
switch (tag) {
case 1:
GOTO_PREVIOUS();
stopPrint();
if (ExtUI::isPrintingFromMedia())
ExtUI::stopPrint();
#ifdef ACTION_ON_CANCEL
else host_action_cancel();
#endif
return true;
default:
return DialogBoxBaseClass::onTouchEnd(tag);

View file

@ -35,29 +35,27 @@ using namespace ExtUI;
using namespace Theme;
#ifdef TOUCH_UI_PORTRAIT
#define GRID_ROWS 10
#define GRID_ROWS 9
#define GRID_COLS 2
#define TITLE_POS BTN_POS(1,1), BTN_SIZE(2,1)
#define LEVEL_BED_POS BTN_POS(1,2), BTN_SIZE(2,1)
#define LEVEL_AXIS_POS BTN_POS(1,3), BTN_SIZE(2,1)
#define Z_AUTO_ALIGN_POS BTN_POS(1,4), BTN_SIZE(2,1)
#define SHOW_MESH_POS BTN_POS(1,5), BTN_SIZE(2,1)
#define BLTOUCH_TITLE_POS BTN_POS(1,7), BTN_SIZE(2,1)
#define BLTOUCH_RESET_POS BTN_POS(1,8), BTN_SIZE(1,1)
#define BLTOUCH_TEST_POS BTN_POS(2,8), BTN_SIZE(1,1)
#define BACK_POS BTN_POS(1,10), BTN_SIZE(2,1)
#else
#define GRID_ROWS 8
#define GRID_COLS 2
#define TITLE_POS BTN_POS(1,1), BTN_SIZE(2,1)
#define LEVEL_BED_POS BTN_POS(1,2), BTN_SIZE(2,1)
#define LEVEL_AXIS_POS BTN_POS(1,3), BTN_SIZE(2,1)
#define Z_AUTO_ALIGN_POS BTN_POS(1,4), BTN_SIZE(2,1)
#define SHOW_MESH_POS BTN_POS(1,5), BTN_SIZE(2,1)
#define LEVEL_AXIS_POS BTN_POS(1,2), BTN_SIZE(2,1)
#define LEVEL_BED_POS BTN_POS(1,3), BTN_SIZE(2,1)
#define SHOW_MESH_POS BTN_POS(1,4), BTN_SIZE(2,1)
#define BLTOUCH_TITLE_POS BTN_POS(1,6), BTN_SIZE(2,1)
#define BLTOUCH_RESET_POS BTN_POS(1,7), BTN_SIZE(1,1)
#define BLTOUCH_TEST_POS BTN_POS(2,7), BTN_SIZE(1,1)
#define BACK_POS BTN_POS(1,8), BTN_SIZE(2,1)
#define BACK_POS BTN_POS(1,9), BTN_SIZE(2,1)
#else
#define GRID_ROWS 7
#define GRID_COLS 2
#define TITLE_POS BTN_POS(1,1), BTN_SIZE(2,1)
#define LEVEL_AXIS_POS BTN_POS(1,2), BTN_SIZE(2,1)
#define LEVEL_BED_POS BTN_POS(1,3), BTN_SIZE(2,1)
#define SHOW_MESH_POS BTN_POS(1,4), BTN_SIZE(2,1)
#define BLTOUCH_TITLE_POS BTN_POS(1,5), BTN_SIZE(2,1)
#define BLTOUCH_RESET_POS BTN_POS(1,6), BTN_SIZE(1,1)
#define BLTOUCH_TEST_POS BTN_POS(2,6), BTN_SIZE(1,1)
#define BACK_POS BTN_POS(1,7), BTN_SIZE(2,1)
#endif
void LevelingMenu::onRedraw(draw_mode_t what) {
@ -73,21 +71,16 @@ void LevelingMenu::onRedraw(draw_mode_t what) {
cmd.font(font_large)
.text(TITLE_POS, GET_TEXT_F(MSG_LEVELING))
.font(font_medium).colors(normal_btn)
.tag(2).button(LEVEL_BED_POS, GET_TEXT_F(MSG_LEVEL_BED))
.enabled(
#ifdef AXIS_LEVELING_COMMANDS
1
#endif
)
.tag(3).button(LEVEL_AXIS_POS, GET_TEXT_F(MSG_AUTOLEVEL_X_AXIS))
.enabled(ENABLED(Z_STEPPER_AUTO_ALIGN))
.tag(4).button(Z_AUTO_ALIGN_POS, GET_TEXT_F(MSG_AUTO_Z_ALIGN))
#if EITHER(Z_STEPPER_AUTO_ALIGN,MECHANICAL_GANTRY_CALIBRATION)
.tag(2).button(LEVEL_AXIS_POS, GET_TEXT_F(MSG_AUTOLEVEL_X_AXIS))
#endif
.tag(3).button(LEVEL_BED_POS, GET_TEXT_F(MSG_LEVEL_BED))
.enabled(ENABLED(HAS_MESH))
.tag(5).button(SHOW_MESH_POS, GET_TEXT_F(MSG_SHOW_MESH));
.tag(4).button(SHOW_MESH_POS, GET_TEXT_F(MSG_SHOW_MESH));
#if ENABLED(BLTOUCH)
cmd.text(BLTOUCH_TITLE_POS, GET_TEXT_F(MSG_BLTOUCH))
.tag(6).button(BLTOUCH_RESET_POS, GET_TEXT_F(MSG_BLTOUCH_RESET))
.tag(7).button(BLTOUCH_TEST_POS, GET_TEXT_F(MSG_BLTOUCH_SELFTEST));
.tag(5).button(BLTOUCH_RESET_POS, GET_TEXT_F(MSG_BLTOUCH_RESET))
.tag(6).button(BLTOUCH_TEST_POS, GET_TEXT_F(MSG_BLTOUCH_SELFTEST));
#endif
cmd.colors(action_btn)
.tag(1).button(BACK_POS, GET_TEXT_F(MSG_BACK));
@ -97,25 +90,25 @@ void LevelingMenu::onRedraw(draw_mode_t what) {
bool LevelingMenu::onTouchEnd(uint8_t tag) {
switch (tag) {
case 1: GOTO_PREVIOUS(); break;
case 2:
#if EITHER(Z_STEPPER_AUTO_ALIGN,MECHANICAL_GANTRY_CALIBRATION)
case 2: SpinnerDialogBox::enqueueAndWait_P(F("G34")); break;
#endif
case 3:
#ifndef BED_LEVELING_COMMANDS
#define BED_LEVELING_COMMANDS "G29"
#endif
#if HAS_MESH
BedMeshScreen::startMeshProbe();
#else
SpinnerDialogBox::enqueueAndWait_P(F(BED_LEVELING_COMMANDS));
#endif
break;
#ifdef AXIS_LEVELING_COMMANDS
case 3: SpinnerDialogBox::enqueueAndWait_P(F(AXIS_LEVELING_COMMANDS)); break;
#endif
#if ENABLED(Z_STEPPER_AUTO_ALIGN)
case 4: SpinnerDialogBox::enqueueAndWait_P(F("G34")); break;
#endif
#if HAS_MESH
case 5: GOTO_SCREEN(BedMeshScreen); break;
case 4: GOTO_SCREEN(BedMeshScreen); break;
#endif
#if ENABLED(BLTOUCH)
case 6: injectCommands_P(PSTR("M280 P0 S60")); break;
case 7: SpinnerDialogBox::enqueueAndWait_P(F("M280 P0 S90\nG4 P100\nM280 P0 S120")); break;
case 5: injectCommands_P(PSTR("M280 P0 S60")); break;
case 6: SpinnerDialogBox::enqueueAndWait_P(F("M280 P0 S90\nG4 P100\nM280 P0 S120")); break;
#endif
default: return false;
}

View file

@ -365,6 +365,9 @@ class MainMenu : public BaseScreen, public CachedScreen<MENU_SCREEN_CACHE> {
};
class TuneMenu : public BaseScreen, public CachedScreen<TUNE_SCREEN_CACHE> {
private:
static void pausePrint();
static void resumePrint();
public:
static void onRedraw(draw_mode_t);
static bool onTouchEnd(uint8_t tag);

View file

@ -26,6 +26,8 @@
#include "screens.h"
#include "../../../../../feature/host_actions.h"
using namespace FTDI;
using namespace Theme;
@ -63,23 +65,24 @@ void TuneMenu::onRedraw(draw_mode_t what) {
#endif
if (what & FOREGROUND) {
using namespace ExtUI;
const bool sdOrHostPrinting = ExtUI::isPrinting();
const bool sdOrHostPaused = ExtUI::isPrintingPaused();
CommandProcessor cmd;
cmd.colors(normal_btn)
.font(font_medium)
.tag(2).button( TEMPERATURE_POS, GET_TEXT_F(MSG_TEMPERATURE))
.enabled(!isPrinting() || isPrintingFromMediaPaused())
.enabled(!sdOrHostPrinting || sdOrHostPaused)
.tag(3).button( FIL_CHANGE_POS, GET_TEXT_F(MSG_FILAMENTCHANGE))
.enabled(EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR))
.tag(9).button( FILAMENT_POS, GET_TEXT_F(MSG_FILAMENT))
.enabled(EITHER(HAS_BED_PROBE, BABYSTEPPING))
.tag(4).button( NUDGE_NOZ_POS, GET_TEXT_F(TERN(BABYSTEPPING, MSG_NUDGE_NOZZLE, MSG_ZPROBE_ZOFFSET)))
.tag(5).button( SPEED_POS, GET_TEXT_F(MSG_PRINT_SPEED))
.tag(isPrintingFromMediaPaused() ? 7 : 6)
.enabled(TERN0(SDSUPPORT, isPrintingFromMedia()))
.button( PAUSE_POS, isPrintingFromMediaPaused() ? GET_TEXT_F(MSG_RESUME_PRINT) : GET_TEXT_F(MSG_PAUSE_PRINT))
.enabled(TERN0(SDSUPPORT, isPrintingFromMedia()))
.enabled(sdOrHostPrinting)
.tag(sdOrHostPaused ? 7 : 6)
.button( PAUSE_POS, sdOrHostPaused ? GET_TEXT_F(MSG_RESUME_PRINT) : GET_TEXT_F(MSG_PAUSE_PRINT))
.enabled(sdOrHostPrinting)
.tag(8).button( STOP_POS, GET_TEXT_F(MSG_STOP_PRINT))
.enabled(ENABLED(CASE_LIGHT_ENABLE))
.tag(10).button( CASE_LIGHT_POS, GET_TEXT_F(MSG_CASE_LIGHT))
@ -94,26 +97,26 @@ bool TuneMenu::onTouchEnd(uint8_t tag) {
using namespace Theme;
using namespace ExtUI;
switch (tag) {
case 1: GOTO_PREVIOUS(); break;
case 2: GOTO_SCREEN(TemperatureScreen); break;
case 3: GOTO_SCREEN(ChangeFilamentScreen); break;
case 4:
case 1: GOTO_PREVIOUS(); break;
case 2: GOTO_SCREEN(TemperatureScreen); break;
case 3: GOTO_SCREEN(ChangeFilamentScreen); break;
case 4:
#if ENABLED(BABYSTEPPING)
GOTO_SCREEN(NudgeNozzleScreen);
#elif HAS_BED_PROBE
GOTO_SCREEN(ZOffsetScreen);
#endif
break;
case 5: GOTO_SCREEN(FeedratePercentScreen); break;
case 6: sound.play(twinkle, PLAY_ASYNCHRONOUS); ExtUI::pausePrint(); GOTO_SCREEN(StatusScreen); break;
case 7: sound.play(twinkle, PLAY_ASYNCHRONOUS); ExtUI::resumePrint(); GOTO_SCREEN(StatusScreen); break;
case 8:
case 5: GOTO_SCREEN(FeedratePercentScreen); break;
case 6: pausePrint(); break;
case 7: resumePrint(); break;
case 8:
GOTO_SCREEN(ConfirmAbortPrintDialogBox);
current_screen.forget();
PUSH_SCREEN(StatusScreen);
break;
#if EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR)
case 9: GOTO_SCREEN(FilamentMenu); break;
case 9: GOTO_SCREEN(FilamentMenu); break;
#endif
#if ENABLED(CASE_LIGHT_ENABLE)
case 10: GOTO_SCREEN(CaseLightScreen); break;
@ -124,4 +127,24 @@ bool TuneMenu::onTouchEnd(uint8_t tag) {
return true;
}
#endif // TOUCH_UI_FTDI_EVE
void TuneMenu::pausePrint() {
sound.play(twinkle, PLAY_ASYNCHRONOUS);
if (ExtUI::isPrintingFromMedia())
ExtUI::pausePrint();
#ifdef ACTION_ON_PAUSE
else host_action_pause();
#endif
GOTO_SCREEN(StatusScreen);
}
void TuneMenu::resumePrint() {
sound.play(twinkle, PLAY_ASYNCHRONOUS);
if (ExtUI::isPrintingFromMedia())
ExtUI::resumePrint();
#ifdef ACTION_ON_RESUME
else host_action_resume();
#endif
GOTO_SCREEN(StatusScreen);
}
#endif // TOUCH_UI_FTDI_EVE && !TOUCH_UI_LULZBOT_BIO

View file

@ -972,7 +972,11 @@ namespace ExtUI {
}
bool isPrinting() {
return (commandsInQueue() || isPrintingFromMedia() || IFSD(IS_SD_PRINTING(), false));
return (commandsInQueue() || isPrintingFromMedia() || IFSD(IS_SD_PRINTING(), false)) || print_job_timer.isRunning() || print_job_timer.isPaused();
}
bool isPrintingPaused() {
return isPrinting() && (isPrintingFromMediaPaused() || print_job_timer.isPaused());
}
bool isMediaInserted() {

View file

@ -302,6 +302,7 @@ namespace ExtUI {
bool isPrintingFromMediaPaused();
bool isPrintingFromMedia();
bool isPrinting();
bool isPrintingPaused();
void printFile(const char *filename);
void stopPrint();

View file

@ -26,6 +26,13 @@
*
* LCD Menu Messages
* See also https://marlinfw.org/docs/development/lcd_language.html
*
* Substitutions are applied for the following characters when used
* in menu items that call lcd_put_u8str_ind_P with an index:
*
* = displays '0'....'10' for indexes 0 - 10
* ~ displays '1'....'11' for indexes 0 - 10
* * displays 'E1'...'E11' for indexes 0 - 10 (By default. Uses LCD_FIRST_TOOL)
*/
#define en 1234

View file

@ -26,6 +26,13 @@
*
* LCD Menu Messages
* See also https://marlinfw.org/docs/development/lcd_language.html
*
* Substitutions are applied for the following characters when used
* in menu items that call lcd_put_u8str_ind_P with an index:
*
* = displays '0'....'10' for indexes 0 - 10
* ~ displays '1'....'11' for indexes 0 - 10
* * displays 'E1'...'E11' for indexes 0 - 10 (By default. Uses LCD_FIRST_TOOL)
*/
#define DISPLAY_CHARSET_ISO10646_1
@ -65,6 +72,9 @@ namespace Language_it {
PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Home asse Z");
PROGMEM Language_Str MSG_AUTO_Z_ALIGN = _UxGT("Allineam.automat. Z");
PROGMEM Language_Str MSG_ASSISTED_TRAMMING = _UxGT("Tramming assistito");
PROGMEM Language_Str MSG_ITERATION = _UxGT("Iterazione G34: %i");
PROGMEM Language_Str MSG_DECREASING_ACCURACY = _UxGT("Precis.in calo!");
PROGMEM Language_Str MSG_ACCURACY_ACHIEVED = _UxGT("Precis.raggiunta");
PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Home assi XYZ");
PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Premi per iniziare");
PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Punto successivo");
@ -652,4 +662,5 @@ namespace Language_it {
PROGMEM Language_Str MSG_REHEATING = _UxGT("Riscaldando...");
PROGMEM Language_Str MSG_PROBE_WIZARD = _UxGT("Proc.guid.sonda Z");
PROGMEM Language_Str MSG_SOUND = _UxGT("Suono");
}

View file

@ -55,10 +55,8 @@
#endif
}
#if ENABLED(MARLIN_DEV_MODE)
#if ENABLED(HAL_CAN_SET_PWM_FREQ) && defined(SPINDLE_LASER_FREQUENCY)
EDIT_ITEM_FAST(CUTTER_MENU_FREQUENCY_TYPE, MSG_CUTTER_FREQUENCY, &cutter.frequency, 2000, 50000, cutter.refresh_frequency);
#endif
#if BOTH(MARLIN_DEV_MODE, HAL_CAN_SET_PWM_FREQ) && defined(SPINDLE_LASER_FREQUENCY)
EDIT_ITEM_FAST(CUTTER_MENU_FREQUENCY_TYPE, MSG_CUTTER_FREQUENCY, &cutter.frequency, 2000, 50000, cutter.refresh_frequency);
#endif
END_MENU();
}

View file

@ -1233,9 +1233,9 @@ void Temperature::manage_heater() {
#ifndef MIN_COOLING_SLOPE_DEG_CHAMBER_VENT
#define MIN_COOLING_SLOPE_DEG_CHAMBER_VENT 1.5
#endif
if( (temp_chamber.celsius - temp_chamber.target >= HIGH_EXCESS_HEAT_LIMIT) && !flag_chamber_excess_heat) {
// open vent after MIN_COOLING_SLOPE_TIME_CHAMBER_VENT seconds
// if the temperature did not drop at least MIN_COOLING_SLOPE_DEG_CHAMBER_VENT
if (!flag_chamber_excess_heat && temp_chamber.celsius - temp_chamber.target >= HIGH_EXCESS_HEAT_LIMIT) {
// Open vent after MIN_COOLING_SLOPE_TIME_CHAMBER_VENT seconds if the
// temperature didn't drop at least MIN_COOLING_SLOPE_DEG_CHAMBER_VENT
if (next_cool_check_ms_2 == 0 || ELAPSED(ms, next_cool_check_ms_2)) {
if (old_temp - temp_chamber.celsius < float(MIN_COOLING_SLOPE_DEG_CHAMBER_VENT)) flag_chamber_excess_heat = true; //the bed is heating the chamber too much
next_cool_check_ms_2 = ms + 1000UL * MIN_COOLING_SLOPE_TIME_CHAMBER_VENT;

View file

@ -0,0 +1,78 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#pragma once
// Dagoma NTC 100k white thermistor
const temp_entry_t temptable_17[] PROGMEM = {
{ OV( 16), 309 },
{ OV( 18), 307 },
{ OV( 20), 300 },
{ OV( 22), 293 },
{ OV( 26), 284 },
{ OV( 29), 272 },
{ OV( 33), 266 },
{ OV( 36), 260 },
{ OV( 42), 252 },
{ OV( 46), 247 },
{ OV( 48), 244 },
{ OV( 51), 241 },
{ OV( 62), 231 },
{ OV( 73), 222 },
{ OV( 78), 219 },
{ OV( 87), 212 },
{ OV( 98), 207 },
{ OV( 109), 201 },
{ OV( 118), 197 },
{ OV( 131), 191 },
{ OV( 145), 186 },
{ OV( 160), 181 },
{ OV( 177), 175 },
{ OV( 203), 169 },
{ OV( 222), 164 },
{ OV( 256), 156 },
{ OV( 283), 151 },
{ OV( 312), 145 },
{ OV( 343), 140 },
{ OV( 377), 131 },
{ OV( 413), 125 },
{ OV( 454), 119 },
{ OV( 496), 113 },
{ OV( 537), 108 },
{ OV( 578), 102 },
{ OV( 619), 97 },
{ OV( 658), 92 },
{ OV( 695), 87 },
{ OV( 735), 81 },
{ OV( 773), 75 },
{ OV( 808), 70 },
{ OV( 844), 64 },
{ OV( 868), 59 },
{ OV( 892), 54 },
{ OV( 914), 49 },
{ OV( 935), 42 },
{ OV( 951), 38 },
{ OV( 967), 32 },
{ OV( 975), 28 },
{ OV(1000), 20 },
{ OV(1010), 10 },
{ OV(1024), -273 } // for safety
};

View file

@ -105,6 +105,9 @@ typedef struct { int16_t value, celsius; } temp_entry_t;
#if ANY_THERMISTOR_IS(15) // JGAurora A5 thermistor calibration
#include "thermistor_15.h"
#endif
#if ANY_THERMISTOR_IS(17) // Dagoma NTC 100k white thermistor
#include "thermistor_17.h"
#endif
#if ANY_THERMISTOR_IS(18) // ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327
#include "thermistor_18.h"
#endif

View file

@ -251,7 +251,7 @@
* _____ _____
* (BEEPER) 1.31 | · · | 1.30 (BTN_ENC) (MISO) 0.8 | · · | 0.7 (SD_SCK)
* (LCD_EN) 0.18 | · · | 0.16 (LCD_RS) (BTN_EN1) 3.25 | · · | 0.28 (SD_CS2)
* (LCD_D4) 0.15 | · ·| 0.17 (LCD_D5) (BTN_EN2) 3.26 | · ·| 0.9 (SD_MOSI)
* (LCD_D4) 0.15 | · · | 0.17 (LCD_D5) (BTN_EN2) 3.26 | · · | 0.9 (SD_MOSI)
* (LCD_D6) 1.0 | · · | 1.22 (LCD_D7) (SD_DETECT) 0.27 | · · | RST
* GND | · · | 5V GND | · · | NC
* ----- -----
@ -299,6 +299,56 @@
#define LCD_PINS_D7 P1_22
#define KILL_PIN -1 // NC
#elif HAS_SPI_TFT // Config for Classic UI (emulated DOGM) and Color UI
#define TFT_CS_PIN P1_00
#define TFT_A0_PIN P1_22
#define TFT_DC_PIN P1_22
#define TFT_MISO_PIN P0_08
#define TFT_BACKLIGHT_PIN P0_18
#define TFT_RESET_PIN P0_16
#define LCD_USE_DMA_SPI
#define TOUCH_INT_PIN P0_17
#define TOUCH_CS_PIN P0_15
#define TOUCH_BUTTONS_HW_SPI
#define TOUCH_BUTTONS_HW_SPI_DEVICE 2
// Disable any LCD related PINs config
#define LCD_PINS_ENABLE -1
#define LCD_PINS_RS -1
// XPT2046 Touch Screen calibration
#if ENABLED(TFT_CLASSIC_UI)
#ifndef XPT2046_X_CALIBRATION
#define XPT2046_X_CALIBRATION -11386
#endif
#ifndef XPT2046_Y_CALIBRATION
#define XPT2046_Y_CALIBRATION 8684
#endif
#ifndef XPT2046_X_OFFSET
#define XPT2046_X_OFFSET 689
#endif
#ifndef XPT2046_Y_OFFSET
#define XPT2046_Y_OFFSET -273
#endif
#elif ENABLED(TFT_COLOR_UI)
#ifndef XPT2046_X_CALIBRATION
#define XPT2046_X_CALIBRATION -17089
#endif
#ifndef XPT2046_Y_CALIBRATION
#define XPT2046_Y_CALIBRATION 11424
#endif
#ifndef XPT2046_X_OFFSET
#define XPT2046_X_OFFSET 1044
#endif
#ifndef XPT2046_Y_OFFSET
#define XPT2046_Y_OFFSET -365
#endif
#define TFT_BUFFER_SIZE 2400
#endif
#else // !MKS_12864OLED_SSD1306
#define LCD_PINS_RS P0_16

View file

@ -179,8 +179,8 @@
#include "ramps/pins_RAMPS_ENDER_4.h" // ATmega2560 env:mega2560
#elif MB(RAMPS_CREALITY)
#include "ramps/pins_RAMPS_CREALITY.h" // ATmega2560 env:mega2560
#elif MB(RAMPS_DAGOMA)
#include "ramps/pins_RAMPS_DAGOMA.h" // ATmega2560 env:mega2560
#elif MB(DAGOMA_F5)
#include "ramps/pins_DAGOMA_F5.h" // ATmega2560 env:mega2560
#elif MB(FYSETC_F6_13)
#include "ramps/pins_FYSETC_F6_13.h" // ATmega2560 env:FYSETC_F6_13
#elif MB(FYSETC_F6_14)
@ -713,6 +713,7 @@
#define BOARD_BIGTREE_SKR_E3_DIP -1017
#define BOARD_RUMBA32 -1018
#define BOARD_RUMBA32_AUS3D -1019
#define BOARD_RAMPS_DAGOMA -1020
#if MB(MKS_13)
#error "BOARD_MKS_13 has been renamed BOARD_MKS_GEN_13. Please update your configuration."
@ -756,6 +757,8 @@
#error "BOARD_RUMBA32 is now BOARD_RUMBA32_MKS or BOARD_RUMBA32_V1_0. Please update your configuration."
#elif MB(RUMBA32_AUS3D)
#error "BOARD_RUMBA32_AUS3D is now BOARD_RUMBA32_V1_0. Please update your configuration."
#elif MB(RAMPS_DAGOMA)
#error "BOARD_RAMPS_DAGOMA is now BOARD_DAGOMA_F5. Please update your configuration."
#else
#error "Unknown MOTHERBOARD value set in Configuration.h"
#endif
@ -780,6 +783,7 @@
#undef BOARD_BIGTREE_SKR_E3_DIP
#undef BOARD_RUMBA32
#undef BOARD_RUMBA32_AUS3D
#undef BOARD_RAMPS_DAGOMA
#endif

View file

@ -22,21 +22,47 @@
#pragma once
#if HOTENDS > 2 || E_STEPPERS > 2
#error "Dagoma3D F5 RAMPS supports only 2 hotends / E-steppers. Comment out this line to continue."
#error "Dagoma3D F5 supports only 2 hotends / E-steppers. Comment out this line to continue."
#endif
#define BOARD_INFO_NAME "Dagoma3D F5 RAMPS"
#define BOARD_INFO_NAME "Dagoma3D F5"
//
// Endstops
//
#define X_STOP_PIN 2
#define Y_STOP_PIN 3
#define Z_STOP_PIN 15
#define FIL_RUNOUT_PIN 39
#ifndef E0_AUTO_FAN_PIN
#define E0_AUTO_FAN_PIN 7
#define FIL_RUNOUT_PIN 39
#if EXTRUDERS > 1
#define FIL_RUNOUT2_PIN 14
#endif
//
// Import RAMPS 1.4 pins
// LCD delays
//
#if HAS_MARLINUI_U8GLIB
#define BOARD_ST7920_DELAY_1 DELAY_NS(0)
#define BOARD_ST7920_DELAY_2 DELAY_NS(250)
#define BOARD_ST7920_DELAY_3 DELAY_NS(250)
#endif
//
// DAC steppers
//
#define HAS_MOTOR_CURRENT_DAC
#define DAC_STEPPER_ORDER { 0, 1, 2, 3 }
#define DAC_STEPPER_SENSE 0.11
#define DAC_STEPPER_ADDRESS 0
#define DAC_STEPPER_MAX 4096
#define DAC_STEPPER_VREF 1
#define DAC_STEPPER_GAIN 0
#define DAC_OR_ADDRESS 0x00
//
// Import default RAMPS 1.4 pins
//
#include "pins_RAMPS.h"

View file

@ -25,7 +25,7 @@
* MKS Robin nano (STM32F130VET6) board pin assignments
*/
#if NOT_TARGET(__STM32F1__)
#if NOT_TARGET(__STM32F1__, STM32F1)
#error "Oops! Select an STM32F1 board in 'Tools > Board.'"
#elif HOTENDS > 2 || E_STEPPERS > 2
#error "MKS Robin nano supports up to 2 hotends / E-steppers. Comment out this line to continue."

View file

@ -234,7 +234,7 @@ def load_marlin_features():
build_flags = env.ParseFlagsExtended(build_flags)
cxx = search_compiler()
cmd = [cxx]
cmd = ['"' + cxx + '"']
# Build flags from board.json
#if 'BOARD' in env:

View file

@ -11,7 +11,7 @@
".vscode"
],
"binary_file_patterns":
[ "*.psd", "*.png", "*.jpg", "*.jpeg", "*.bdf", "*.patch", "avrdude_5.*", "*.svg" ],
[ "*.psd", "*.png", "*.jpg", "*.jpeg", "*.bdf", "*.patch", "avrdude_5.*", "*.svg", "*.bin", "*.woff" ],
"file_exclude_patterns":
[
"Marlin/platformio.ini",

View file

@ -1310,17 +1310,39 @@ build_flags = ${lerdge_common.build_flags}
# RUMBA32
#
[env:rumba32]
platform = ${common_stm32.platform}
extends = common_stm32
build_flags = ${common_stm32.build_flags}
platform = ${common_stm32.platform}
extends = common_stm32
build_flags = ${common_stm32.build_flags}
-Os
-DHAL_PCD_MODULE_ENABLED
-DDISABLE_GENERIC_SERIALUSB
-DHAL_UART_MODULE_ENABLED
-DTIMER_SERIAL=TIM9
board = rumba32_f446ve
board = rumba32_f446ve
upload_protocol = dfu
monitor_speed = 500000
monitor_speed = 500000
#
# MKS Robin Nano V1.2 and V2 using hal STM32
#
[env:mks_robin_nano35_stm32]
platform = ${common_stm32.platform}
extends = common_stm32
build_flags = ${common_stm32.build_flags} -DMCU_STM32F103VE -DSS_TIMER=4 -DENABLE_HWSERIAL3 -DTRANSFER_CLOCK_DIV=8
board = genericSTM32F103VE
board_build.core = stm32
board_build.variant = MARLIN_F103Vx
board_build.ldscript = ldscript.ld
board_build.offset = 0x7000
board_build.firmware = Robin_nano35.bin
board_upload.offset_address = 0x08007000
build_unflags = ${common_stm32.build_unflags} -DUSBCON -DUSBD_USE_CDC
debug_tool = jlink
upload_protocol = jlink
extra_scripts = ${common.extra_scripts}
pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py
buildroot/share/PlatformIO/scripts/stm32_bootloader.py
buildroot/share/PlatformIO/scripts/mks_encrypt.py
#################################
# #