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

This commit is contained in:
Scott Lahteine 2020-11-10 22:56:46 -06:00
commit 59cc4fee67
382 changed files with 4422 additions and 2773 deletions

View file

@ -83,6 +83,7 @@ jobs:
- STM32F103RET6_creality
- LERDGEX
- mks_robin_nano35
- mks_robin_nano35_stm32
- NUCLEO_F767ZI
# Put lengthy tests last

3
.gitignore vendored
View file

@ -183,3 +183,6 @@ cmake-build-*
#Python
__pycache__
#IOLogger logs
*_log.csv

View file

@ -344,9 +344,10 @@
#define AUTO_POWER_E_FANS
#define AUTO_POWER_CONTROLLERFAN
#define AUTO_POWER_CHAMBER_FAN
//#define AUTO_POWER_E_TEMP 50 // (°C) Turn on PSU over this temperature
//#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU over this temperature
#define POWER_TIMEOUT 30
//#define AUTO_POWER_E_TEMP 50 // (°C) Turn on PSU if any extruder is over this temperature
//#define AUTO_POWER_CHAMBER_TEMP 30 // (°C) Turn on PSU if the chamber is over this temperature
#define POWER_TIMEOUT 30 // (s) Turn off power if the machine is idle for this duration
//#define POWER_OFF_DELAY 60 // (s) Delay of poweroff after M81 command. Useful to let fans run for extra time.
#endif
#endif
@ -674,6 +675,8 @@
*
* A4988 is assumed for unspecified drivers.
*
* Use TMC2208/TMC2208_STANDALONE for TMC2225 drivers and TMC2209/TMC2209_STANDALONE for TMC2226 drivers.
*
* Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01,
* TB6560, TB6600, TMC2100,
* TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
@ -1170,6 +1173,12 @@
* Filament Runout Sensors
* Mechanical or opto endstops are used to check for the presence of filament.
*
* IMPORTANT: Runout will only trigger if Marlin is aware that a print job is running.
* Marlin knows a print job is running when:
* 1. Running a print job from media started with M24.
* 2. The Print Job Timer has been started with M75.
* 3. The heaters were turned on and PRINTJOB_TIMER_AUTOSTART is enabled.
*
* RAMPS-based boards use SERVO3_PIN for the first runout sensor.
* For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc.
*/
@ -2107,9 +2116,10 @@
//
// Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6
// A clone of the RepRapDiscount full graphics display but with
// different pins/wiring (see pins_ANET_10.h).
// different pins/wiring (see pins_ANET_10.h). Enable one of these.
//
//#define ANET_FULL_GRAPHICS_LCD
//#define ANET_FULL_GRAPHICS_LCD_ALT_WIRING
//
// AZSMZ 12864 LCD with SD
@ -2354,6 +2364,10 @@
//#define XPT2046_Y_CALIBRATION -8981
//#define XPT2046_X_OFFSET -43
//#define XPT2046_Y_OFFSET 257
#if ENABLED(TFT_COLOR_UI)
//#define SINGLE_TOUCH_NAVIGATION
#endif
#endif
//

View file

@ -808,7 +808,10 @@
#define RESTORE_LEVELING_AFTER_G35 // Enable to restore leveling setup after operation
//#define REPORT_TRAMMING_MM // Report Z deviation (mm) for each point relative to the first
//#define ASSISTED_TRAMMING_MENU_ITEM // Add a menu item for Assisted Tramming
//#define ASSISTED_TRAMMING_MENU_ITEM // Add a menu item to run G35 Assisted Tramming (MarlinUI)
//#define ASSISTED_TRAMMING_WIZARD // Make the menu item open a Tramming Wizard sub-menu
//#define ASSISTED_TRAMMING_WAIT_POSITION { X_CENTER, Y_CENTER, 30 } // Move the nozzle out of the way for adjustment
/**
* Screw thread:
@ -2943,11 +2946,18 @@
#define SPINDLE_LASER_FREQUENCY 2500 // (Hz) Spindle/laser frequency (only on supported HALs: AVR and LPC)
//#define SPINDLE_SERVO // A servo converting an angle to spindle power
#ifdef SPINDLE_SERVO
#define SPINDLE_SERVO_NR 0 // Index of servo used for spindle control
#define SPINDLE_SERVO_MIN 10 // Minimum angle for servo spindle
#endif
/**
* Speed / Power can be set ('M3 S') and displayed in terms of:
* - PWM255 (S0 - S255)
* - PERCENT (S0 - S100)
* - RPM (S0 - S50000) Best for use with a spindle
* - SERVO (S0 - S180)
*/
#define CUTTER_POWER_UNIT PWM255

View file

@ -36,7 +36,7 @@ void watchdogSetup() {
#if ENABLED(USE_WATCHDOG)
// 4 seconds timeout
uint32_t timeout = 4000;
uint32_t timeout = TERN(WATCHDOG_DURATION_8S, 8000, 4000);
// Calculate timeout value in WDT counter ticks: This assumes
// the slow clock is running at 32.768 kHz watchdog

View file

@ -25,6 +25,8 @@
#if ENABLED(USE_WATCHDOG)
#define WDT_TIMEOUT_US TERN(WATCHDOG_DURATION_8S, 8000000, 4000000) // 4 or 8 second timeout
#include "watchdog.h"
void watchdogSetup() {

View file

@ -19,22 +19,23 @@
*/
#ifdef __PLAT_LINUX__
extern void setup();
extern void loop();
#include <thread>
#include <iostream>
#include <fstream>
//#define GPIO_LOGGING // Full GPIO and Positional Logging
#include "../../inc/MarlinConfig.h"
#include <stdio.h>
#include <stdarg.h>
#include "../shared/Delay.h"
#include "hardware/IOLoggerCSV.h"
#include "hardware/Heater.h"
#include "hardware/LinearAxis.h"
#include <stdio.h>
#include <stdarg.h>
#include <thread>
#include <iostream>
#include <fstream>
extern void setup();
extern void loop();
// simple stdout / stdin implementation for fake serial port
void write_serial_thread() {
for (;;) {
@ -64,8 +65,6 @@ void simulation_loop() {
LinearAxis z_axis(Z_ENABLE_PIN, Z_DIR_PIN, Z_STEP_PIN, Z_MIN_PIN, Z_MAX_PIN);
LinearAxis extruder0(E0_ENABLE_PIN, E0_DIR_PIN, E0_STEP_PIN, P_NC, P_NC);
//#define GPIO_LOGGING // Full GPIO and Positional Logging
#ifdef GPIO_LOGGING
IOLoggerCSV logger("all_gpio_log.csv");
Gpio::attachLogger(&logger);
@ -88,7 +87,7 @@ void simulation_loop() {
#ifdef GPIO_LOGGING
if (x_axis.position != x || y_axis.position != y || z_axis.position != z) {
uint64_t update = MAX3(x_axis.last_update, y_axis.last_update, z_axis.last_update);
uint64_t update = _MAX(x_axis.last_update, y_axis.last_update, z_axis.last_update);
position_log << update << ", " << x_axis.position << ", " << y_axis.position << ", " << z_axis.position << std::endl;
position_log.flush();
x = x_axis.position;

View file

@ -27,6 +27,8 @@
#include "watchdog.h"
#define WDT_TIMEOUT_US TERN(WATCHDOG_DURATION_8S, 8000000, 4000000) // 4 or 8 second timeout
void watchdog_init() {}
void HAL_watchdog_refresh() {}

View file

@ -21,7 +21,5 @@
*/
#pragma once
#define WDT_TIMEOUT 4000000 // 4 second timeout
void watchdog_init();
void HAL_watchdog_refresh();

View file

@ -127,11 +127,9 @@
for (uint16_t i = 0; i < nbyte; i++) doio(buf[i]);
}
void spiSend(uint32_t chan, byte b) {
}
void spiSend(uint32_t chan, byte b) {}
void spiSend(uint32_t chan, const uint8_t* buf, size_t nbyte) {
}
void spiSend(uint32_t chan, const uint8_t* buf, size_t nbyte) {}
// Read single byte from SPI
uint8_t spiRec() { return doio(0xFF); }
@ -143,9 +141,7 @@
for (uint16_t i = 0; i < nbyte; i++) buf[i] = doio(0xFF);
}
uint8_t spiTransfer(uint8_t b) {
return doio(b);
}
uint8_t spiTransfer(uint8_t b) { return doio(b); }
// Write from buffer to SPI
void spiSendBlock(uint8_t token, const uint8_t* buf) {
@ -201,6 +197,15 @@ SPIClass::SPIClass(uint8_t device) {
GPDMA_Init();
}
SPIClass::SPIClass(pin_t mosi, pin_t miso, pin_t sclk, pin_t ssel) {
#if BOARD_NR_SPI >= 1
if (mosi == BOARD_SPI1_MOSI_PIN) SPIClass(1);
#endif
#if BOARD_NR_SPI >= 2
if (mosi == BOARD_SPI2_MOSI_PIN) SPIClass(2);
#endif
}
void SPIClass::begin() {
// Init the SPI pins in the first begin call
if ((_currentSetting->spi_d == LPC_SSP0 && spiInitialised[0] == false) ||
@ -331,25 +336,15 @@ void SPIClass::read(uint8_t *buf, uint32_t len) {
for (uint16_t i = 0; i < len; i++) buf[i] = transfer(0xFF);
}
void SPIClass::setClock(uint32_t clock) {
_currentSetting->clock = clock;
}
void SPIClass::setClock(uint32_t clock) { _currentSetting->clock = clock; }
void SPIClass::setModule(uint8_t device) {
_currentSetting = &_settings[device - 1];// SPI channels are called 1 2 and 3 but the array is zero indexed
}
void SPIClass::setModule(uint8_t device) { _currentSetting = &_settings[device - 1]; } // SPI channels are called 1, 2, and 3 but the array is zero-indexed
void SPIClass::setBitOrder(uint8_t bitOrder) {
_currentSetting->bitOrder = bitOrder;
}
void SPIClass::setBitOrder(uint8_t bitOrder) { _currentSetting->bitOrder = bitOrder; }
void SPIClass::setDataMode(uint8_t dataMode) {
_currentSetting->dataMode = dataMode;
}
void SPIClass::setDataMode(uint8_t dataMode) { _currentSetting->dataMode = dataMode; }
void SPIClass::setDataSize(uint32_t ds) {
_currentSetting->dataSize = ds;
}
void SPIClass::setDataSize(uint32_t dataSize) { _currentSetting->dataSize = dataSize; }
/**
* Set up/tear down
@ -357,8 +352,8 @@ void SPIClass::setDataSize(uint32_t ds) {
void SPIClass::updateSettings() {
//SSP_DeInit(_currentSetting->spi_d); //todo: need force de init?!
// divide PCLK by 2 for SSP0
CLKPWR_SetPCLKDiv(_currentSetting->spi_d == LPC_SSP0 ? CLKPWR_PCLKSEL_SSP0 : CLKPWR_PCLKSEL_SSP1, CLKPWR_PCLKSEL_CCLK_DIV_2);
// Divide PCLK by 2 for SSP0
//CLKPWR_SetPCLKDiv(_currentSetting->spi_d == LPC_SSP0 ? CLKPWR_PCLKSEL_SSP0 : CLKPWR_PCLKSEL_SSP1, CLKPWR_PCLKSEL_CCLK_DIV_2);
SSP_CFG_Type HW_SPI_init; // data structure to hold init values
SSP_ConfigStructInit(&HW_SPI_init); // set values for SPI mode

View file

@ -2,6 +2,9 @@
* 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
@ -18,27 +21,25 @@
*/
#pragma once
#include <stdint.h>
#include <SPI.h>
#ifndef HAVE_SW_SERIAL
#define SW_SERIAL_PLACEHOLDER 1
#endif
/**
* Marlin currently requires 3 SPI classes:
*
* SPIClass:
* This class is normally provided by frameworks and has a semi-default interface.
* This is needed because some libraries reference it globally.
*
* SPISettings:
* Container for SPI configs for SPIClass. As above, libraries may reference it globally.
*
* These two classes are often provided by frameworks so we cannot extend them to add
* useful methods for Marlin.
*
* MarlinSPI:
* Provides the default SPIClass interface plus some Marlin goodies such as a simplified
* interface for SPI DMA transfer.
*
*/
class SoftwareSerial {
public:
SoftwareSerial(int8_t RX_pin, int8_t TX_pin);
void begin(const uint32_t baudrate);
bool available();
uint8_t read();
uint16_t write(uint8_t byte);
void flush();
void listen();
void stopListening();
protected:
bool listening;
};
using MarlinSPI = SPIClass;

View file

@ -37,6 +37,7 @@
#define DATA_SIZE_8BIT SSP_DATABIT_8
#define DATA_SIZE_16BIT SSP_DATABIT_16
#define SPI_CLOCK_MAX_TFT 30000000UL
#define SPI_CLOCK_DIV2 8333333 //(SCR: 2) desired: 8,000,000 actual: 8,333,333 +4.2% SPI_FULL_SPEED
#define SPI_CLOCK_DIV4 4166667 //(SCR: 5) desired: 4,000,000 actual: 4,166,667 +4.2% SPI_HALF_SPEED
#define SPI_CLOCK_DIV8 2083333 //(SCR: 11) desired: 2,000,000 actual: 2,083,333 +4.2% SPI_QUARTER_SPEED
@ -125,6 +126,11 @@ public:
*/
SPIClass(uint8_t spiPortNumber);
/**
* Init using pins
*/
SPIClass(pin_t mosi, pin_t miso, pin_t sclk, pin_t ssel = (pin_t)-1);
/**
* Select and configure the current selected SPI device to use
*/

View file

@ -89,7 +89,7 @@ void TFT_SPI::Init() {
#elif TFT_MISO_PIN == BOARD_SPI2_MISO_PIN
SPIx.setModule(2);
#endif
SPIx.setClock(SPI_CLOCK_MAX);
SPIx.setClock(SPI_CLOCK_MAX_TFT);
SPIx.setBitOrder(MSBFIRST);
SPIx.setDataMode(SPI_MODE0);
}
@ -125,7 +125,7 @@ uint32_t TFT_SPI::ReadID(uint16_t Reg) {
}
DataTransferEnd();
SPIx.setClock(SPI_CLOCK_MAX);
SPIx.setClock(SPI_CLOCK_MAX_TFT);
#endif
return data >> 7;

View file

@ -1,6 +1,9 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* 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

View file

@ -1,6 +1,9 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* 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

View file

@ -28,6 +28,8 @@
#include <lpc17xx_wdt.h>
#include "watchdog.h"
#define WDT_TIMEOUT_US TERN(WATCHDOG_DURATION_8S, 8000000, 4000000) // 4 or 8 second timeout
void watchdog_init() {
#if ENABLED(WATCHDOG_RESET_MANUAL)
// We enable the watchdog timer, but only for the interrupt.
@ -52,7 +54,7 @@ void watchdog_init() {
#else
WDT_Init(WDT_CLKSRC_IRC, WDT_MODE_RESET);
#endif
WDT_Start(WDT_TIMEOUT);
WDT_Start(WDT_TIMEOUT_US);
}
void HAL_watchdog_refresh() {

View file

@ -21,8 +21,6 @@
*/
#pragma once
#define WDT_TIMEOUT 4000000 // 4 second timeout
void watchdog_init();
void HAL_watchdog_refresh();

View file

@ -24,9 +24,11 @@
#if ENABLED(USE_WATCHDOG)
#include "watchdog.h"
#include "watchdog.h"
void watchdog_init() {
#define WDT_TIMEOUT_REG TERN(WATCHDOG_DURATION_8S, WDT_CONFIG_PER_CYC8192, WDT_CONFIG_PER_CYC4096) // 4 or 8 second timeout
void watchdog_init() {
// The low-power oscillator used by the WDT runs at 32,768 Hz with
// a 1:32 prescale, thus 1024 Hz, though probably not super precise.
@ -39,13 +41,13 @@
SYNC(WDT->SYNCBUSY.bit.ENABLE);
WDT->INTENCLR.reg = WDT_INTENCLR_EW; // Disable early warning interrupt
WDT->CONFIG.reg = WDT_CONFIG_PER_CYC4096; // Set at least 4s period for chip reset
WDT->CONFIG.reg = WDT_TIMEOUT_REG; // Set a 4s or 8s period for chip reset
HAL_watchdog_refresh();
WDT->CTRLA.reg = WDT_CTRLA_ENABLE; // Start watchdog now in normal mode
SYNC(WDT->SYNCBUSY.bit.ENABLE);
}
}
#endif // USE_WATCHDOG

View file

@ -81,7 +81,9 @@ void HAL_init() {
SetTimerInterruptPriorities();
TERN_(EMERGENCY_PARSER, USB_Hook_init());
#if ENABLED(EMERGENCY_PARSER) && USBD_USE_CDC
USB_Hook_init();
#endif
}
void HAL_clear_reset_source() { __HAL_RCC_CLEAR_RESET_FLAGS(); }
@ -128,8 +130,12 @@ uint16_t HAL_adc_get_result() { return HAL_adc_result; }
void flashFirmware(const int16_t) { NVIC_SystemReset(); }
// Maple Compatibility
volatile uint32_t systick_uptime_millis = 0;
systickCallback_t systick_user_callback;
void systick_attach_callback(systickCallback_t cb) { systick_user_callback = cb; }
void HAL_SYSTICK_Callback() { if (systick_user_callback) systick_user_callback(); }
void HAL_SYSTICK_Callback() {
systick_uptime_millis++;
if (systick_user_callback) systick_user_callback();
}
#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC

View file

@ -184,3 +184,21 @@ void flashFirmware(const int16_t);
typedef void (*systickCallback_t)(void);
void systick_attach_callback(systickCallback_t cb);
void HAL_SYSTICK_Callback();
extern volatile uint32_t systick_uptime_millis;
#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

@ -0,0 +1,165 @@
/**
* 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/>.
*
*/
#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC)
#include "MarlinSPI.h"
static void spi_init(spi_t *obj, uint32_t speed, spi_mode_e mode, uint8_t msb, uint32_t dataSize) {
spi_init(obj, speed, mode, msb);
// spi_init set 8bit always
// TODO: copy the code from spi_init and handle data size, to avoid double init always!!
if (dataSize != SPI_DATASIZE_8BIT) {
obj->handle.Init.DataSize = dataSize;
HAL_SPI_Init(&obj->handle);
__HAL_SPI_ENABLE(&obj->handle);
}
}
void MarlinSPI::setClockDivider(uint8_t _div) {
_speed = spi_getClkFreq(&_spi);// / _div;
_clockDivider = _div;
}
void MarlinSPI::begin(void) {
//TODO: only call spi_init if any parameter changed!!
spi_init(&_spi, _speed, _dataMode, _bitOrder, _dataSize);
}
void MarlinSPI::setupDma(SPI_HandleTypeDef &_spiHandle, DMA_HandleTypeDef &_dmaHandle, uint32_t direction, bool minc) {
_dmaHandle.Init.Direction = direction;
_dmaHandle.Init.PeriphInc = DMA_PINC_DISABLE;
_dmaHandle.Init.Mode = DMA_NORMAL;
_dmaHandle.Init.Priority = DMA_PRIORITY_LOW;
_dmaHandle.Init.MemInc = minc ? DMA_MINC_ENABLE : DMA_MINC_DISABLE;
if (_dataSize == DATA_SIZE_8BIT) {
_dmaHandle.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE;
_dmaHandle.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE;
}
else {
_dmaHandle.Init.PeriphDataAlignment = DMA_PDATAALIGN_HALFWORD;
_dmaHandle.Init.MemDataAlignment = DMA_MDATAALIGN_HALFWORD;
}
#ifdef STM32F4xx
_dmaHandle.Init.Channel = DMA_CHANNEL_3;
_dmaHandle.Init.FIFOMode = DMA_FIFOMODE_DISABLE;
#endif
// start DMA hardware
// TODO: check if hardware is already enabled
#ifdef SPI1_BASE
if (_spiHandle.Instance == SPI1) {
#ifdef STM32F1xx
__HAL_RCC_DMA1_CLK_ENABLE();
_dmaHandle.Instance = (direction == DMA_MEMORY_TO_PERIPH) ? DMA1_Channel3 : DMA1_Channel2;
#elif defined(STM32F4xx)
__HAL_RCC_DMA2_CLK_ENABLE();
_dmaHandle.Instance = DMA2_Stream3;
#endif
}
#endif
#ifdef SPI2_BASE
if (_spiHandle.Instance == SPI2) {
#ifdef STM32F1xx
__HAL_RCC_DMA1_CLK_ENABLE();
_dmaHandle.Instance = (direction == DMA_MEMORY_TO_PERIPH) ? DMA1_Channel5 : DMA1_Channel4;
#elif defined(STM32F4xx)
//TODO: f4 dma config
#endif
}
#endif
#ifdef SPI3_BASE
if (_spiHandle.Instance == SPI3) {
#ifdef STM32F1xx
__HAL_RCC_DMA2_CLK_ENABLE();
_dmaHandle.Instance = (direction == DMA_MEMORY_TO_PERIPH) ? DMA2_Channel2 : DMA2_Channel1;
#elif defined(STM32F4xx)
//TODO: f4 dma config
#endif
}
#endif
HAL_DMA_Init(&_dmaHandle);
}
byte MarlinSPI::transfer(uint8_t _data) {
uint8_t rxData = 0xFF;
HAL_SPI_TransmitReceive(&_spi.handle, &_data, &rxData, 1, HAL_MAX_DELAY);
return rxData;
}
uint8_t MarlinSPI::dmaTransfer(const void *transmitBuf, void *receiveBuf, uint16_t length) {
const uint8_t ff = 0xFF;
//if ((hspi->Instance->CR1 & SPI_CR1_SPE) != SPI_CR1_SPE) //only enable if disabled
__HAL_SPI_ENABLE(&_spi.handle);
if (receiveBuf) {
setupDma(_spi.handle, _dmaRx, DMA_PERIPH_TO_MEMORY, true);
HAL_DMA_Start(&_dmaRx, (uint32_t)&(_spi.handle.Instance->DR), (uint32_t)receiveBuf, length);
SET_BIT(_spi.handle.Instance->CR2, SPI_CR2_RXDMAEN); /* Enable Rx DMA Request */
}
// check for 2 lines transfer
bool mincTransmit = true;
if (transmitBuf == nullptr && _spi.handle.Init.Direction == SPI_DIRECTION_2LINES && _spi.handle.Init.Mode == SPI_MODE_MASTER) {
transmitBuf = &ff;
mincTransmit = false;
}
if (transmitBuf) {
setupDma(_spi.handle, _dmaTx, DMA_MEMORY_TO_PERIPH, mincTransmit);
HAL_DMA_Start(&_dmaTx, (uint32_t)transmitBuf, (uint32_t)&(_spi.handle.Instance->DR), length);
SET_BIT(_spi.handle.Instance->CR2, SPI_CR2_TXDMAEN); /* Enable Tx DMA Request */
}
if (transmitBuf) {
HAL_DMA_PollForTransfer(&_dmaTx, HAL_DMA_FULL_TRANSFER, HAL_MAX_DELAY);
HAL_DMA_Abort(&_dmaTx);
HAL_DMA_DeInit(&_dmaTx);
}
// while ((_spi.handle.Instance->SR & SPI_FLAG_RXNE) != SPI_FLAG_RXNE) {}
if (receiveBuf) {
HAL_DMA_PollForTransfer(&_dmaRx, HAL_DMA_FULL_TRANSFER, HAL_MAX_DELAY);
HAL_DMA_Abort(&_dmaRx);
HAL_DMA_DeInit(&_dmaRx);
}
return 1;
}
uint8_t MarlinSPI::dmaSend(const void * transmitBuf, uint16_t length, bool minc) {
setupDma(_spi.handle, _dmaTx, DMA_MEMORY_TO_PERIPH, minc);
HAL_DMA_Start(&_dmaTx, (uint32_t)transmitBuf, (uint32_t)&(_spi.handle.Instance->DR), length);
__HAL_SPI_ENABLE(&_spi.handle);
SET_BIT(_spi.handle.Instance->CR2, SPI_CR2_TXDMAEN); /* Enable Tx DMA Request */
HAL_DMA_PollForTransfer(&_dmaTx, HAL_DMA_FULL_TRANSFER, HAL_MAX_DELAY);
HAL_DMA_Abort(&_dmaTx);
// DeInit objects
HAL_DMA_DeInit(&_dmaTx);
return 1;
}
#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC

View file

@ -0,0 +1,107 @@
/**
* 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
#include "HAL.h"
#include <SPI.h>
extern "C" {
#include <utility/spi_com.h>
}
/**
* Marlin currently requires 3 SPI classes:
*
* SPIClass:
* This class is normally provided by frameworks and has a semi-default interface.
* This is needed because some libraries reference it globally.
*
* SPISettings:
* Container for SPI configs for SPIClass. As above, libraries may reference it globally.
*
* These two classes are often provided by frameworks so we cannot extend them to add
* useful methods for Marlin.
*
* MarlinSPI:
* Provides the default SPIClass interface plus some Marlin goodies such as a simplified
* interface for SPI DMA transfer.
*
*/
#define DATA_SIZE_8BIT SPI_DATASIZE_8BIT
#define DATA_SIZE_16BIT SPI_DATASIZE_16BIT
class MarlinSPI {
public:
MarlinSPI() : MarlinSPI(NC, NC, NC, NC) {}
MarlinSPI(pin_t mosi, pin_t miso, pin_t sclk, pin_t ssel = (pin_t)NC) : _mosiPin(mosi), _misoPin(miso), _sckPin(sclk), _ssPin(ssel) {
_spi.pin_miso = digitalPinToPinName(_misoPin);
_spi.pin_mosi = digitalPinToPinName(_mosiPin);
_spi.pin_sclk = digitalPinToPinName(_sckPin);
_spi.pin_ssel = digitalPinToPinName(_ssPin);
_dataSize = DATA_SIZE_8BIT;
_bitOrder = MSBFIRST;
_dataMode = SPI_MODE_0;
_spi.handle.State = HAL_SPI_STATE_RESET;
setClockDivider(SPI_SPEED_CLOCK_DIV2_MHZ);
}
void begin(void);
void end(void) {}
byte transfer(uint8_t _data);
uint8_t dmaTransfer(const void *transmitBuf, void *receiveBuf, uint16_t length);
uint8_t dmaSend(const void * transmitBuf, uint16_t length, bool minc = true);
/* These methods are deprecated and kept for compatibility.
* Use SPISettings with SPI.beginTransaction() to configure SPI parameters.
*/
void setBitOrder(BitOrder _order) { _bitOrder = _order; }
void setDataMode(uint8_t _mode) {
switch (_mode) {
case SPI_MODE0: _dataMode = SPI_MODE_0; break;
case SPI_MODE1: _dataMode = SPI_MODE_1; break;
case SPI_MODE2: _dataMode = SPI_MODE_2; break;
case SPI_MODE3: _dataMode = SPI_MODE_3; break;
}
}
void setClockDivider(uint8_t _div);
private:
void setupDma(SPI_HandleTypeDef &_spiHandle, DMA_HandleTypeDef &_dmaHandle, uint32_t direction, bool minc = false);
spi_t _spi;
DMA_HandleTypeDef _dmaTx;
DMA_HandleTypeDef _dmaRx;
BitOrder _bitOrder;
spi_mode_e _dataMode;
uint8_t _clockDivider;
uint32_t _speed;
uint32_t _dataSize;
pin_t _mosiPin;
pin_t _misoPin;
pin_t _sckPin;
pin_t _ssPin;
};

View file

@ -113,7 +113,7 @@ bool PersistentStore::access_start() {
// This must be the first time since power on that we have accessed the storage, or someone
// loaded and called write_data and never called access_finish.
// Lets go looking for the slot that holds our configuration.
if (eeprom_data_written) DEBUG_ECHOLN("Dangling EEPROM write_data");
if (eeprom_data_written) DEBUG_ECHOLNPGM("Dangling EEPROM write_data");
uint32_t address = FLASH_ADDRESS_START;
while (address <= FLASH_ADDRESS_END) {
uint32_t address_value = (*(__IO uint32_t*)address);

View file

@ -0,0 +1,57 @@
/**
* 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/>.
*
*/
#include "../../inc/MarlinConfigPre.h"
#if NEEDS_HARDWARE_PWM
#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
PinName pin_name = digitalPinToPinName(pin);
TIM_TypeDef *Instance = (TIM_TypeDef *)pinmap_peripheral(pin_name, PinMap_PWM); // Get HAL timer instance
LOOP_S_L_N(i, 0, NUM_HARDWARE_TIMERS) // Protect used timers
if (timer_instance[i] && timer_instance[i]->getHandle()->Instance == Instance)
return;
pwm_start(pin_name, f_desired, 0, RESOLUTION_8B_COMPARE_FORMAT);
}
void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255*/, const bool invert/*=false*/) {
PinName pin_name = digitalPinToPinName(pin);
TIM_TypeDef *Instance = (TIM_TypeDef *)pinmap_peripheral(pin_name, PinMap_PWM);
uint16_t adj_val = Instance->ARR * v / v_size;
if (invert) adj_val = Instance->ARR - adj_val;
switch (get_pwm_channel(pin_name)) {
case TIM_CHANNEL_1: LL_TIM_OC_SetCompareCH1(Instance, adj_val); break;
case TIM_CHANNEL_2: LL_TIM_OC_SetCompareCH2(Instance, adj_val); break;
case TIM_CHANNEL_3: LL_TIM_OC_SetCompareCH3(Instance, adj_val); break;
case TIM_CHANNEL_4: LL_TIM_OC_SetCompareCH4(Instance, adj_val); break;
}
}
#endif // NEEDS_HARDWARE_PWM

View file

@ -28,9 +28,6 @@
// #error "SPINDLE_LASER_PWM_PIN must use SERVO0, SERVO1 or SERVO3 connector"
//#endif
#if ENABLED(FAST_PWM_FAN) || SPINDLE_LASER_FREQUENCY
#error "Features requiring Hardware PWM (FAST_PWM_FAN, SPINDLE_LASER_FREQUENCY) are not yet supported on STM32."
#endif
#if ENABLED(SDCARD_EEPROM_EMULATION) && DISABLED(SDSUPPORT)
#undef SDCARD_EEPROM_EMULATION // Avoid additional error noise

View file

@ -21,12 +21,16 @@
*/
#pragma once
#include "../../../inc/MarlinConfig.h"
#ifdef STM32F1xx
#include "stm32f1xx_hal.h"
#define __IS_DMA_ENABLED(__HANDLE__) ((__HANDLE__)->Instance->CCR & DMA_CCR_EN)
#elif defined(STM32F4xx)
#include "stm32f4xx_hal.h"
#define __IS_DMA_ENABLED(__HANDLE__) ((__HANDLE__)->Instance->CR & DMA_SxCR_EN)
#else
#error FSMC TFT is currently only supported on STM32F1 and STM32F4 hardware.
#error "FSMC TFT is currently only supported on STM32F1 and STM32F4 hardware."
#endif
#ifndef LCD_READ_ID
@ -40,12 +44,6 @@
#define DATASIZE_16BIT SPI_DATASIZE_16BIT
#define TFT_IO_DRIVER TFT_FSMC
#ifdef STM32F1xx
#define __IS_DMA_ENABLED(__HANDLE__) ((__HANDLE__)->Instance->CCR & DMA_CCR_EN)
#elif defined(STM32F4xx)
#define __IS_DMA_ENABLED(__HANDLE__) ((__HANDLE__)->Instance->CR & DMA_SxCR_EN)
#endif
typedef struct {
__IO uint16_t REG;
__IO uint16_t RAM;

View file

@ -1,6 +1,9 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* 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

View file

@ -1,6 +1,9 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* 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

View file

@ -27,7 +27,6 @@
// Local defines
// ------------------------
#define NUM_HARDWARE_TIMERS 2
// Default timer priorities. Override by specifying alternate priorities in the board pins file.
// The TONE timer is not present here, as it currently cannot be set programmatically. It is set
@ -68,26 +67,23 @@
#endif
#ifdef STM32F0xx
#define MCU_TIMER_RATE (F_CPU) // Frequency of timer peripherals
#define MCU_STEP_TIMER 16
#define MCU_TEMP_TIMER 17
#elif defined(STM32F1xx)
#define MCU_TIMER_RATE (F_CPU)
#define MCU_STEP_TIMER 4
#define MCU_TEMP_TIMER 2
#elif defined(STM32F401xC) || defined(STM32F401xE)
#define MCU_TIMER_RATE (F_CPU / 2)
#define MCU_STEP_TIMER 9
#define MCU_TEMP_TIMER 10
#elif defined(STM32F4xx) || defined(STM32F7xx)
#define MCU_TIMER_RATE (F_CPU / 2)
#define MCU_STEP_TIMER 6 // STM32F401 has no TIM6, TIM7, or TIM8
#define MCU_TEMP_TIMER 14 // TIM7 is consumed by Software Serial if used.
#endif
#ifndef HAL_TIMER_RATE
#define HAL_TIMER_RATE MCU_TIMER_RATE
#define HAL_TIMER_RATE GetStepperTimerClkFreq()
#endif
#ifndef STEP_TIMER
#define STEP_TIMER MCU_STEP_TIMER
#endif
@ -115,6 +111,13 @@ HardwareTimer *timer_instance[NUM_HARDWARE_TIMERS] = { nullptr };
// Public functions
// ------------------------
uint32_t GetStepperTimerClkFreq() {
// Timer input clocks vary between devices, and in some cases between timers on the same device.
// Retrieve at runtime to ensure device compatibility. Cache result to avoid repeated overhead.
static uint32_t clkfreq = timer_instance[STEP_TIMER_NUM]->getTimerClkFreq();
return clkfreq;
}
// frequency is in Hertz
void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) {
if (!HAL_timer_initialized(timer_num)) {

View file

@ -43,6 +43,8 @@
#define hal_timer_t uint32_t
#define HAL_TIMER_TYPE_MAX UINT16_MAX
#define NUM_HARDWARE_TIMERS 2
#ifndef STEP_TIMER_NUM
#define STEP_TIMER_NUM 0 // Timer Index for Stepper
#endif
@ -57,7 +59,8 @@
// TODO: get rid of manual rate/prescale/ticks/cycles taken for procedures in stepper.cpp
#define STEPPER_TIMER_RATE 2000000 // 2 Mhz
#define STEPPER_TIMER_PRESCALE ((HAL_TIMER_RATE)/(STEPPER_TIMER_RATE))
extern uint32_t GetStepperTimerClkFreq();
#define STEPPER_TIMER_PRESCALE (GetStepperTimerClkFreq() / (STEPPER_TIMER_RATE))
#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // stepper timer ticks per µs
#define PULSE_TIMER_RATE STEPPER_TIMER_RATE
@ -102,7 +105,7 @@ void SetTimerInterruptPriorities();
// FORCE_INLINE because these are used in performance-critical situations
FORCE_INLINE bool HAL_timer_initialized(const uint8_t timer_num) {
return timer_instance[timer_num] != NULL;
return timer_instance[timer_num] != nullptr;
}
FORCE_INLINE static hal_timer_t HAL_timer_get_count(const uint8_t timer_num) {
return HAL_timer_initialized(timer_num) ? timer_instance[timer_num]->getCount() : 0;

View file

@ -21,7 +21,7 @@
#include "../../inc/MarlinConfigPre.h"
#if ENABLED(EMERGENCY_PARSER)
#if ENABLED(EMERGENCY_PARSER) && USBD_USE_CDC
#include "usb_serial.h"
#include "../../feature/e_parser.h"

View file

@ -25,23 +25,26 @@
#if ENABLED(USE_WATCHDOG)
#include "../../inc/MarlinConfig.h"
#define WDT_TIMEOUT_US TERN(WATCHDOG_DURATION_8S, 8000000, 4000000) // 4 or 8 second timeout
#include "watchdog.h"
#include <IWatchdog.h>
#include "../../inc/MarlinConfig.h"
void watchdog_init() {
#include "watchdog.h"
#include <IWatchdog.h>
void watchdog_init() {
#if DISABLED(DISABLE_WATCHDOG_INIT)
IWatchdog.begin(4000000); // 4 sec timeout
IWatchdog.begin(WDT_TIMEOUT_US);
#endif
}
}
void HAL_watchdog_refresh() {
void HAL_watchdog_refresh() {
IWatchdog.reload();
#if DISABLED(PINS_DEBUGGING) && PIN_EXISTS(LED)
TOGGLE(LED_PIN); // heartbeat indicator
#endif
}
}
#endif // USE_WATCHDOG
#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC

View file

@ -2,6 +2,9 @@
* 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
@ -16,45 +19,27 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#if defined(__STM32F1__) && !defined(HAVE_SW_SERIAL)
#pragma once
#include <SPI.h>
/**
* Empty class for Software Serial implementation (Custom RX/TX pins)
* Marlin currently requires 3 SPI classes:
*
* SPIClass:
* This class is normally provided by frameworks and has a semi-default interface.
* This is needed because some libraries reference it globally.
*
* SPISettings:
* Container for SPI configs for SPIClass. As above, libraries may reference it globally.
*
* These two classes are often provided by frameworks so we cannot extend them to add
* useful methods for Marlin.
*
* MarlinSPI:
* Provides the default SPIClass interface plus some Marlin goodies such as a simplified
* interface for SPI DMA transfer.
*
* TODO: Optionally use https://github.com/FYSETC/SoftwareSerialM if TMC UART is wanted
*/
#include "SoftwareSerial.h"
// Constructor
SoftwareSerial::SoftwareSerial(int8_t RX_pin, int8_t TX_pin) {}
// Public
void SoftwareSerial::begin(const uint32_t baudrate) {
}
bool SoftwareSerial::available() {
return false;
}
uint8_t SoftwareSerial::read() {
return 0;
}
uint16_t SoftwareSerial::write(uint8_t byte) {
return 0;
}
void SoftwareSerial::flush() {}
void SoftwareSerial::listen() {
listening = true;
}
void SoftwareSerial::stopListening() {
listening = false;
}
#endif // __STM32F1__
using MarlinSPI = SPIClass;

View file

@ -147,6 +147,18 @@ SPIClass::SPIClass(uint32_t spi_num) {
_currentSetting->state = SPI_STATE_IDLE;
}
SPIClass::SPIClass(int8_t mosi, int8_t miso, int8_t sclk, int8_t ssel) {
#if BOARD_NR_SPI >= 1
if (mosi == BOARD_SPI1_MOSI_PIN) SPIClass(1);
#endif
#if BOARD_NR_SPI >= 2
if (mosi == BOARD_SPI2_MOSI_PIN) SPIClass(2);
#endif
#if BOARD_NR_SPI >= 3
if (mosi == BOARD_SPI3_MOSI_PIN) SPIClass(3);
#endif
}
/**
* Set up/tear down
*/

View file

@ -163,6 +163,11 @@ public:
*/
SPIClass(uint32_t spiPortNumber);
/**
* Init using pins
*/
SPIClass(int8_t mosi, int8_t miso, int8_t sclk, int8_t ssel=-1);
/**
* @brief Equivalent to begin(SPI_1_125MHZ, MSBFIRST, 0).
*/

View file

@ -3,7 +3,7 @@ import sys
#dynamic build flags for generic compile options
if __name__ == "__main__":
args = " ".join([ "-std=gnu11",
args = " ".join([ "-std=gnu++14",
"-Os",
"-mcpu=cortex-m3",
"-mthumb",

View file

@ -25,11 +25,6 @@
* Test STM32F1-specific configuration values for errors at compile-time.
*/
#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."
#endif
#if ENABLED(SDCARD_EEPROM_EMULATION) && DISABLED(SDSUPPORT)
#undef SDCARD_EEPROM_EMULATION // Avoid additional error noise
#if USE_FALLBACK_EEPROM

View file

@ -49,10 +49,6 @@
#undef SDSS
#define SDSS SS_PIN
#if ENABLED(ENABLE_SPI3)
#define SPI_DEVICE 3
#elif ENABLED(ENABLE_SPI2)
#define SPI_DEVICE 2
#else
#ifndef SPI_DEVICE
#define SPI_DEVICE 1
#endif

View file

@ -1,6 +1,9 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* 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

View file

@ -1,6 +1,9 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* 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

View file

@ -33,6 +33,11 @@
#include <libmaple/iwdg.h>
#include "watchdog.h"
/**
* The watchdog clock is 40Khz. So for a 4s or 8s interval use a /256 preescaler and 625 or 1250 reload value (counts down to 0).
*/
#define STM32F1_WD_RELOAD TERN(WATCHDOG_DURATION_8S, 1250, 625) // 4 or 8 second timeout
void HAL_watchdog_refresh() {
#if DISABLED(PINS_DEBUGGING) && PIN_EXISTS(LED)
TOGGLE(LED_PIN); // heartbeat indicator
@ -49,7 +54,7 @@ void watchdogSetup() {
*
* @return No return
*
* @details The watchdog clock is 40Khz. We need a 4 seconds interval, so use a /256 preescaler and 625 reload value (counts down to 0)
* @details The watchdog clock is 40Khz. So for a 4s or 8s interval use a /256 preescaler and 625 or 1250 reload value (counts down to 0).
*/
void watchdog_init() {
#if DISABLED(DISABLE_WATCHDOG_INIT)

View file

@ -27,18 +27,9 @@
#include <libmaple/iwdg.h>
/**
* The watchdog clock is 40Khz. We need a 4 seconds interval, so use a /256 preescaler and
* 625 reload value (counts down to 0)
* use 1250 for 8 seconds
*/
#define STM32F1_WD_RELOAD 625
// Arduino STM32F1 core now has watchdog support
// Initialize watchdog with a 4 second countdown time
// Initialize watchdog with a 4 or 8 second countdown time
void watchdog_init();
// Reset watchdog. MUST be called at least every 4 seconds after the
// first watchdog_init or STM32F1 will reset.
// Reset watchdog. MUST be called every 4 or 8 seconds after the
// first watchdog_init or the STM32F1 will reset.
void HAL_watchdog_refresh();

View file

@ -25,14 +25,16 @@
#if ENABLED(USE_WATCHDOG)
#include "watchdog.h"
#include "watchdog.h"
IWDG_HandleTypeDef hiwdg;
#define WDT_TIMEOUT_COUNT TERN(WATCHDOG_DURATION_8S, 8192, 4096) // 4 or 8 second timeout
void watchdog_init() {
IWDG_HandleTypeDef hiwdg;
void watchdog_init() {
hiwdg.Instance = IWDG;
hiwdg.Init.Prescaler = IWDG_PRESCALER_32; //32kHz LSI clock and 32x prescalar = 1024Hz IWDG clock
hiwdg.Init.Reload = 4095; //4095 counts = 4 seconds at 1024Hz
hiwdg.Init.Prescaler = IWDG_PRESCALER_32; // 32kHz LSI clock and 32x prescalar = 1024Hz IWDG clock
hiwdg.Init.Reload = WDT_TIMEOUT_COUNT - 1;
if (HAL_IWDG_Init(&hiwdg) != HAL_OK) {
//Error_Handler();
}
@ -41,15 +43,15 @@
TOGGLE(LED_PIN); // heartbeat indicator
#endif
}
}
}
void HAL_watchdog_refresh() {
void HAL_watchdog_refresh() {
/* Refresh IWDG: reload counter */
if (HAL_IWDG_Refresh(&hiwdg) != HAL_OK) {
/* Refresh Error */
//Error_Handler();
}
}
}
#endif // USE_WATCHDOG
#endif // STM32GENERIC && (STM32F4 || STM32F7)

View file

@ -27,9 +27,11 @@
#include "watchdog.h"
#define WDT_TIMEOUT_MS TERN(WATCHDOG_DURATION_8S, 8000, 4000) // 4 or 8 second timeout
void watchdog_init() {
WDOG_TOVALH = 0;
WDOG_TOVALL = 4000;
WDOG_TOVALL = WDT_TIMEOUT_MS;
WDOG_STCTRLH = WDOG_STCTRLH_WDOGEN;
}

View file

@ -27,9 +27,11 @@
#include "watchdog.h"
#define WDT_TIMEOUT_MS TERN(WATCHDOG_DURATION_8S, 8000, 4000) // 4 or 8 second timeout
void watchdog_init() {
WDOG_TOVALH = 0;
WDOG_TOVALL = 4000;
WDOG_TOVALL = WDT_TIMEOUT_MS;
WDOG_STCTRLH = WDOG_STCTRLH_WDOGEN;
}

View file

@ -19,31 +19,27 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#ifdef __IMXRT1062__
/**
* HAL Watchdog for Teensy 4.0 (IMXRT1062DVL6A) / 4.1 (IMXRT1062DVJ6A)
*/
#ifdef __IMXRT1062__
#include "../../inc/MarlinConfig.h"
#if ENABLED(USE_WATCHDOG)
#include "watchdog.h"
// 4 seconds timeout
#define WDTO 4 //seconds
#define WDT_TIMEOUT TERN(WATCHDOG_DURATION_8S, 8, 4) // 4 or 8 second timeout
uint8_t timeoutval = (WDTO - 0.5f) / 0.5f;
constexpr uint8_t timeoutval = (WDT_TIMEOUT - 0.5f) / 0.5f;
void watchdog_init() {
CCM_CCGR3 |= CCM_CCGR3_WDOG1(3); // enable WDOG1 clocks
WDOG1_WMCR = 0; // disable power down PDE
WDOG1_WCR |= WDOG_WCR_SRS | WDOG_WCR_WT(timeoutval);
WDOG1_WCR |= WDOG_WCR_WDE | WDOG_WCR_WDT | WDOG_WCR_SRE;
}
void HAL_watchdog_refresh() {

View file

@ -248,7 +248,7 @@ bool wait_for_heatup = true;
bool wait_for_user; // = false;
void wait_for_user_response(millis_t ms/*=0*/, const bool no_sleep/*=false*/) {
TERN(ADVANCED_PAUSE_FEATURE,,UNUSED(no_sleep));
UNUSED(no_sleep);
KEEPALIVE_STATE(PAUSED_FOR_USER);
wait_for_user = true;
if (ms) ms += millis(); // expire time
@ -509,7 +509,7 @@ inline void manage_inactivity(const bool ignore_stepper_queue=false) {
kill();
}
// M18 / M94 : Handle steppers inactive time timeout
// M18 / M84 : Handle steppers inactive time timeout
if (gcode.stepper_inactive_time) {
static bool already_shutdown_steppers; // = false

View file

@ -94,9 +94,11 @@ extern bool wait_for_heatup;
#if ENABLED(AUTO_POWER_CONTROL)
#define PSU_ON() powerManager.power_on()
#define PSU_OFF() powerManager.power_off()
#define PSU_OFF_SOON() powerManager.power_off_soon()
#else
#define PSU_ON() PSU_PIN_ON()
#define PSU_OFF() PSU_PIN_OFF()
#define PSU_OFF_SOON PSU_OFF
#endif
#endif

View file

@ -69,49 +69,50 @@
#define BOARD_MKS_GEN_L 1113 // MKS GEN L
#define BOARD_KFB_2 1114 // BigTreeTech or BIQU KFB2.0
#define BOARD_ZRIB_V20 1115 // zrib V2.0 control board (Chinese knock off RAMPS replica)
#define BOARD_FELIX2 1116 // Felix 2.0+ Electronics Board (RAMPS like)
#define BOARD_RIGIDBOARD 1117 // Invent-A-Part RigidBoard
#define BOARD_RIGIDBOARD_V2 1118 // Invent-A-Part RigidBoard V2
#define BOARD_SAINSMART_2IN1 1119 // Sainsmart 2-in-1 board
#define BOARD_ULTIMAKER 1120 // Ultimaker
#define BOARD_ULTIMAKER_OLD 1121 // Ultimaker (Older electronics. Pre 1.5.4. This is rare)
#define BOARD_AZTEEG_X3 1122 // Azteeg X3
#define BOARD_AZTEEG_X3_PRO 1123 // Azteeg X3 Pro
#define BOARD_ULTIMAIN_2 1124 // Ultimainboard 2.x (Uses TEMP_SENSOR 20)
#define BOARD_RUMBA 1125 // Rumba
#define BOARD_RUMBA_RAISE3D 1126 // Raise3D N series Rumba derivative
#define BOARD_RL200 1127 // Rapide Lite 200 (v1, low-cost RUMBA clone with drv)
#define BOARD_FORMBOT_TREX2PLUS 1128 // Formbot T-Rex 2 Plus
#define BOARD_FORMBOT_TREX3 1129 // Formbot T-Rex 3
#define BOARD_FORMBOT_RAPTOR 1130 // Formbot Raptor
#define BOARD_FORMBOT_RAPTOR2 1131 // Formbot Raptor 2
#define BOARD_BQ_ZUM_MEGA_3D 1132 // bq ZUM Mega 3D
#define BOARD_MAKEBOARD_MINI 1133 // MakeBoard Mini v2.1.2 is a control board sold by MicroMake
#define BOARD_TRIGORILLA_13 1134 // TriGorilla Anycubic version 1.3-based on RAMPS EFB
#define BOARD_TRIGORILLA_14 1135 // ... Ver 1.4
#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_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
#define BOARD_VORON 1143 // VORON Design
#define BOARD_TRONXY_V3_1_0 1144 // Tronxy TRONXY-V3-1.0
#define BOARD_Z_BOLT_X_SERIES 1145 // Z-Bolt X Series
#define BOARD_TT_OSCAR 1146 // TT OSCAR
#define BOARD_OVERLORD 1147 // Overlord/Overlord Pro
#define BOARD_HJC2560C_REV1 1148 // ADIMLab Gantry v1
#define BOARD_HJC2560C_REV2 1149 // ADIMLab Gantry v2
#define BOARD_TANGO 1150 // BIQU Tango V1
#define BOARD_MKS_GEN_L_V2 1151 // MKS GEN L V2
#define BOARD_MKS_GEN_L_V21 1152 // MKS GEN L V2.1
#define BOARD_COPYMASTER_3D 1153 // Copymaster 3D
#define BOARD_ORTUR_4 1154 // Ortur 4
#define BOARD_TENLOG_D3_HERO 1155 // Tenlog D3 Hero IDEX printer
#define BOARD_RAMPS_S_12_EEFB 1156 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Fan, Bed)
#define BOARD_RAMPS_S_12_EEEB 1157 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Hotend2, Bed)
#define BOARD_RAMPS_S_12_EFFB 1158 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend, Fan0, Fan1, Bed)
#define BOARD_ZRIB_V52 1116 // zrib V5.2 control board (Chinese knock off RAMPS replica)
#define BOARD_FELIX2 1117 // Felix 2.0+ Electronics Board (RAMPS like)
#define BOARD_RIGIDBOARD 1118 // Invent-A-Part RigidBoard
#define BOARD_RIGIDBOARD_V2 1119 // Invent-A-Part RigidBoard V2
#define BOARD_SAINSMART_2IN1 1120 // Sainsmart 2-in-1 board
#define BOARD_ULTIMAKER 1121 // Ultimaker
#define BOARD_ULTIMAKER_OLD 1122 // Ultimaker (Older electronics. Pre 1.5.4. This is rare)
#define BOARD_AZTEEG_X3 1123 // Azteeg X3
#define BOARD_AZTEEG_X3_PRO 1124 // Azteeg X3 Pro
#define BOARD_ULTIMAIN_2 1125 // Ultimainboard 2.x (Uses TEMP_SENSOR 20)
#define BOARD_RUMBA 1126 // Rumba
#define BOARD_RUMBA_RAISE3D 1127 // Raise3D N series Rumba derivative
#define BOARD_RL200 1128 // Rapide Lite 200 (v1, low-cost RUMBA clone with drv)
#define BOARD_FORMBOT_TREX2PLUS 1129 // Formbot T-Rex 2 Plus
#define BOARD_FORMBOT_TREX3 1130 // Formbot T-Rex 3
#define BOARD_FORMBOT_RAPTOR 1131 // Formbot Raptor
#define BOARD_FORMBOT_RAPTOR2 1132 // Formbot Raptor 2
#define BOARD_BQ_ZUM_MEGA_3D 1133 // bq ZUM Mega 3D
#define BOARD_MAKEBOARD_MINI 1134 // MakeBoard Mini v2.1.2 is a control board sold by MicroMake
#define BOARD_TRIGORILLA_13 1135 // TriGorilla Anycubic version 1.3-based on RAMPS EFB
#define BOARD_TRIGORILLA_14 1136 // ... Ver 1.4
#define BOARD_TRIGORILLA_14_11 1137 // ... Rev 1.1 (new servo pin order)
#define BOARD_RAMPS_ENDER_4 1138 // Creality: Ender-4, CR-8
#define BOARD_RAMPS_CREALITY 1139 // Creality: CR10S, CR20, CR-X
#define BOARD_DAGOMA_F5 1140 // Dagoma F5
#define BOARD_FYSETC_F6_13 1141 // FYSETC F6 1.3
#define BOARD_FYSETC_F6_14 1142 // FYSETC F6 1.4
#define BOARD_DUPLICATOR_I3_PLUS 1143 // Wanhao Duplicator i3 Plus
#define BOARD_VORON 1144 // VORON Design
#define BOARD_TRONXY_V3_1_0 1145 // Tronxy TRONXY-V3-1.0
#define BOARD_Z_BOLT_X_SERIES 1146 // Z-Bolt X Series
#define BOARD_TT_OSCAR 1147 // TT OSCAR
#define BOARD_OVERLORD 1148 // Overlord/Overlord Pro
#define BOARD_HJC2560C_REV1 1149 // ADIMLab Gantry v1
#define BOARD_HJC2560C_REV2 1150 // ADIMLab Gantry v2
#define BOARD_TANGO 1151 // BIQU Tango V1
#define BOARD_MKS_GEN_L_V2 1152 // MKS GEN L V2
#define BOARD_MKS_GEN_L_V21 1153 // MKS GEN L V2.1
#define BOARD_COPYMASTER_3D 1154 // Copymaster 3D
#define BOARD_ORTUR_4 1155 // Ortur 4
#define BOARD_TENLOG_D3_HERO 1156 // Tenlog D3 Hero IDEX printer
#define BOARD_RAMPS_S_12_EEFB 1157 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Fan, Bed)
#define BOARD_RAMPS_S_12_EEEB 1158 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Hotend2, Bed)
#define BOARD_RAMPS_S_12_EFFB 1159 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend, Fan0, Fan1, Bed)
//
// RAMBo and derivatives
@ -378,6 +379,7 @@
#define BOARD_MRR_ESPA 6001 // MRR ESPA board based on ESP32 (native pins only)
#define BOARD_MRR_ESPE 6002 // MRR ESPE board based on ESP32 (with I2S stepper stream)
#define BOARD_E4D_BOX 6003 // E4d@BOX
#define BOARD_FYSETC_E4 6004 // FYSETC E4
//
// SAMD51 ARM Cortex M4

View file

@ -196,6 +196,9 @@
#define __TERN(T,V...) ___TERN(_CAT(_NO,T),V) // Prepend '_NO' to get '_NOT_0' or '_NOT_1'
#define ___TERN(P,V...) THIRD(P,V) // If first argument has a comma, A. Else B.
#define IF_ENABLED TERN_
#define IF_DISABLED(O,A) TERN(O,,A)
#define ANY(V...) !DISABLED(V)
#define NONE(V...) DISABLED(V)
#define ALL(V...) ENABLED(V)

View file

@ -54,17 +54,17 @@ public:
#endif
static inline float get_measurement(const AxisEnum a) {
UNUSED(a);
// Return the measurement averaged over all readings
return TERN(MEASURE_BACKLASH_WHEN_PROBING
, measured_count[a] > 0 ? measured_mm[a] / measured_count[a] : 0
, 0
);
TERN(MEASURE_BACKLASH_WHEN_PROBING,,UNUSED(a));
}
static inline bool has_measurement(const AxisEnum a) {
UNUSED(a);
return TERN0(MEASURE_BACKLASH_WHEN_PROBING, measured_count[a] > 0);
TERN(MEASURE_BACKLASH_WHEN_PROBING,,UNUSED(a));
}
static inline bool has_any_measurement() {

View file

@ -34,6 +34,8 @@ uint8_t ControllerFan::speed;
#if ENABLED(CONTROLLER_FAN_EDITABLE)
controllerFan_settings_t ControllerFan::settings; // {0}
#else
const controllerFan_settings_t &ControllerFan::settings = controllerFan_defaults;
#endif
void ControllerFan::setup() {

View file

@ -58,7 +58,7 @@ class ControllerFan {
#if ENABLED(CONTROLLER_FAN_EDITABLE)
static controllerFan_settings_t settings;
#else
static const controllerFan_settings_t constexpr &settings = controllerFan_defaults;
static const controllerFan_settings_t &settings;
#endif
static inline bool state() { return speed > 0; }
static inline void init() { reset(); }

View file

@ -110,7 +110,7 @@ public:
#if CONJOINED_NEOPIXEL
adaneo2.show();
#else
TERN(NEOPIXEL2_SEPARATE,,adaneo1.setPin(NEOPIXEL2_PIN));
IF_DISABLED(NEOPIXEL2_SEPARATE, adaneo1.setPin(NEOPIXEL2_PIN));
adaneo1.show();
adaneo1.setPin(NEOPIXEL_PIN);
#endif

View file

@ -126,4 +126,12 @@ void Power::power_off() {
}
}
void Power::power_off_soon() {
#if POWER_OFF_DELAY
lastPowerOn = millis() - SEC_TO_MS(POWER_TIMEOUT) + SEC_TO_MS(POWER_OFF_DELAY);
#else
power_off();
#endif
}
#endif // AUTO_POWER_CONTROL

View file

@ -32,6 +32,7 @@ class Power {
static void check();
static void power_on();
static void power_off();
static void power_off_soon();
private:
static millis_t lastPowerOn;
static bool is_power_needed();

View file

@ -30,6 +30,10 @@
#include "spindle_laser.h"
#if ENABLED(SPINDLE_SERVO)
#include "../module/servo.h"
#endif
SpindleLaser cutter;
uint8_t SpindleLaser::power;
bool SpindleLaser::isReady; // Ready to apply power setting from the UI to OCR
@ -45,7 +49,11 @@ cutter_power_t SpindleLaser::menuPower, // Power s
// Init the cutter to a safe OFF state
//
void SpindleLaser::init() {
#if ENABLED(SPINDLE_SERVO)
MOVE_SERVO(SPINDLE_SERVO_NR, SPINDLE_SERVO_MIN);
#else
OUT_WRITE(SPINDLE_LASER_ENA_PIN, !SPINDLE_LASER_ACTIVE_STATE); // Init spindle to off
#endif
#if ENABLED(SPINDLE_CHANGE_DIR)
OUT_WRITE(SPINDLE_DIR_PIN, SPINDLE_INVERT_DIR ? 255 : 0); // Init rotation to clockwise (M3)
#endif
@ -97,6 +105,8 @@ void SpindleLaser::apply_power(const uint8_t opwr) {
ocr_off();
isReady = false;
}
#elif ENABLED(SPINDLE_SERVO)
MOVE_SERVO(SPINDLE_SERVO_NR, power);
#else
WRITE(SPINDLE_LASER_ENA_PIN, enabled() ? SPINDLE_LASER_ACTIVE_STATE : !SPINDLE_LASER_ACTIVE_STATE);
isReady = true;

View file

@ -35,29 +35,33 @@
#endif
#define PCT_TO_PWM(X) ((X) * 255 / 100)
#define PCT_TO_SERVO(X) ((X) * 180 / 100)
#ifndef SPEED_POWER_INTERCEPT
#define SPEED_POWER_INTERCEPT 0
#endif
#define SPEED_POWER_FLOOR TERN(CUTTER_POWER_RELATIVE, SPEED_POWER_MIN, 0)
// #define _MAP(N,S1,S2,D1,D2) ((N)*_MAX((D2)-(D1),0)/_MAX((S2)-(S1),1)+(D1))
class SpindleLaser {
public:
static constexpr float
min_pct = round(TERN(CUTTER_POWER_RELATIVE, 0, (100 * float(SPEED_POWER_MIN) / TERN(SPINDLE_FEATURE, float(SPEED_POWER_MAX), 100)))),
max_pct = round(TERN(SPINDLE_FEATURE, 100, float(SPEED_POWER_MAX)));
min_pct = TERN(CUTTER_POWER_RELATIVE, 0, TERN(SPINDLE_FEATURE, round(100.0f * (SPEED_POWER_MIN) / (SPEED_POWER_MAX)), SPEED_POWER_MIN)),
max_pct = TERN(SPINDLE_FEATURE, 100, SPEED_POWER_MAX);
static const inline uint8_t pct_to_ocr(const float pct) { return uint8_t(PCT_TO_PWM(pct)); }
// cpower = configured values (ie SPEED_POWER_MAX)
static const inline uint8_t cpwr_to_pct(const cutter_cpower_t cpwr) { // configured value to pct
return unitPower ? round(100 * (cpwr - SPEED_POWER_FLOOR) / (SPEED_POWER_MAX - SPEED_POWER_FLOOR)) : 0;
// cpower = configured values (e.g., SPEED_POWER_MAX)
// Convert configured power range to a percentage
static const inline uint8_t cpwr_to_pct(const cutter_cpower_t cpwr) {
constexpr cutter_cpower_t power_floor = TERN(CUTTER_POWER_RELATIVE, SPEED_POWER_MIN, 0),
power_range = SPEED_POWER_MAX - power_floor;
return unitPower ? round(100.0f * (cpwr - power_floor) / power_range) : 0;
}
// Convert a configured value (cpower)(ie SPEED_POWER_STARTUP) to unit power (upwr, upower),
// which can be PWM, Percent, or RPM (rel/abs).
// Convert a cpower (e.g., SPEED_POWER_STARTUP) to unit power (upwr, upower),
// which can be PWM, Percent, Servo angle, or RPM (rel/abs).
static const inline cutter_power_t cpwr_to_upwr(const cutter_cpower_t cpwr) { // STARTUP power to Unit power
const cutter_power_t upwr = (
#if ENABLED(SPINDLE_FEATURE)
@ -66,6 +70,8 @@ public:
cpwr // to RPM
#elif CUTTER_UNIT_IS(PERCENT) // to PCT
cpwr_to_pct(cpwr)
#elif CUTTER_UNIT_IS(SERVO) // to SERVO angle
PCT_TO_SERVO(cpwr_to_pct(cpwr))
#else // to PWM
PCT_TO_PWM(cpwr_to_pct(cpwr))
#endif
@ -235,7 +241,7 @@ public:
// Inline modes of all other functions; all enable planner inline power control
static inline void set_inline_enabled(const bool enable) {
if (enable)
inline_power(cpwr_to_upwr(SPEED_POWER_STARTUP));
inline_power(255);
else {
isReady = false;
unitPower = menuPower = 0;

View file

@ -0,0 +1,59 @@
/**
* 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/>.
*
*/
#include "../inc/MarlinConfigPre.h"
#if !WITHIN(TRAMMING_SCREW_THREAD, 30, 51) || TRAMMING_SCREW_THREAD % 10 > 1
#error "TRAMMING_SCREW_THREAD must be equal to 30, 31, 40, 41, 50, or 51."
#endif
constexpr xy_pos_t screws_tilt_adjust_pos[] = TRAMMING_POINT_XY;
#define G35_PROBE_COUNT COUNT(screws_tilt_adjust_pos)
static_assert(G35_PROBE_COUNT >= 3, "TRAMMING_POINT_XY requires at least 3 XY positions.");
extern const char point_name_1[], point_name_2[], point_name_3[]
#ifdef TRAMMING_POINT_NAME_4
, point_name_4[]
#ifdef TRAMMING_POINT_NAME_5
, point_name_5[]
#endif
#endif
;
#define _NR_TRAM_NAMES 2
#ifdef TRAMMING_POINT_NAME_3
#undef _NR_TRAM_NAMES
#define _NR_TRAM_NAMES 3
#ifdef TRAMMING_POINT_NAME_4
#undef _NR_TRAM_NAMES
#define _NR_TRAM_NAMES 4
#ifdef TRAMMING_POINT_NAME_5
#undef _NR_TRAM_NAMES
#define _NR_TRAM_NAMES 5
#endif
#endif
#endif
static_assert(_NR_TRAM_NAMES >= G35_PROBE_COUNT, "Define enough TRAMMING_POINT_NAME_s for all TRAMMING_POINT_XY entries.");
#undef _NR_TRAM_NAMES
extern PGM_P const tramming_point_name[];

View file

@ -36,19 +36,23 @@
#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
#include "../../core/debug_out.h"
constexpr xy_pos_t screws_tilt_adjust_pos[] = TRAMMING_POINT_XY;
//
// Define tramming point names.
//
static PGMSTR(point_name_1, TRAMMING_POINT_NAME_1);
static PGMSTR(point_name_2, TRAMMING_POINT_NAME_2);
static PGMSTR(point_name_3, TRAMMING_POINT_NAME_3);
#include "../../feature/tramming.h" // Validate
PGMSTR(point_name_1, TRAMMING_POINT_NAME_1);
PGMSTR(point_name_2, TRAMMING_POINT_NAME_2);
PGMSTR(point_name_3, TRAMMING_POINT_NAME_3);
#ifdef TRAMMING_POINT_NAME_4
static PGMSTR(point_name_4, TRAMMING_POINT_NAME_4);
PGMSTR(point_name_4, TRAMMING_POINT_NAME_4);
#ifdef TRAMMING_POINT_NAME_5
static PGMSTR(point_name_5, TRAMMING_POINT_NAME_5);
PGMSTR(point_name_5, TRAMMING_POINT_NAME_5);
#endif
#endif
static PGM_P const tramming_point_name[] PROGMEM = {
PGM_P const tramming_point_name[] PROGMEM = {
point_name_1, point_name_2, point_name_3
#ifdef TRAMMING_POINT_NAME_4
, point_name_4
@ -58,14 +62,6 @@ static PGM_P const tramming_point_name[] PROGMEM = {
#endif
};
#define G35_PROBE_COUNT COUNT(screws_tilt_adjust_pos)
#if !WITHIN(TRAMMING_SCREW_THREAD, 30, 51) || TRAMMING_SCREW_THREAD % 10 > 1
#error "TRAMMING_SCREW_THREAD must be equal to 30, 31, 40, 41, 50, or 51."
#endif
static_assert(G35_PROBE_COUNT > 2, "TRAMMING_POINT_XY requires at least 3 XY positions.");
/**
* G35: Read bed corners to help adjust bed screws
*
@ -124,8 +120,7 @@ void GcodeSuite::G35() {
// In BLTOUCH HS mode, the probe travels in a deployed state.
// Users of G35 might have a badly misaligned bed, so raise Z by the
// length of the deployed pin (BLTOUCH stroke < 7mm)
current_position.z = (Z_CLEARANCE_BETWEEN_PROBES) + (7 * ENABLED(BLTOUCH_HS_MODE));
do_blocking_move_to_z((Z_CLEARANCE_BETWEEN_PROBES) + TERN0(BLTOUCH_HS_MODE, 7));
const float z_probed_height = probe.probe_at_point(screws_tilt_adjust_pos[i], PROBE_PT_RAISE, 0, true);
if (isnan(z_probed_height)) {

View file

@ -69,9 +69,13 @@ void GcodeSuite::M3_M4(const bool is_M4) {
auto get_s_power = [] {
if (parser.seenval('S')) {
const float spwr = parser.value_float();
#if ENABLED(SPINDLE_SERVO)
cutter.unitPower = spwr;
#else
cutter.unitPower = TERN(SPINDLE_LASER_PWM,
cutter.power_to_range(cutter_power_t(round(spwr))),
spwr > 0 ? 255 : 0);
#endif
}
else
cutter.unitPower = cutter.cpwr_to_upwr(SPEED_POWER_STARTUP);
@ -108,6 +112,8 @@ void GcodeSuite::M3_M4(const bool is_M4) {
}
else
cutter.set_power(cutter.upower_to_ocr(get_s_power()));
#elif ENABLED(SPINDLE_SERVO)
cutter.set_power(get_s_power());
#else
cutter.set_enabled(true);
#endif

View file

@ -105,7 +105,7 @@ void GcodeSuite::M81() {
#if HAS_SUICIDE
suicide();
#elif ENABLED(PSU_CONTROL)
PSU_OFF();
PSU_OFF_SOON();
#endif
LCD_MESSAGEPGM_P(PSTR(MACHINE_NAME " " STR_OFF "."));

View file

@ -431,7 +431,10 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 28: M28(); break; // M28: Start SD write
case 29: M29(); break; // M29: Stop SD write
case 30: M30(); break; // M30 <filename> Delete File
#if HAS_MEDIA_SUBCALLS
case 32: M32(); break; // M32: Select file and start SD print
#endif
#if ENABLED(LONG_FILENAME_HOST_SUPPORT)
case 33: M33(); break; // M33: Get the long full path to a file or folder

View file

@ -541,7 +541,7 @@ private:
static void M31();
#if ENABLED(SDSUPPORT)
static void M32();
TERN_(HAS_MEDIA_SUBCALLS, static void M32());
TERN_(LONG_FILENAME_HOST_SUPPORT, static void M33());
#if BOTH(SDCARD_SORT_ALPHA, SDSORT_GCODE)
static void M34();

View file

@ -22,7 +22,7 @@
#include "../../inc/MarlinConfig.h"
#if ENABLED(SDSUPPORT)
#if HAS_MEDIA_SUBCALLS
#include "../gcode.h"
#include "../../sd/cardreader.h"
@ -56,4 +56,4 @@ void GcodeSuite::M32() {
}
}
#endif // SDSUPPORT
#endif // HAS_MEDIA_SUBCALLS

View file

@ -105,7 +105,7 @@ void GcodeSuite::M104() {
* mode, for instance in a dual extruder setup, without affecting the running
* print timer.
*/
thermalManager.check_timer_autostart(false, true);
thermalManager.auto_job_check_timer(false, true);
#endif
}
@ -182,7 +182,7 @@ void GcodeSuite::M109() {
* standby mode, (e.g., in a dual extruder setup) without affecting
* the running print timer.
*/
thermalManager.check_timer_autostart(true, true);
thermalManager.auto_job_check_timer(true, true);
#endif
#if HAS_DISPLAY

View file

@ -81,7 +81,7 @@ void GcodeSuite::M140() {
* temperatures need to be set below mintemp. Order of M140, M104, and M141
* at the end of the print does not matter.
*/
thermalManager.check_timer_autostart(false, true);
thermalManager.auto_job_check_timer(false, true);
#endif
}
}
@ -128,7 +128,7 @@ void GcodeSuite::M190() {
thermalManager.setTargetBed(temp);
TERN_(PRINTJOB_TIMER_AUTOSTART, thermalManager.check_timer_autostart(true, false));
TERN_(PRINTJOB_TIMER_AUTOSTART, thermalManager.auto_job_check_timer(true, false));
ui.set_status_P(thermalManager.isHeatingBed() ? GET_TEXT(MSG_BED_HEATING) : GET_TEXT(MSG_BED_COOLING));

View file

@ -60,7 +60,7 @@ void GcodeSuite::M141() {
* temperatures need to be set below mintemp. Order of M140, M104, and M141
* at the end of the print does not matter.
*/
thermalManager.check_timer_autostart(false, true);
thermalManager.auto_job_check_timer(false, true);
#endif
}
}
@ -75,7 +75,7 @@ void GcodeSuite::M191() {
const bool no_wait_for_cooling = parser.seenval('S');
if (no_wait_for_cooling || parser.seenval('R')) {
thermalManager.setTargetChamber(parser.value_celsius());
TERN_(PRINTJOB_TIMER_AUTOSTART, thermalManager.check_timer_autostart(true, false));
TERN_(PRINTJOB_TIMER_AUTOSTART, thermalManager.auto_job_check_timer(true, false));
}
else return;

View file

@ -235,7 +235,7 @@
#define BOARD_ST7920_DELAY_2 DELAY_NS(125)
#define BOARD_ST7920_DELAY_3 DELAY_NS(125)
#elif ANY(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER, ANET_FULL_GRAPHICS_LCD, BQ_LCD_SMART_CONTROLLER)
#elif ANY(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER, ANET_FULL_GRAPHICS_LCD, ANET_FULL_GRAPHICS_LCD_ALT_WIRING, BQ_LCD_SMART_CONTROLLER)
#define IS_RRD_FG_SC 1
@ -740,7 +740,7 @@
#if NONE(FIL_RUNOUT8_PULLUP, FIL_RUNOUT8_PULLDOWN)
#define FIL_RUNOUT8_PULLUP
#endif
#else // !ENABLED(FIL_RUNOUT_PULLUP)
#else // !FIL_RUNOUT_PULLUP
#if NONE(FIL_RUNOUT1_PULLUP, FIL_RUNOUT1_PULLDOWN)
#define FIL_RUNOUT1_PULLDOWN
#endif
@ -765,9 +765,9 @@
#if NONE(FIL_RUNOUT8_PULLUP, FIL_RUNOUT8_PULLDOWN)
#define FIL_RUNOUT8_PULLDOWN
#endif
#endif // ENABLED(FIL_RUNOUT_PULLUP)
#endif // EITHER(FIL_RUNOUT_PULLUP, FIL_RUNOUT_PULLDOWN)
#else // !ENABLED(DISTINCT_FIL_RUNOUT_STATES)
#endif // FIL_RUNOUT_PULLUP
#endif // FIL_RUNOUT_PULLUP || FIL_RUNOUT_PULLDOWN
#else // !DISTINCT_FIL_RUNOUT_STATES
#undef FIL_RUNOUT1_STATE
#undef FIL_RUNOUT1_PULLUP
#undef FIL_RUNOUT1_PULLDOWN
@ -830,7 +830,11 @@
#define FIL_RUNOUT8_PULLUP FIL_RUNOUT_PULLUP
#define FIL_RUNOUT8_PULLDOWN FIL_RUNOUT_PULLDOWN
#endif
#endif // ENABLED(DISTINCT_FIL_RUNOUT_STATES)
#endif // DISTINCT_FIL_RUNOUT_STATES
#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL)
#undef PROBE_MANUALLY
#endif
#if ANY(HAS_BED_PROBE, PROBE_MANUALLY, MESH_BED_LEVELING)
#define PROBE_SELECTED 1
@ -904,6 +908,7 @@
#define HAS_PROBING_PROCEDURE 1
#endif
#if !HAS_LEVELING
#undef PROBE_MANUALLY
#undef RESTORE_LEVELING_AFTER_G28
#endif

View file

@ -33,7 +33,7 @@
// Determine NUM_SERVOS if none was supplied
#ifndef NUM_SERVOS
#define NUM_SERVOS 0
#if ANY(CHAMBER_VENT, HAS_Z_SERVO_PROBE, SWITCHING_EXTRUDER, SWITCHING_NOZZLE)
#if ANY(HAS_Z_SERVO_PROBE, CHAMBER_VENT, SWITCHING_TOOLHEAD, SWITCHING_EXTRUDER, SWITCHING_NOZZLE, SPINDLE_SERVO)
#if NUM_SERVOS <= Z_PROBE_SERVO_NR
#undef NUM_SERVOS
#define NUM_SERVOS (Z_PROBE_SERVO_NR + 1)
@ -62,6 +62,10 @@
#undef NUM_SERVOS
#define NUM_SERVOS (SWITCHING_EXTRUDER_E23_SERVO_NR + 1)
#endif
#if NUM_SERVOS <= SPINDLE_SERVO_NR
#undef NUM_SERVOS
#define NUM_SERVOS (SPINDLE_SERVO_NR + 1)
#endif
#endif
#endif
@ -142,6 +146,10 @@
#define HAS_PRINT_PROGRESS 1
#endif
#if ENABLED(SDSUPPORT) && SD_PROCEDURE_DEPTH
#define HAS_MEDIA_SUBCALLS 1
#endif
#if HAS_PRINT_PROGRESS && EITHER(PRINT_PROGRESS_SHOW_DECIMALS, SHOW_REMAINING_TIME)
#define HAS_PRINT_PROGRESS_PERMYRIAD 1
#endif

View file

@ -416,8 +416,13 @@
#endif
#endif
#if !defined(PSU_POWERUP_DELAY) && ENABLED(PSU_CONTROL)
#if ENABLED(PSU_CONTROL)
#ifndef PSU_POWERUP_DELAY
#define PSU_POWERUP_DELAY 250
#endif
#ifndef POWER_OFF_DELAY
#define POWER_OFF_DELAY 0
#endif
#endif
/**
@ -431,7 +436,7 @@
#endif
#if TEMP_SENSOR_0 == -5 || TEMP_SENSOR_0 == -3 || TEMP_SENSOR_0 == -2
#define HEATER_0_USES_MAX6675
#define HEATER_0_USES_MAX6675 1
#if TEMP_SENSOR_0 == -3
#define HEATER_0_MAX6675_TMIN -270
#define HEATER_0_MAX6675_TMAX 1800
@ -440,19 +445,19 @@
#define HEATER_0_MAX6675_TMAX 1024
#endif
#if TEMP_SENSOR_0 == -5
#define MAX6675_IS_MAX31865
#define MAX6675_IS_MAX31865 1
#elif TEMP_SENSOR_0 == -3
#define MAX6675_IS_MAX31855
#define MAX6675_IS_MAX31855 1
#endif
#elif TEMP_SENSOR_0 == -4
#define HEATER_0_USES_AD8495
#define HEATER_0_USES_AD8495 1
#elif TEMP_SENSOR_0 == -1
#define HEATER_0_USES_AD595
#define HEATER_0_USES_AD595 1
#elif TEMP_SENSOR_0 > 0
#define THERMISTOR_HEATER_0 TEMP_SENSOR_0
#define HEATER_0_USES_THERMISTOR
#define HEATER_0_USES_THERMISTOR 1
#if TEMP_SENSOR_0 == 1000
#define HEATER_0_USER_THERMISTOR
#define HEATER_0_USER_THERMISTOR 1
#endif
#else
#undef HEATER_0_MINTEMP
@ -460,7 +465,7 @@
#endif
#if TEMP_SENSOR_1 == -5 || TEMP_SENSOR_1 == -3 || TEMP_SENSOR_1 == -2
#define HEATER_1_USES_MAX6675
#define HEATER_1_USES_MAX6675 1
#if TEMP_SENSOR_1 == -3
#define HEATER_1_MAX6675_TMIN -270
#define HEATER_1_MAX6675_TMAX 1800
@ -478,14 +483,14 @@
#endif
#endif
#elif TEMP_SENSOR_1 == -4
#define HEATER_1_USES_AD8495
#define HEATER_1_USES_AD8495 1
#elif TEMP_SENSOR_1 == -1
#define HEATER_1_USES_AD595
#define HEATER_1_USES_AD595 1
#elif TEMP_SENSOR_1 > 0
#define THERMISTOR_HEATER_1 TEMP_SENSOR_1
#define HEATER_1_USES_THERMISTOR
#define HEATER_1_USES_THERMISTOR 1
#if TEMP_SENSOR_1 == 1000
#define HEATER_1_USER_THERMISTOR
#define HEATER_1_USER_THERMISTOR 1
#endif
#else
#undef HEATER_1_MINTEMP
@ -493,18 +498,18 @@
#endif
#if TEMP_SENSOR_2 == -4
#define HEATER_2_USES_AD8495
#define HEATER_2_USES_AD8495 1
#elif TEMP_SENSOR_2 == -3
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_2."
#elif TEMP_SENSOR_2 == -2
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_2."
#elif TEMP_SENSOR_2 == -1
#define HEATER_2_USES_AD595
#define HEATER_2_USES_AD595 1
#elif TEMP_SENSOR_2 > 0
#define THERMISTOR_HEATER_2 TEMP_SENSOR_2
#define HEATER_2_USES_THERMISTOR
#define HEATER_2_USES_THERMISTOR 1
#if TEMP_SENSOR_2 == 1000
#define HEATER_2_USER_THERMISTOR
#define HEATER_2_USER_THERMISTOR 1
#endif
#else
#undef HEATER_2_MINTEMP
@ -512,18 +517,18 @@
#endif
#if TEMP_SENSOR_3 == -4
#define HEATER_3_USES_AD8495
#define HEATER_3_USES_AD8495 1
#elif TEMP_SENSOR_3 == -3
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_3."
#elif TEMP_SENSOR_3 == -2
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_3."
#elif TEMP_SENSOR_3 == -1
#define HEATER_3_USES_AD595
#define HEATER_3_USES_AD595 1
#elif TEMP_SENSOR_3 > 0
#define THERMISTOR_HEATER_3 TEMP_SENSOR_3
#define HEATER_3_USES_THERMISTOR
#define HEATER_3_USES_THERMISTOR 1
#if TEMP_SENSOR_3 == 1000
#define HEATER_3_USER_THERMISTOR
#define HEATER_3_USER_THERMISTOR 1
#endif
#else
#undef HEATER_3_MINTEMP
@ -531,18 +536,18 @@
#endif
#if TEMP_SENSOR_4 == -4
#define HEATER_4_USES_AD8495
#define HEATER_4_USES_AD8495 1
#elif TEMP_SENSOR_4 == -3
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_4."
#elif TEMP_SENSOR_4 == -2
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_4."
#elif TEMP_SENSOR_4 == -1
#define HEATER_4_USES_AD595
#define HEATER_4_USES_AD595 1
#elif TEMP_SENSOR_4 > 0
#define THERMISTOR_HEATER_4 TEMP_SENSOR_4
#define HEATER_4_USES_THERMISTOR
#define HEATER_4_USES_THERMISTOR 1
#if TEMP_SENSOR_4 == 1000
#define HEATER_4_USER_THERMISTOR
#define HEATER_4_USER_THERMISTOR 1
#endif
#else
#undef HEATER_4_MINTEMP
@ -550,18 +555,18 @@
#endif
#if TEMP_SENSOR_5 == -4
#define HEATER_5_USES_AD8495
#define HEATER_5_USES_AD8495 1
#elif TEMP_SENSOR_5 == -3
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_5."
#elif TEMP_SENSOR_5 == -2
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_5."
#elif TEMP_SENSOR_5 == -1
#define HEATER_5_USES_AD595
#define HEATER_5_USES_AD595 1
#elif TEMP_SENSOR_5 > 0
#define THERMISTOR_HEATER_5 TEMP_SENSOR_5
#define HEATER_5_USES_THERMISTOR
#define HEATER_5_USES_THERMISTOR 1
#if TEMP_SENSOR_5 == 1000
#define HEATER_5_USER_THERMISTOR
#define HEATER_5_USER_THERMISTOR 1
#endif
#else
#undef HEATER_5_MINTEMP
@ -569,18 +574,18 @@
#endif
#if TEMP_SENSOR_6 == -4
#define HEATER_6_USES_AD8495
#define HEATER_6_USES_AD8495 1
#elif TEMP_SENSOR_6 == -3
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_6."
#elif TEMP_SENSOR_6 == -2
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_6."
#elif TEMP_SENSOR_6 == -1
#define HEATER_6_USES_AD595
#define HEATER_6_USES_AD595 1
#elif TEMP_SENSOR_6 > 0
#define THERMISTOR_HEATER_6 TEMP_SENSOR_6
#define HEATER_6_USES_THERMISTOR
#define HEATER_6_USES_THERMISTOR 1
#if TEMP_SENSOR_6 == 1000
#define HEATER_6_USER_THERMISTOR
#define HEATER_6_USER_THERMISTOR 1
#endif
#else
#undef HEATER_6_MINTEMP
@ -588,18 +593,18 @@
#endif
#if TEMP_SENSOR_7 == -4
#define HEATER_7_USES_AD8495
#define HEATER_7_USES_AD8495 1
#elif TEMP_SENSOR_7 == -3
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_7."
#elif TEMP_SENSOR_7 == -2
#error "MAX7775 Thermocouples (-2) not supported for TEMP_SENSOR_7."
#elif TEMP_SENSOR_7 == -1
#define HEATER_7_USES_AD595
#define HEATER_7_USES_AD595 1
#elif TEMP_SENSOR_7 > 0
#define THERMISTOR_HEATER_7 TEMP_SENSOR_7
#define HEATER_7_USES_THERMISTOR
#define HEATER_7_USES_THERMISTOR 1
#if TEMP_SENSOR_7 == 1000
#define HEATER_7_USER_THERMISTOR
#define HEATER_7_USER_THERMISTOR 1
#endif
#else
#undef HEATER_7_MINTEMP
@ -607,18 +612,18 @@
#endif
#if TEMP_SENSOR_BED == -4
#define HEATER_BED_USES_AD8495
#define HEATER_BED_USES_AD8495 1
#elif TEMP_SENSOR_BED == -3
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_BED."
#elif TEMP_SENSOR_BED == -2
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_BED."
#elif TEMP_SENSOR_BED == -1
#define HEATER_BED_USES_AD595
#define HEATER_BED_USES_AD595 1
#elif TEMP_SENSOR_BED > 0
#define THERMISTORBED TEMP_SENSOR_BED
#define HEATER_BED_USES_THERMISTOR
#define HEATER_BED_USES_THERMISTOR 1
#if TEMP_SENSOR_BED == 1000
#define HEATER_BED_USER_THERMISTOR
#define HEATER_BED_USER_THERMISTOR 1
#endif
#else
#undef BED_MINTEMP
@ -626,18 +631,18 @@
#endif
#if TEMP_SENSOR_CHAMBER == -4
#define HEATER_CHAMBER_USES_AD8495
#define HEATER_CHAMBER_USES_AD8495 1
#elif TEMP_SENSOR_CHAMBER == -3
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_CHAMBER."
#elif TEMP_SENSOR_CHAMBER == -2
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_CHAMBER."
#elif TEMP_SENSOR_CHAMBER == -1
#define HEATER_CHAMBER_USES_AD595
#define HEATER_CHAMBER_USES_AD595 1
#elif TEMP_SENSOR_CHAMBER > 0
#define THERMISTORCHAMBER TEMP_SENSOR_CHAMBER
#define HEATER_CHAMBER_USES_THERMISTOR
#define HEATER_CHAMBER_USES_THERMISTOR 1
#if TEMP_SENSOR_CHAMBER == 1000
#define HEATER_CHAMBER_USER_THERMISTOR
#define HEATER_CHAMBER_USER_THERMISTOR 1
#endif
#else
#undef CHAMBER_MINTEMP
@ -645,25 +650,21 @@
#endif
#if TEMP_SENSOR_PROBE == -4
#define HEATER_PROBE_USES_AD8495
#define HEATER_PROBE_USES_AD8495 1
#elif TEMP_SENSOR_PROBE == -3
#error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_PROBE."
#elif TEMP_SENSOR_PROBE == -2
#error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_PROBE."
#elif TEMP_SENSOR_PROBE == -1
#define HEATER_PROBE_USES_AD595
#define HEATER_PROBE_USES_AD595 1
#elif TEMP_SENSOR_PROBE > 0
#define THERMISTORPROBE TEMP_SENSOR_PROBE
#define PROBE_USES_THERMISTOR
#define HEATER_PROBE_USES_THERMISTOR 1
#if TEMP_SENSOR_PROBE == 1000
#define PROBE_USER_THERMISTOR
#define HEATER_PROBE_USER_THERMISTOR 1
#endif
#endif
#define HOTEND_USES_THERMISTOR ANY( \
HEATER_0_USES_THERMISTOR, HEATER_1_USES_THERMISTOR, HEATER_2_USES_THERMISTOR, HEATER_3_USES_THERMISTOR, \
HEATER_4_USES_THERMISTOR, HEATER_5_USES_THERMISTOR, HEATER_6_USES_THERMISTOR, HEATER_7_USES_THERMISTOR )
/**
* X_DUAL_ENDSTOPS endstop reassignment
*/

View file

@ -1406,9 +1406,6 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
* Unified Bed Leveling
*/
// Hide PROBE_MANUALLY from the rest of the code
#undef PROBE_MANUALLY
#if IS_SCARA
#error "AUTO_BED_LEVELING_UBL does not yet support SCARA printers."
#elif DISABLED(EEPROM_SETTINGS)
@ -1434,13 +1431,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#elif ENABLED(MESH_BED_LEVELING)
// Hide PROBE_MANUALLY from the rest of the code
#undef PROBE_MANUALLY
/**
* Mesh Bed Leveling
*/
// Mesh Bed Leveling
#if ENABLED(DELTA)
#error "MESH_BED_LEVELING is not compatible with DELTA printers."
#elif GRID_MAX_POINTS_X > 9 || GRID_MAX_POINTS_Y > 9
@ -1651,34 +1642,41 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
/**
* Required custom thermistor settings
*/
#if ENABLED(HEATER_0_USER_THERMISTOR) && !(defined(HOTEND0_PULLUP_RESISTOR_OHMS) && defined(HOTEND0_RESISTANCE_25C_OHMS) && defined(HOTEND0_BETA))
#if HEATER_0_USER_THERMISTOR && !(defined(HOTEND0_PULLUP_RESISTOR_OHMS) && defined(HOTEND0_RESISTANCE_25C_OHMS) && defined(HOTEND0_BETA))
#error "TEMP_SENSOR_0 1000 requires HOTEND0_PULLUP_RESISTOR_OHMS, HOTEND0_RESISTANCE_25C_OHMS and HOTEND0_BETA in Configuration_adv.h."
#elif ENABLED(HEATER_1_USER_THERMISTOR) && !(defined(HOTEND1_PULLUP_RESISTOR_OHMS) && defined(HOTEND1_RESISTANCE_25C_OHMS) && defined(HOTEND1_BETA))
#elif HEATER_1_USER_THERMISTOR && !(defined(HOTEND1_PULLUP_RESISTOR_OHMS) && defined(HOTEND1_RESISTANCE_25C_OHMS) && defined(HOTEND1_BETA))
#error "TEMP_SENSOR_1 1000 requires HOTEND1_PULLUP_RESISTOR_OHMS, HOTEND1_RESISTANCE_25C_OHMS and HOTEND1_BETA in Configuration_adv.h."
#elif ENABLED(HEATER_2_USER_THERMISTOR) && !(defined(HOTEND2_PULLUP_RESISTOR_OHMS) && defined(HOTEND2_RESISTANCE_25C_OHMS) && defined(HOTEND2_BETA))
#elif HEATER_2_USER_THERMISTOR && !(defined(HOTEND2_PULLUP_RESISTOR_OHMS) && defined(HOTEND2_RESISTANCE_25C_OHMS) && defined(HOTEND2_BETA))
#error "TEMP_SENSOR_2 1000 requires HOTEND2_PULLUP_RESISTOR_OHMS, HOTEND2_RESISTANCE_25C_OHMS and HOTEND2_BETA in Configuration_adv.h."
#elif ENABLED(HEATER_3_USER_THERMISTOR) && !(defined(HOTEND3_PULLUP_RESISTOR_OHMS) && defined(HOTEND3_RESISTANCE_25C_OHMS) && defined(HOTEND3_BETA))
#elif HEATER_3_USER_THERMISTOR && !(defined(HOTEND3_PULLUP_RESISTOR_OHMS) && defined(HOTEND3_RESISTANCE_25C_OHMS) && defined(HOTEND3_BETA))
#error "TEMP_SENSOR_3 1000 requires HOTEND3_PULLUP_RESISTOR_OHMS, HOTEND3_RESISTANCE_25C_OHMS and HOTEND3_BETA in Configuration_adv.h."
#elif ENABLED(HEATER_4_USER_THERMISTOR) && !(defined(HOTEND4_PULLUP_RESISTOR_OHMS) && defined(HOTEND4_RESISTANCE_25C_OHMS) && defined(HOTEND4_BETA))
#elif HEATER_4_USER_THERMISTOR && !(defined(HOTEND4_PULLUP_RESISTOR_OHMS) && defined(HOTEND4_RESISTANCE_25C_OHMS) && defined(HOTEND4_BETA))
#error "TEMP_SENSOR_4 1000 requires HOTEND4_PULLUP_RESISTOR_OHMS, HOTEND4_RESISTANCE_25C_OHMS and HOTEND4_BETA in Configuration_adv.h."
#elif ENABLED(HEATER_5_USER_THERMISTOR) && !(defined(HOTEND5_PULLUP_RESISTOR_OHMS) && defined(HOTEND5_RESISTANCE_25C_OHMS) && defined(HOTEND5_BETA))
#elif HEATER_5_USER_THERMISTOR && !(defined(HOTEND5_PULLUP_RESISTOR_OHMS) && defined(HOTEND5_RESISTANCE_25C_OHMS) && defined(HOTEND5_BETA))
#error "TEMP_SENSOR_5 1000 requires HOTEND5_PULLUP_RESISTOR_OHMS, HOTEND5_RESISTANCE_25C_OHMS and HOTEND5_BETA in Configuration_adv.h."
#elif ENABLED(HEATER_6_USER_THERMISTOR) && !(defined(HOTEND6_PULLUP_RESISTOR_OHMS) && defined(HOTEND6_RESISTANCE_25C_OHMS) && defined(HOTEND6_BETA))
#elif HEATER_6_USER_THERMISTOR && !(defined(HOTEND6_PULLUP_RESISTOR_OHMS) && defined(HOTEND6_RESISTANCE_25C_OHMS) && defined(HOTEND6_BETA))
#error "TEMP_SENSOR_6 1000 requires HOTEND6_PULLUP_RESISTOR_OHMS, HOTEND6_RESISTANCE_25C_OHMS and HOTEND6_BETA in Configuration_adv.h."
#elif ENABLED(HEATER_7_USER_THERMISTOR) && !(defined(HOTEND7_PULLUP_RESISTOR_OHMS) && defined(HOTEND7_RESISTANCE_25C_OHMS) && defined(HOTEND7_BETA))
#elif HEATER_7_USER_THERMISTOR && !(defined(HOTEND7_PULLUP_RESISTOR_OHMS) && defined(HOTEND7_RESISTANCE_25C_OHMS) && defined(HOTEND7_BETA))
#error "TEMP_SENSOR_7 1000 requires HOTEND7_PULLUP_RESISTOR_OHMS, HOTEND7_RESISTANCE_25C_OHMS and HOTEND7_BETA in Configuration_adv.h."
#elif ENABLED(HEATER_BED_USER_THERMISTOR) && !(defined(BED_PULLUP_RESISTOR_OHMS) && defined(BED_RESISTANCE_25C_OHMS) && defined(BED_BETA))
#elif HEATER_BED_USER_THERMISTOR && !(defined(BED_PULLUP_RESISTOR_OHMS) && defined(BED_RESISTANCE_25C_OHMS) && defined(BED_BETA))
#error "TEMP_SENSOR_BED 1000 requires BED_PULLUP_RESISTOR_OHMS, BED_RESISTANCE_25C_OHMS and BED_BETA in Configuration_adv.h."
#elif ENABLED(HEATER_CHAMBER_USER_THERMISTOR) && !(defined(CHAMBER_PULLUP_RESISTOR_OHMS) && defined(CHAMBER_RESISTANCE_25C_OHMS) && defined(CHAMBER_BETA))
#elif HEATER_CHAMBER_USER_THERMISTOR && !(defined(CHAMBER_PULLUP_RESISTOR_OHMS) && defined(CHAMBER_RESISTANCE_25C_OHMS) && defined(CHAMBER_BETA))
#error "TEMP_SENSOR_CHAMBER 1000 requires CHAMBER_PULLUP_RESISTOR_OHMS, CHAMBER_RESISTANCE_25C_OHMS and CHAMBER_BETA in Configuration_adv.h."
#endif
/**
* A Sensor ID has to be set for each heater
* Pins and Sensor IDs must be set for each heater
*/
#if HEATER_0_USES_MAX6675 && !PIN_EXISTS(MAX6675_SS)
#error "MAX6675_SS_PIN (required for TEMP_SENSOR_0) not defined for this board."
#elif HAS_HOTEND && !HAS_TEMP_HOTEND
#error "TEMP_0_PIN (required for TEMP_SENSOR_0) not defined for this board."
#elif EITHER(HAS_MULTI_HOTEND, HEATERS_PARALLEL) && !HAS_HEATER_1
#error "HEATER_1_PIN is not defined. TEMP_SENSOR_1 might not be set, or the board (not EEB / EEF?) doesn't define a pin."
#endif
#if HAS_MULTI_HOTEND
#if ENABLED(HEATER_1_USES_MAX6675) && !PIN_EXISTS(MAX6675_SS2)
#if HEATER_1_USES_MAX6675 && !PIN_EXISTS(MAX6675_SS2)
#error "MAX6675_SS2_PIN (required for TEMP_SENSOR_1) not defined for this board."
#elif TEMP_SENSOR_1 == 0
#error "TEMP_SENSOR_1 is required with 2 or more HOTENDS."
@ -1841,7 +1839,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
#error "TEMP_SENSOR_1 is required with TEMP_SENSOR_1_AS_REDUNDANT."
#endif
#if ENABLED(MAX6675_IS_MAX31865) && (!defined(MAX31865_SENSOR_OHMS) || !defined(MAX31865_CALIBRATION_OHMS))
#if MAX6675_IS_MAX31865 && !(defined(MAX31865_SENSOR_OHMS) && defined(MAX31865_CALIBRATION_OHMS))
#error "MAX31865_SENSOR_OHMS and MAX31865_CALIBRATION_OHMS must be set in Configuration.h when using a MAX31865 temperature sensor."
#endif
@ -1860,15 +1858,6 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
#error "TEMP_SENSOR_0 is required if there are any extruders."
#endif
// Pins are required for heaters
#if ENABLED(HEATER_0_USES_MAX6675) && !PIN_EXISTS(MAX6675_SS)
#error "MAX6675_SS_PIN (required for TEMP_SENSOR_0) not defined for this board."
#elif HAS_HOTEND && !HAS_TEMP_HOTEND
#error "TEMP_0_PIN (required for TEMP_SENSOR_0) not defined for this board."
#elif EITHER(HAS_MULTI_HOTEND, HEATERS_PARALLEL) && !HAS_HEATER_1
#error "HEATER_1_PIN is not defined. TEMP_SENSOR_1 might not be set, or the board (not EEB / EEF?) doesn't define a pin."
#endif
/**
* Temperature status LEDs
*/
@ -1974,7 +1963,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
#endif
// Delta and Cartesian use 3 homing endstops
#if !IS_SCARA
#if NONE(IS_SCARA, SPI_ENDSTOPS)
#if X_HOME_DIR < 0 && DISABLED(USE_XMIN_PLUG)
#error "Enable USE_XMIN_PLUG when homing X to MIN."
#elif X_HOME_DIR > 0 && DISABLED(USE_XMAX_PLUG)
@ -2253,7 +2242,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
+ COUNT_ENABLED(TFTGLCD_PANEL_SPI, TFTGLCD_PANEL_I2C) \
+ COUNT_ENABLED(VIKI2, miniVIKI) \
+ COUNT_ENABLED(ZONESTAR_12864LCD, ZONESTAR_12864OLED, ZONESTAR_12864OLED_SSD1306) \
+ ENABLED(ANET_FULL_GRAPHICS_LCD) \
+ COUNT_ENABLED(ANET_FULL_GRAPHICS_LCD, ANET_FULL_GRAPHICS_LCD_ALT_WIRING) \
+ ENABLED(AZSMZ_12864) \
+ ENABLED(BQ_LCD_SMART_CONTROLLER) \
+ ENABLED(CARTESIO_UI) \
@ -2327,6 +2316,20 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
#error "GRAPHICAL_TFT_UPSCALE must be set to 2 or 3."
#endif
/**
* Some boards forbid the use of -1 Native USB
*/
#if ENABLED(BOARD_NO_NATIVE_USB)
#undef BOARD_NO_NATIVE_USB
#if SERIAL_PORT == -1
#error "SERIAL_PORT is set to -1, but the MOTHERBOARD has no native USB support. Set SERIAL_PORT to a valid value for your board."
#elif SERIAL_PORT_2 == -1
#error "SERIAL_PORT_2 is set to -1, but the MOTHERBOARD has no native USB support. Set SERIAL_PORT_2 to a valid value for your board."
#elif LCD_SERIAL_PORT == -1
#error "LCD_SERIAL_PORT is set to -1, but the MOTHERBOARD has no native USB support. Set LCD_SERIAL_PORT to a valid value for your board."
#endif
#endif
/**
* Serial displays require a dedicated serial port
*/
@ -2529,21 +2532,28 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
#define Y_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(Y,TMC2209)
#define Z_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(Z,TMC2209)
#if ENABLED(DELTA) && !BOTH(STEALTHCHOP_XY, STEALTHCHOP_Z)
#error "SENSORLESS_HOMING on DELTA currently requires STEALTHCHOP_XY and STEALTHCHOP_Z."
#elif X_SENSORLESS && X_HOME_DIR < 0 && NONE(ONBOARD_ENDSTOPPULLUPS, ENDSTOPPULLUPS, ENDSTOPPULLUP_XMIN)
#if NONE(SPI_ENDSTOPS, ONBOARD_ENDSTOPPULLUPS, ENDSTOPPULLUPS)
#if X_SENSORLESS && X_HOME_DIR < 0 && DISABLED(ENDSTOPPULLUP_XMIN)
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_XMIN (or ENDSTOPPULLUPS) when homing to X_MIN."
#elif X_SENSORLESS && X_HOME_DIR > 0 && NONE(ONBOARD_ENDSTOPPULLUPS, ENDSTOPPULLUPS, ENDSTOPPULLUP_XMAX)
#elif X_SENSORLESS && X_HOME_DIR > 0 && DISABLED(ENDSTOPPULLUP_XMAX)
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_XMAX (or ENDSTOPPULLUPS) when homing to X_MAX."
#elif Y_SENSORLESS && Y_HOME_DIR < 0 && NONE(ONBOARD_ENDSTOPPULLUPS, ENDSTOPPULLUPS, ENDSTOPPULLUP_YMIN)
#elif Y_SENSORLESS && Y_HOME_DIR < 0 && DISABLED(ENDSTOPPULLUP_YMIN)
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_YMIN (or ENDSTOPPULLUPS) when homing to Y_MIN."
#elif Y_SENSORLESS && Y_HOME_DIR > 0 && NONE(ONBOARD_ENDSTOPPULLUPS, ENDSTOPPULLUPS, ENDSTOPPULLUP_YMAX)
#elif Y_SENSORLESS && Y_HOME_DIR > 0 && DISABLED(ENDSTOPPULLUP_YMAX)
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_YMAX (or ENDSTOPPULLUPS) when homing to Y_MAX."
#elif Z_SENSORLESS && Z_HOME_DIR < 0 && NONE(ONBOARD_ENDSTOPPULLUPS, ENDSTOPPULLUPS, ENDSTOPPULLUP_ZMIN)
#elif Z_SENSORLESS && Z_HOME_DIR < 0 && DISABLED(ENDSTOPPULLUP_ZMIN)
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_ZMIN (or ENDSTOPPULLUPS) when homing to Z_MIN."
#elif Z_SENSORLESS && Z_HOME_DIR > 0 && NONE(ONBOARD_ENDSTOPPULLUPS, ENDSTOPPULLUPS, ENDSTOPPULLUP_ZMAX)
#elif Z_SENSORLESS && Z_HOME_DIR > 0 && DISABLED(ENDSTOPPULLUP_ZMAX)
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_ZMAX (or ENDSTOPPULLUPS) when homing to Z_MAX."
#elif X_SENSORLESS && X_HOME_DIR < 0 && X_MIN_ENDSTOP_INVERTING != X_ENDSTOP_INVERTING
#endif
#endif
#if ENABLED(SPI_ENDSTOPS)
#if ENABLED(QUICK_HOME)
#warning "SPI_ENDSTOPS may be unreliable with QUICK_HOME. Adjust back-offs for better results."
#endif
#else
#if X_SENSORLESS && X_HOME_DIR < 0 && X_MIN_ENDSTOP_INVERTING != X_ENDSTOP_INVERTING
#if X_ENDSTOP_INVERTING
#error "SENSORLESS_HOMING requires X_MIN_ENDSTOP_INVERTING = true when homing to X_MIN."
#else
@ -2579,6 +2589,11 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
#else
#error "SENSORLESS_HOMING requires Z_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to Z_MAX."
#endif
#endif
#endif
#if ENABLED(DELTA) && !BOTH(STEALTHCHOP_XY, STEALTHCHOP_Z)
#error "SENSORLESS_HOMING on DELTA currently requires STEALTHCHOP_XY and STEALTHCHOP_Z."
#elif ENDSTOP_NOISE_THRESHOLD
#error "SENSORLESS_HOMING is incompatible with ENDSTOP_NOISE_THRESHOLD."
#elif !(X_SENSORLESS || Y_SENSORLESS || Z_SENSORLESS)
@ -3023,16 +3038,16 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2)
#error "PSU_CONTROL requires PSU_ACTIVE_STATE to be defined as 'HIGH' or 'LOW'."
#elif !PIN_EXISTS(PS_ON)
#error "PSU_CONTROL requires PS_ON_PIN."
#elif POWER_OFF_DELAY < 0
#error "POWER_OFF_DELAY must be a positive value."
#endif
#elif ENABLED(AUTO_POWER_CONTROL)
#error "AUTO_POWER_CONTROL requires PSU_CONTROL."
#endif
#if HAS_CUTTER
#ifndef CUTTER_POWER_UNIT
#error "CUTTER_POWER_UNIT is required with a spindle or laser. Please update your Configuration_adv.h."
#elif !CUTTER_UNIT_IS(PWM255) && !CUTTER_UNIT_IS(PERCENT) && !CUTTER_UNIT_IS(RPM)
#error "CUTTER_POWER_UNIT must be PWM255, PERCENT, or RPM. Please update your Configuration_adv.h."
#elif !CUTTER_UNIT_IS(PWM255) && !CUTTER_UNIT_IS(PERCENT) && !CUTTER_UNIT_IS(RPM) && !CUTTER_UNIT_IS(SERVO)
#error "CUTTER_POWER_UNIT must be PWM255, PERCENT, RPM, or SERVO. Please update your Configuration_adv.h."
#endif
#if ENABLED(LASER_POWER_INLINE)
@ -3071,8 +3086,8 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2)
#define _PIN_CONFLICT(P) (PIN_EXISTS(P) && P##_PIN == SPINDLE_LASER_PWM_PIN)
#if BOTH(SPINDLE_FEATURE, LASER_FEATURE)
#error "Enable only one of SPINDLE_FEATURE or LASER_FEATURE."
#elif !PIN_EXISTS(SPINDLE_LASER_ENA)
#error "(SPINDLE|LASER)_FEATURE requires SPINDLE_LASER_ENA_PIN."
#elif !PIN_EXISTS(SPINDLE_LASER_ENA) && DISABLED(SPINDLE_SERVO)
#error "(SPINDLE|LASER)_FEATURE requires SPINDLE_LASER_ENA_PIN or SPINDLE_SERVO to control the power."
#elif ENABLED(SPINDLE_CHANGE_DIR) && !PIN_EXISTS(SPINDLE_DIR)
#error "SPINDLE_DIR_PIN is required for SPINDLE_CHANGE_DIR."
#elif ENABLED(SPINDLE_LASER_PWM)

View file

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

File diff suppressed because it is too large Load diff

View file

@ -123,7 +123,7 @@ bool MarlinUI::detected() { return true; }
custom_start_bmp
#endif
;
TERN(CUSTOM_BOOTSCREEN_ANIMATED,,UNUSED(frame));
UNUSED(frame);
u8g.drawBitmapP(left, top, CUSTOM_BOOTSCREEN_BMP_BYTEWIDTH, CUSTOM_BOOTSCREEN_BMPHEIGHT, bmp);

View file

@ -0,0 +1,110 @@
/**
* 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
//
// lcd/dogm/status/bed.h - Status Screen Bed bitmaps
//
#if ENABLED(STATUS_ALT_BED_BITMAP)
#define STATUS_BED_ANIM
#define STATUS_BED_WIDTH 24
#ifndef STATUS_BED_X
#define STATUS_BED_X (LCD_PIXEL_WIDTH - (STATUS_BED_BYTEWIDTH + STATUS_CHAMBER_BYTEWIDTH + STATUS_FAN_BYTEWIDTH) * 8)
#endif
#define STATUS_BED_TEXT_X (STATUS_BED_X + 11)
const unsigned char status_bed_bmp[] PROGMEM = {
B11111111,B11111111,B11000000,
B01000000,B00000000,B00100000,
B00100000,B00000000,B00010000,
B00010000,B00000000,B00001000,
B00001000,B00000000,B00000100,
B00000100,B00000000,B00000010,
B00000011,B11111111,B11111111
};
const unsigned char status_bed_on_bmp[] PROGMEM = {
B00000010,B00100010,B00000000,
B00000100,B01000100,B00000000,
B00000100,B01000100,B00000000,
B00000010,B00100010,B00000000,
B00000001,B00010001,B00000000,
B11111111,B11111111,B11000000,
B01000000,B10001000,B10100000,
B00100001,B00010001,B00010000,
B00010010,B00100010,B00001000,
B00001000,B00000000,B00000100,
B00000100,B00000000,B00000010,
B00000011,B11111111,B11111111
};
#else
#define STATUS_BED_WIDTH 21
#ifndef STATUS_BED_X
#define STATUS_BED_X (LCD_PIXEL_WIDTH - (STATUS_BED_BYTEWIDTH + STATUS_CHAMBER_BYTEWIDTH + STATUS_FAN_BYTEWIDTH) * 8)
#endif
#ifdef STATUS_BED_ANIM
const unsigned char status_bed_bmp[] PROGMEM = {
B00011111,B11111111,B11111000,
B00011111,B11111111,B11111000
};
const unsigned char status_bed_on_bmp[] PROGMEM = {
B00000100,B00010000,B01000000,
B00000010,B00001000,B00100000,
B00000010,B00001000,B00100000,
B00000100,B00010000,B01000000,
B00001000,B00100000,B10000000,
B00010000,B01000001,B00000000,
B00010000,B01000001,B00000000,
B00001000,B00100000,B10000000,
B00000100,B00010000,B01000000,
B00000000,B00000000,B00000000,
B00011111,B11111111,B11111000,
B00011111,B11111111,B11111000
};
#else
const unsigned char status_bed_bmp[] PROGMEM = {
B00000100,B00010000,B01000000,
B00000010,B00001000,B00100000,
B00000010,B00001000,B00100000,
B00000100,B00010000,B01000000,
B00001000,B00100000,B10000000,
B00010000,B01000001,B00000000,
B00010000,B01000001,B00000000,
B00001000,B00100000,B10000000,
B00000100,B00010000,B01000000,
B00000000,B00000000,B00000000,
B00011111,B11111111,B11111000,
B00011111,B11111111,B11111000
};
#endif
#endif

View file

@ -0,0 +1,89 @@
/**
* 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
//
// lcd/dogm/status/chamber.h - Status Screen Chamber bitmaps
//
#define STATUS_CHAMBER_WIDTH 21
#if STATUS_HEATERS_WIDTH
#if ENABLED(STATUS_COMBINE_HEATERS)
#define STATUS_CHAMBER_X (LCD_PIXEL_WIDTH - 2 - (STATUS_CHAMBER_BYTEWIDTH) * 8)
#elif HAS_FAN0 && HAS_HEATED_BED && HOTENDS <= 2
#define STATUS_CHAMBER_X (LCD_PIXEL_WIDTH - 2 - (STATUS_HEATERS_BYTEWIDTH - STATUS_CHAMBER_BYTEWIDTH) * 8)
#elif HAS_FAN0 && !HAS_HEATED_BED
#define STATUS_CHAMBER_X (LCD_PIXEL_WIDTH - (STATUS_CHAMBER_BYTEWIDTH + STATUS_FAN_BYTEWIDTH) * 8)
#else
#define STATUS_CHAMBER_X (LCD_PIXEL_WIDTH - (STATUS_CHAMBER_BYTEWIDTH) * 8)
#endif
#endif
#ifdef STATUS_CHAMBER_ANIM
const unsigned char status_chamber_bmp[] PROGMEM = {
B00011111,B11111111,B11111000,
B00010000,B00000000,B00001000,
B00010000,B00000000,B00001000,
B00010000,B00000000,B00001000,
B00010000,B00000000,B00001000,
B00010000,B00000000,B00001000,
B00010000,B00000000,B00001000,
B00010000,B00000000,B00001000,
B00010000,B00000000,B00001000,
B00010000,B00000000,B00001000,
B00011111,B11111111,B11111000,
B00011111,B11111111,B11111000
};
const unsigned char status_chamber_on_bmp[] PROGMEM = {
B00011111,B11111111,B11111000,
B00010000,B00000000,B00001000,
B00010000,B10000100,B00001000,
B00010000,B01000010,B00001000,
B00010000,B01000010,B00001000,
B00010000,B10000100,B00001000,
B00010001,B00001000,B00001000,
B00010001,B00001000,B00001000,
B00010000,B10000100,B00001000,
B00010000,B00000000,B00001000,
B00011111,B11111111,B11111000,
B00011111,B11111111,B11111000
};
#else
const unsigned char status_chamber_bmp[] PROGMEM = {
B00011111,B11111111,B11111000,
B00010000,B00000000,B00001000,
B00010000,B10000100,B00001000,
B00010000,B01000010,B00001000,
B00010000,B01000010,B00001000,
B00010000,B10000100,B00001000,
B00010001,B00001000,B00001000,
B00010001,B00001000,B00001000,
B00010000,B10000100,B00001000,
B00010000,B00000000,B00001000,
B00011111,B11111111,B11111000,
B00011111,B11111111,B11111000
};
#endif

View file

@ -0,0 +1,236 @@
/**
* 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
//
// lcd/dogm/status/combined.h - Status Screen Combined Heater bitmaps
//
#undef STATUS_HOTEND_ANIM
#undef STATUS_BED_ANIM
#define STATUS_HEATERS_XSPACE 24
#if HAS_HEATED_BED && HOTENDS <= 4
#if HOTENDS == 0
#define STATUS_HEATERS_WIDTH 96
const unsigned char status_heaters_bmp[] PROGMEM = {
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010,B00001000,B00100000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010,B00001000,B00100000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001000,B00100000,B10000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001000,B00100000,B10000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111,B11111000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111,B11111000
};
#elif HOTENDS == 1
#define STATUS_HEATERS_WIDTH 96
const unsigned char status_heaters_bmp[] PROGMEM = {
B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000,
B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010,B00001000,B00100000,
B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010,B00001000,B00100000,
B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000,
B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001000,B00100000,B10000000,
B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,
B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,
B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001000,B00100000,B10000000,
B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000,
B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111,B11111000,
B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111,B11111000
};
#elif HOTENDS == 2
#define STATUS_HEATERS_WIDTH 96
const unsigned char status_heaters_bmp[] PROGMEM = {
B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000,
B00111110,B11110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00000010,B00001000,B00100000,
B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00000010,B00001000,B00100000,
B00111010,B11110000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000,
B00011110,B11100000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B00001000,B00100000,B10000000,
B00011110,B11100000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,
B00111110,B11110000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,
B00111110,B11110000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B00001000,B00100000,B10000000,
B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000100,B00010000,B01000000,
B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111,B11111000,
B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B11111111,B11111000
};
#elif HOTENDS == 3
#define STATUS_HEATERS_WIDTH 96
const unsigned char status_heaters_bmp[] PROGMEM = {
B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000100,B00010000,B01000000,
B00111110,B11110000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00000010,B00001000,B00100000,
B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00000010,B00001000,B00100000,
B00111010,B11110000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00000100,B00010000,B01000000,
B00011110,B11100000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00001000,B00100000,B10000000,
B00011110,B11100000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00010000,B01000001,B00000000,
B00111110,B11110000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00010000,B01000001,B00000000,
B00111110,B11110000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00001000,B00100000,B10000000,
B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00000100,B00010000,B01000000,
B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,
B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00011111,B11111111,B11111000,
B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00011111,B11111111,B11111000
};
#else // HOTENDS > 3
#define STATUS_HEATERS_WIDTH 120
const unsigned char status_heaters_bmp[] PROGMEM = {
B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000100,B00010000,B01000000,
B00111110,B11110000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00000010,B00001000,B00100000,
B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00000010,B00001000,B00100000,
B00111010,B11110000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00111011,B01110000,B00000000,B00000100,B00010000,B01000000,
B00011110,B11100000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00011011,B01100000,B00000000,B00001000,B00100000,B10000000,
B00011110,B11100000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00011000,B00100000,B00000000,B00010000,B01000001,B00000000,
B00111110,B11110000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00111111,B01110000,B00000000,B00010000,B01000001,B00000000,
B00111110,B11110000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00111111,B01110000,B00000000,B00001000,B00100000,B10000000,
B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00000100,B00010000,B01000000,
B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,
B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00011111,B11111111,B11111000,
B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00011111,B11111111,B11111000
};
#endif // HOTENDS
#define STATUS_BED_TEXT_X (STATUS_HEATERS_WIDTH - 10)
#else // !HAS_HEATED_BED || HOTENDS > 3
#if HOTENDS == 0
#define STATUS_HEATERS_WIDTH 0
#elif HOTENDS == 1
#define STATUS_HEATERS_WIDTH 12
const unsigned char status_heaters_bmp[] PROGMEM = {
B00011111,B11100000,
B00111111,B11110000,
B00111111,B11110000,
B00111111,B11110000,
B00011111,B11100000,
B00011111,B11100000,
B00111111,B11110000,
B00111111,B11110000,
B00111111,B11110000,
B00001111,B11000000,
B00000111,B10000000,
B00000011,B00000000
};
#elif HOTENDS == 2
#define STATUS_HEATERS_WIDTH 36
const unsigned char status_heaters_bmp[] PROGMEM = {
B00011111,B11100000,B00000000,B00011111,B11100000,
B00111110,B11110000,B00000000,B00111100,B11110000,
B00111100,B11110000,B00000000,B00111011,B01110000,
B00111010,B11110000,B00000000,B00111111,B01110000,
B00011110,B11100000,B00000000,B00011110,B11100000,
B00011110,B11100000,B00000000,B00011101,B11100000,
B00111110,B11110000,B00000000,B00111011,B11110000,
B00111110,B11110000,B00000000,B00111000,B01110000,
B00111111,B11110000,B00000000,B00111111,B11110000,
B00001111,B11000000,B00000000,B00001111,B11000000,
B00000111,B10000000,B00000000,B00000111,B10000000,
B00000011,B00000000,B00000000,B00000011,B00000000
};
#elif HOTENDS == 3
#define STATUS_HEATERS_WIDTH 60
const unsigned char status_heaters_bmp[] PROGMEM = {
B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,
B00111110,B11110000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,
B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,
B00111010,B11110000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,
B00011110,B11100000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,
B00011110,B11100000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,
B00111110,B11110000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,
B00111110,B11110000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,
B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,
B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,
B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,
B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000
};
#elif HOTENDS == 4
#define STATUS_HEATERS_WIDTH 84
const unsigned char status_heaters_bmp[] PROGMEM = {
B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,
B00111110,B11110000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00111011,B01110000,
B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,
B00111010,B11110000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00111011,B01110000,
B00011110,B11100000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00011011,B01100000,
B00011110,B11100000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00011000,B00100000,
B00111110,B11110000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00111111,B01110000,
B00111110,B11110000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00111111,B01110000,
B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,
B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,
B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,
B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000
};
#else // HOTENDS > 4
#define STATUS_HEATERS_WIDTH 108
const unsigned char status_heaters_bmp[] PROGMEM = {
B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,
B00111110,B11110000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00111000,B01110000,
B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00111011,B11110000,
B00111010,B11110000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00111011,B01110000,B00000000,B00111000,B11110000,
B00011110,B11100000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00011011,B01100000,B00000000,B00011111,B01100000,
B00011110,B11100000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00011000,B00100000,B00000000,B00011111,B01100000,
B00111110,B11110000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00111111,B01110000,B00000000,B00111011,B01110000,
B00111110,B11110000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00111111,B01110000,B00000000,B00111100,B11110000,
B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,
B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,
B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,
B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000
};
#endif // HOTENDS
#endif // !HAS_HEATED_BED || HOTENDS > 3

View file

@ -0,0 +1,123 @@
/**
* 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
//
// lcd/dogm/status/cutter.h - Status Screen Laser / Spindle bitmaps
//
#define STATUS_CUTTER_WIDTH 24
#define STATUS_CUTTER_X 80
#if ENABLED(LASER_FEATURE)
#ifdef STATUS_CUTTER_ANIM
const unsigned char status_cutter_on_bmp[] PROGMEM = {
B00000000,B00100100,B00000000,
B00000000,B01100110,B00000000,
B00000000,B11000011,B00000000,
B00000001,B10011001,B10000000,
B00000011,B00100100,B11000000,
B00000000,B01000010,B00000000,
B00000000,B01000010,B00000000,
B00000011,B00100100,B11000000,
B00000001,B10011001,B10000000,
B00000000,B11000011,B00000000,
B00000000,B01100110,B00000000,
B00000000,B00100100,B00000000
};
const unsigned char status_cutter_bmp[] PROGMEM = {
B00000000,B00100100,B00000000,
B00000000,B01100110,B00000000,
B00000000,B00000000,B00000000,
B00000001,B00000000,B10000000,
B00000011,B00000000,B11000000,
B00000000,B00011000,B00000000,
B00000000,B00011000,B00000000,
B00000011,B00000000,B11000000,
B00000001,B00000000,B10000000,
B00000000,B00000000,B00000000,
B00000000,B01100110,B00000000,
B00000000,B00100100,B00000000
};
#else
const unsigned char status_cutter_bmp[] PROGMEM = {
B00000000,B00100100,B00000000,
B00000000,B01100110,B00000000,
B00000000,B11000011,B00000000,
B00000001,B10000001,B10000000,
B00000011,B00000000,B11000000,
B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,
B00000011,B00000000,B11000000,
B00000001,B10000001,B10000000,
B00000000,B11000011,B00000000,
B00000000,B01100110,B00000000,
B00000000,B00100100,B00000000
};
#endif
#else
#ifdef STATUS_CUTTER_ANIM
const unsigned char status_cutter_on_bmp[] PROGMEM = {
B00000001,B11111110,B10000000,
B00000000,B11000000,B00000000,
B00000001,B10000000,B10000000,
B00000001,B00000000,B10000000,
B00000001,B11111100,B10000000,
B00000000,B11100000,B00000000,
B00000001,B11000000,B10000000,
B00000000,B10000001,B00000000,
B00000000,B01111010,B00000000,
B00000000,B00110100,B00000000,
B00000000,B00011000,B00000000,
B00000000,B00000000,B00000000
};
const unsigned char status_cutter_bmp[] PROGMEM = {
B00000001,B11111110,B10000000,
B00000000,B11000000,B00000000,
B00000001,B10000000,B10000000,
B00000001,B00000000,B10000000,
B00000001,B11111100,B10000000,
B00000000,B11100000,B00000000,
B00000001,B11000000,B10000000,
B00000000,B10000001,B00000000,
B00000000,B01111010,B00000000,
B00000000,B00110100,B00000000,
B00000000,B00011000,B00000000,
B00000000,B00000000,B00000000
};
#else
const unsigned char status_cutter_bmp[] PROGMEM = {
B00000001,B11000010,B10000000,
B00000001,B00011100,B10000000,
B00000000,B11100001,B00000000,
B00000001,B00001110,B10000000,
B00000001,B01110000,B10000000,
B00000000,B10000111,B10000000,
B00000001,B00111111,B10000000,
B00000000,B11111111,B00000000,
B00000000,B01111110,B00000000,
B00000000,B00111100,B00000000,
B00000000,B00011000,B00000000,
B00000000,B00000000,B00000000
};
#endif
#endif

View file

@ -0,0 +1,443 @@
/**
* 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
//
// lcd/dogm/status/fan.h - Status Screen Fan bitmaps
//
#undef STATUS_FAN_WIDTH
#define STATUS_FAN_WIDTH 20
#if STATUS_FAN_FRAMES <= 2
#define STATUS_FAN_Y 2
#if ENABLED(STATUS_ALT_FAN_BITMAP)
const unsigned char status_fan0_bmp[] PROGMEM = {
B00000001,B11111110,B00000000,
B00000110,B00000001,B10000000,
B00001000,B11111100,B01000000,
B00010000,B11111100,B00100000,
B00010000,B01111000,B00100000,
B00100000,B00110000,B00010000,
B00101100,B00000000,B11010000,
B00101110,B00110001,B11010000,
B00101111,B01111011,B11010000,
B00101111,B01111011,B11010000,
B00101110,B00110001,B11010000,
B00101100,B00000000,B11010000,
B00100000,B00110000,B00010000,
B00010000,B01111000,B00100000,
B00010000,B11111100,B00100000,
B00001000,B11111100,B01000000,
B00000110,B00000001,B10000000,
B00000001,B11111110,B00000000
};
#if STATUS_FAN_FRAMES == 2
const unsigned char status_fan1_bmp[] PROGMEM = {
B00000001,B11111110,B00000000,
B00000110,B00000001,B10000000,
B00001001,B10000110,B01000000,
B00010011,B10000111,B00100000,
B00010111,B10000111,B10100000,
B00101111,B10000111,B11010000,
B00101111,B00000011,B11010000,
B00100000,B00110000,B00010000,
B00100000,B01111000,B00010000,
B00100000,B01111000,B00010000,
B00100000,B00110000,B00010000,
B00101111,B00000011,B11010000,
B00101111,B10000111,B11010000,
B00010111,B10000111,B10100000,
B00010011,B10000111,B00100000,
B00001001,B10000110,B01000000,
B00000110,B00000001,B10000000,
B00000001,B11111110,B00000000
};
#endif
#else // !STATUS_ALT_FAN_BITMAP
const unsigned char status_fan0_bmp[] PROGMEM = {
B00111111,B11111111,B11110000,
B00111000,B00000000,B01110000,
B00110000,B11111100,B00110000,
B00100000,B11111100,B00010000,
B00100000,B01111000,B00010000,
B00100000,B00110000,B00010000,
B00101100,B00000000,B11010000,
B00101110,B00110001,B11010000,
B00101111,B01111011,B11010000,
B00101111,B01111011,B11010000,
B00101110,B00110001,B11010000,
B00101100,B00000000,B11010000,
B00100000,B00110000,B00010000,
B00100000,B01111000,B00010000,
B00100000,B11111100,B00010000,
B00110000,B11111100,B00110000,
B00111000,B00000000,B01110000,
B00111111,B11111111,B11110000
};
#if STATUS_FAN_FRAMES == 2
const unsigned char status_fan1_bmp[] PROGMEM = {
B00111111,B11111111,B11110000,
B00111000,B00000000,B01110000,
B00110001,B10000110,B00110000,
B00100011,B10000111,B00010000,
B00100111,B10000111,B10010000,
B00101111,B10000111,B11010000,
B00101111,B00000011,B11010000,
B00100000,B00110000,B00010000,
B00100000,B01111000,B00010000,
B00100000,B01111000,B00010000,
B00100000,B00110000,B00010000,
B00101111,B00000011,B11010000,
B00101111,B10000111,B11010000,
B00100111,B10000111,B10010000,
B00100011,B10000111,B00010000,
B00110001,B10000110,B00110000,
B00111000,B00000000,B01110000,
B00111111,B11111111,B11110000
};
#endif
#endif // !STATUS_ALT_FAN_BITMAP
#elif STATUS_FAN_FRAMES == 3
#if ENABLED(STATUS_ALT_FAN_BITMAP)
const unsigned char status_fan0_bmp[] PROGMEM = {
B00000001,B11111111,B00000000,
B00000110,B00000000,B11000000,
B00001001,B00000001,B00100000,
B00010111,B10000011,B11010000,
B00010111,B10000011,B11010000,
B00101111,B11000111,B11101000,
B00100111,B11000111,B11001000,
B00100001,B11111111,B00001000,
B00100000,B01111100,B00001000,
B00100000,B01111100,B00001000,
B00100000,B01111100,B00001000,
B00100001,B11111111,B00001000,
B00100111,B11000111,B11001000,
B00101111,B11000111,B11101000,
B00010111,B10000011,B11010000,
B00010111,B10000011,B11010000,
B00001001,B00000001,B00100000,
B00000110,B00000000,B11000000,
B00000001,B11111111,B00000000
};
const unsigned char status_fan1_bmp[] PROGMEM = {
B00000001,B11111111,B00000000,
B00000110,B00110000,B11000000,
B00001001,B11110000,B00100000,
B00010001,B11110000,B00010000,
B00010000,B11110000,B00010000,
B00100000,B11110000,B01101000,
B00100000,B00110001,B11101000,
B00100000,B00111001,B11101000,
B00100000,B01111111,B11111000,
B00111111,B11111111,B11111000,
B00111111,B11111100,B00001000,
B00101111,B00111000,B00001000,
B00101110,B00011000,B00001000,
B00101100,B00011110,B00001000,
B00010000,B00011110,B00010000,
B00010000,B00011111,B00010000,
B00001000,B00011111,B00100000,
B00000110,B00011000,B11000000,
B00000001,B11111111,B00000000
};
const unsigned char status_fan2_bmp[] PROGMEM = {
B00000001,B11111111,B00000000,
B00000110,B00011000,B11000000,
B00001000,B00011111,B00100000,
B00010000,B00011111,B10010000,
B00010100,B00011111,B00010000,
B00101110,B00011110,B00001000,
B00101111,B00011100,B00001000,
B00101111,B10111000,B00001000,
B00111111,B11111100,B00001000,
B00111111,B11111111,B11111000,
B00100000,B01111111,B11111000,
B00100000,B00111011,B11101000,
B00100000,B01110001,B11101000,
B00100000,B11110000,B11101000,
B00010001,B11110000,B01010000,
B00010011,B11110000,B00010000,
B00001001,B11110000,B00100000,
B00000110,B00110000,B11000000,
B00000001,B11111111,B00000000
};
#else // !STATUS_ALT_FAN_BITMAP
const unsigned char status_fan0_bmp[] PROGMEM = {
B00111111,B11111111,B11111000,
B00111110,B00000000,B11111000,
B00111001,B00000001,B00111000,
B00110111,B10000011,B11011000,
B00110111,B10000011,B11011000,
B00101111,B11000111,B11101000,
B00100111,B11000111,B11001000,
B00100001,B11111111,B00001000,
B00100000,B01111100,B00001000,
B00100000,B01111100,B00001000,
B00100000,B01111100,B00001000,
B00100001,B11111111,B00001000,
B00100111,B11000111,B11001000,
B00101111,B11000111,B11101000,
B00110111,B10000011,B11011000,
B00110111,B10000011,B11011000,
B00111001,B00000001,B00111000,
B00111110,B00000000,B11111000,
B00111111,B11111111,B11111000
};
const unsigned char status_fan1_bmp[] PROGMEM = {
B00111111,B11111111,B11111000,
B00111110,B00110000,B11111000,
B00111001,B11110000,B00111000,
B00110001,B11110000,B00011000,
B00110000,B11110000,B00011000,
B00100000,B11110000,B01101000,
B00100000,B00110001,B11101000,
B00100000,B00111001,B11101000,
B00100000,B01111111,B11111000,
B00111111,B11111111,B11111000,
B00111111,B11111100,B00001000,
B00101111,B00111000,B00001000,
B00101110,B00011000,B00001000,
B00101100,B00011110,B00001000,
B00110000,B00011110,B00011000,
B00110000,B00011111,B00011000,
B00111000,B00011111,B00111000,
B00111110,B00011000,B11111000,
B00111111,B11111111,B11111000
};
const unsigned char status_fan2_bmp[] PROGMEM = {
B00111111,B11111111,B11111000,
B00111110,B00011000,B11111000,
B00111000,B00011111,B00111000,
B00110000,B00011111,B10011000,
B00110100,B00011111,B00011000,
B00101110,B00011110,B00001000,
B00101111,B00011100,B00001000,
B00101111,B10111000,B00001000,
B00111111,B11111100,B00001000,
B00111111,B11111111,B11111000,
B00100000,B01111111,B11111000,
B00100000,B00111011,B11101000,
B00100000,B01110001,B11101000,
B00100000,B11110000,B11101000,
B00110001,B11110000,B01011000,
B00110011,B11110000,B00011000,
B00111001,B11110000,B00111000,
B00111110,B00110000,B11111000,
B00111111,B11111111,B11111000
};
#endif // !STATUS_ALT_FAN_BITMAP
#elif STATUS_FAN_FRAMES == 4
#if ENABLED(STATUS_ALT_FAN_BITMAP)
const unsigned char status_fan0_bmp[] PROGMEM = {
B00000001,B11111111,B00000000,
B00000110,B00000000,B11000000,
B00001000,B00111111,B00100000,
B00010000,B01111110,B00010000,
B00010000,B01111100,B00010000,
B00101000,B01111100,B00001000,
B00101100,B00111000,B00001000,
B00101111,B00111001,B11001000,
B00101111,B11111111,B11101000,
B00101111,B11000111,B11101000,
B00101111,B11111111,B11101000,
B00100111,B00111001,B11101000,
B00100000,B00111000,B01101000,
B00100000,B01111100,B00101000,
B00010000,B01111100,B00010000,
B00010000,B11111100,B00010000,
B00001001,B11111000,B00100000,
B00000110,B00000000,B11000000,
B00000001,B11111111,B00000000
};
const unsigned char status_fan1_bmp[] PROGMEM = {
B00000001,B11111111,B00000000,
B00000110,B00000000,B11000000,
B00001000,B00001111,B00100000,
B00010100,B00011111,B11010000,
B00010110,B00011111,B10010000,
B00101111,B00011111,B00001000,
B00101111,B10011110,B00001000,
B00101111,B11111100,B00001000,
B00101111,B11011100,B00001000,
B00100111,B11101111,B11001000,
B00100000,B01110111,B11101000,
B00100000,B01111111,B11101000,
B00100000,B11110011,B11101000,
B00100001,B11110001,B11101000,
B00010011,B11110000,B11010000,
B00010111,B11110000,B01010000,
B00001001,B11100000,B00100000,
B00000110,B00000000,B11000000,
B00000001,B11111111,B00000000
};
const unsigned char status_fan2_bmp[] PROGMEM = {
B00000001,B11111111,B00000000,
B00000110,B10000000,B11000000,
B00001001,B10000000,B00100000,
B00010111,B10000001,B11010000,
B00010111,B11000011,B11010000,
B00100111,B11000111,B11101000,
B00100011,B11000111,B11111000,
B00100001,B11111111,B10001000,
B00100000,B01101100,B00001000,
B00100000,B01101100,B00001000,
B00100000,B01101100,B00001000,
B00100011,B11111111,B00001000,
B00111111,B11000111,B10001000,
B00101111,B11000111,B11001000,
B00010111,B10000111,B11010000,
B00010111,B00000011,B11010000,
B00001000,B00000011,B00100000,
B00000110,B00000010,B11000000,
B00000001,B11111111,B00000000
};
const unsigned char status_fan3_bmp[] PROGMEM = {
B00000001,B11111111,B00000000,
B00000110,B00000000,B11000000,
B00001001,B11110000,B00100000,
B00010001,B11100000,B00010000,
B00010001,B11100000,B00010000,
B00100001,B11100001,B11101000,
B00100000,B11110011,B11101000,
B00100000,B01111111,B11101000,
B00100000,B01110111,B11101000,
B00101000,B11101110,B00101000,
B00101111,B11011100,B00001000,
B00101111,B11111100,B00001000,
B00101111,B10011110,B00001000,
B00101111,B00001111,B00001000,
B00010000,B00001111,B00010000,
B00010000,B00001111,B00010000,
B00001000,B00011111,B00100000,
B00000110,B00000000,B11000000,
B00000001,B11111111,B00000000
};
#else // !STATUS_ALT_FAN_BITMAP
const unsigned char status_fan0_bmp[] PROGMEM = {
B00111111,B11111111,B11111000,
B00111110,B00000000,B11111000,
B00111000,B00111111,B00111000,
B00110000,B01111110,B00011000,
B00110000,B01111100,B00011000,
B00101000,B01111100,B00001000,
B00101100,B00111000,B00001000,
B00101111,B00111001,B11001000,
B00101111,B11111111,B11101000,
B00101111,B11000111,B11101000,
B00101111,B11111111,B11101000,
B00100111,B00111001,B11101000,
B00100000,B00111000,B01101000,
B00100000,B01111100,B00101000,
B00110000,B01111100,B00011000,
B00110000,B11111100,B00011000,
B00111001,B11111000,B00111000,
B00111110,B00000000,B11111000,
B00111111,B11111111,B11111000
};
const unsigned char status_fan1_bmp[] PROGMEM = {
B00111111,B11111111,B11111000,
B00111110,B00000000,B11111000,
B00111000,B00001111,B00111000,
B00110100,B00011111,B11011000,
B00110110,B00011111,B10011000,
B00101111,B00011111,B00001000,
B00101111,B10011110,B00001000,
B00101111,B11111100,B00001000,
B00101111,B11011100,B00001000,
B00100111,B11101111,B11001000,
B00100000,B01110111,B11101000,
B00100000,B01111111,B11101000,
B00100000,B11110011,B11101000,
B00100001,B11110001,B11101000,
B00110011,B11110000,B11011000,
B00110111,B11110000,B01011000,
B00111001,B11100000,B00111000,
B00111110,B00000000,B11111000,
B00111111,B11111111,B11111000
};
const unsigned char status_fan2_bmp[] PROGMEM = {
B00111111,B11111111,B11111000,
B00111110,B10000000,B11111000,
B00111001,B10000000,B00111000,
B00110111,B10000001,B11011000,
B00110111,B11000011,B11011000,
B00100111,B11000111,B11101000,
B00100011,B11000111,B11111000,
B00100001,B11111111,B10001000,
B00100000,B01101100,B00001000,
B00100000,B01101100,B00001000,
B00100000,B01101100,B00001000,
B00100011,B11111111,B00001000,
B00111111,B11000111,B10001000,
B00101111,B11000111,B11001000,
B00110111,B10000111,B11011000,
B00110111,B00000011,B11011000,
B00111000,B00000011,B00111000,
B00111110,B00000010,B11111000,
B00111111,B11111111,B11111000
};
const unsigned char status_fan3_bmp[] PROGMEM = {
B00111111,B11111111,B11111000,
B00111110,B00000000,B11111000,
B00111001,B11110000,B00111000,
B00110001,B11100000,B00011000,
B00110001,B11100000,B00011000,
B00100001,B11100001,B11101000,
B00100000,B11110011,B11101000,
B00100000,B01111111,B11101000,
B00100000,B01110111,B11101000,
B00101000,B11101110,B00101000,
B00101111,B11011100,B00001000,
B00101111,B11111100,B00001000,
B00101111,B10011110,B00001000,
B00101111,B00001111,B00001000,
B00110000,B00001111,B00011000,
B00110000,B00001111,B00011000,
B00111000,B00011111,B00111000,
B00111110,B00000000,B11111000,
B00111111,B11111111,B11111000
};
#endif // !STATUS_ALT_FAN_BITMAP
#endif

View file

@ -0,0 +1,336 @@
/**
* 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
//
// lcd/dogm/status/hotend.h - Status Screen Hotends bitmaps
//
#define STATUS_HOTEND1_WIDTH 16
#define MAX_HOTEND_BITMAPS 5
#if HOTENDS > MAX_HOTEND_BITMAPS
#define STATUS_HOTEND_BITMAPS MAX_HOTEND_BITMAPS
#else
#define STATUS_HOTEND_BITMAPS HOTENDS
#endif
#if HOTENDS == 1 || ENABLED(STATUS_HOTEND_NUMBERLESS)
const unsigned char status_hotend_a_bmp[] PROGMEM = {
B00011111,B11100000,
B00111111,B11110000,
B00111111,B11110000,
B00111111,B11110000,
B00011111,B11100000,
B00011111,B11100000,
B00111111,B11110000,
B00111111,B11110000,
B00111111,B11110000,
B00001111,B11000000,
B00000111,B10000000,
B00000011,B00000000
};
#ifdef STATUS_HOTEND_ANIM
const unsigned char status_hotend_b_bmp[] PROGMEM = {
B00011111,B11100000,
B00100000,B00010000,
B00100000,B00010000,
B00100000,B00010000,
B00010000,B00100000,
B00010000,B00100000,
B00100000,B00010000,
B00100000,B00010000,
B00110000,B00110000,
B00001000,B01000000,
B00000100,B10000000,
B00000011,B00000000
};
#endif
#elif HOTENDS >= 2
#ifdef STATUS_HOTEND_ANIM
const unsigned char status_hotend1_a_bmp[] PROGMEM = {
B00011111,B11100000,
B00111111,B11110000,
B00111110,B11110000,
B00111100,B11110000,
B00011010,B11100000,
B00011110,B11100000,
B00111110,B11110000,
B00111110,B11110000,
B00111110,B11110000,
B00001111,B11000000,
B00000111,B10000000,
B00000011,B00000000
};
const unsigned char status_hotend1_b_bmp[] PROGMEM = {
B00011111,B11100000,
B00100000,B00010000,
B00100001,B00010000,
B00100011,B00010000,
B00010101,B00100000,
B00010001,B00100000,
B00100001,B00010000,
B00100001,B00010000,
B00110001,B00110000,
B00001000,B01000000,
B00000100,B10000000,
B00000011,B00000000
};
const unsigned char status_hotend2_a_bmp[] PROGMEM = {
B00011111,B11100000,
B00111111,B11110000,
B00111100,B11110000,
B00111011,B01110000,
B00011111,B01100000,
B00011110,B11100000,
B00111101,B11110000,
B00111011,B11110000,
B00111000,B01110000,
B00001111,B11000000,
B00000111,B10000000,
B00000011,B00000000
};
const unsigned char status_hotend2_b_bmp[] PROGMEM = {
B00011111,B11100000,
B00100000,B00010000,
B00100011,B00010000,
B00100100,B10010000,
B00010000,B10100000,
B00010001,B00100000,
B00100010,B00010000,
B00100100,B00010000,
B00110111,B10110000,
B00001000,B01000000,
B00000100,B10000000,
B00000011,B00000000
};
#else
const unsigned char status_hotend1_a_bmp[] PROGMEM = {
B00011111,B11100000,
B00111110,B11110000,
B00111100,B11110000,
B00111010,B11110000,
B00011110,B11100000,
B00011110,B11100000,
B00111110,B11110000,
B00111110,B11110000,
B00111111,B11110000,
B00001111,B11000000,
B00000111,B10000000,
B00000011,B00000000
};
const unsigned char status_hotend2_a_bmp[] PROGMEM = {
B00011111,B11100000,
B00111100,B11110000,
B00111011,B01110000,
B00111111,B01110000,
B00011110,B11100000,
B00011101,B11100000,
B00111011,B11110000,
B00111000,B01110000,
B00111111,B11110000,
B00001111,B11000000,
B00000111,B10000000,
B00000011,B00000000
};
#endif
#if STATUS_HOTEND_BITMAPS >= 3
#ifdef STATUS_HOTEND_ANIM
const unsigned char status_hotend3_a_bmp[] PROGMEM = {
B00011111,B11100000,
B00111111,B11110000,
B00111100,B11110000,
B00111011,B01110000,
B00011111,B01100000,
B00011100,B11100000,
B00111111,B01110000,
B00111011,B01110000,
B00111100,B11110000,
B00001111,B11000000,
B00000111,B10000000,
B00000011,B00000000
};
const unsigned char status_hotend3_b_bmp[] PROGMEM = {
B00011111,B11100000,
B00100000,B00010000,
B00100011,B00010000,
B00100100,B10010000,
B00010000,B10100000,
B00010011,B00100000,
B00100000,B10010000,
B00100100,B10010000,
B00110011,B00110000,
B00001000,B01000000,
B00000100,B10000000,
B00000011,B00000000
};
#else
const unsigned char status_hotend3_a_bmp[] PROGMEM = {
B00011111,B11100000,
B00111100,B11110000,
B00111011,B01110000,
B00111111,B01110000,
B00011100,B11100000,
B00011111,B01100000,
B00111011,B01110000,
B00111100,B11110000,
B00111111,B11110000,
B00001111,B11000000,
B00000111,B10000000,
B00000011,B00000000
};
#endif
#endif
#if STATUS_HOTEND_BITMAPS >= 4
#ifdef STATUS_HOTEND_ANIM
const unsigned char status_hotend4_a_bmp[] PROGMEM = {
B00011111,B11100000,
B00111111,B11110000,
B00111011,B01110000,
B00111011,B01110000,
B00011011,B01100000,
B00011011,B01100000,
B00111000,B00110000,
B00111111,B01110000,
B00111111,B01110000,
B00001111,B11000000,
B00000111,B10000000,
B00000011,B00000000
};
const unsigned char status_hotend4_b_bmp[] PROGMEM = {
B00011111,B11100000,
B00100000,B00010000,
B00100100,B10010000,
B00100100,B10010000,
B00010100,B10100000,
B00010100,B10100000,
B00100111,B11010000,
B00100000,B10010000,
B00110000,B10110000,
B00001000,B01000000,
B00000100,B10000000,
B00000011,B00000000
};
#else
const unsigned char status_hotend4_a_bmp[] PROGMEM = {
B00011111,B11100000,
B00111011,B01110000,
B00111011,B01110000,
B00111011,B01110000,
B00011011,B01100000,
B00011000,B00100000,
B00111111,B01110000,
B00111111,B01110000,
B00111111,B11110000,
B00001111,B11000000,
B00000111,B10000000,
B00000011,B00000000
};
#endif
#endif
#if STATUS_HOTEND_BITMAPS >= 5
#ifdef STATUS_HOTEND_ANIM
const unsigned char status_hotend5_a_bmp[] PROGMEM = {
B00011111,B11100000,
B00111111,B11110000,
B00111000,B01110000,
B00111011,B11110000,
B00011000,B11100000,
B00011111,B01100000,
B00111111,B01110000,
B00111011,B01110000,
B00111100,B11110000,
B00001111,B11000000,
B00000111,B10000000,
B00000011,B00000000
};
const unsigned char status_hotend5_b_bmp[] PROGMEM = {
B00011111,B11100000,
B00100000,B00010000,
B00100111,B10010000,
B00100100,B00010000,
B00010111,B00100000,
B00010000,B10100000,
B00100000,B10010000,
B00100100,B10010000,
B00110011,B00110000,
B00001000,B01000000,
B00000100,B10000000,
B00000011,B00000000
};
#else
const unsigned char status_hotend5_a_bmp[] PROGMEM = {
B00011111,B11100000,
B00111000,B01110000,
B00111011,B11110000,
B00111000,B11110000,
B00011111,B01100000,
B00011111,B01100000,
B00111011,B01110000,
B00111100,B11110000,
B00111111,B11110000,
B00001111,B11000000,
B00000111,B10000000,
B00000011,B00000000
};
#endif
#endif
#endif

View file

@ -104,6 +104,9 @@
#if DO_DRAW_HOTENDS
#define MAX_HOTEND_DRAW _MIN(HOTENDS, ((LCD_PIXEL_WIDTH - (STATUS_LOGO_BYTEWIDTH + STATUS_FAN_BYTEWIDTH) * 8) / (STATUS_HEATERS_XSPACE)))
#endif
#if EITHER(DO_DRAW_BED, DO_DRAW_HOTENDS)
#define STATUS_HEATERS_BOT (STATUS_HEATERS_Y + STATUS_HEATERS_HEIGHT - 1)
#endif

View file

@ -55,7 +55,7 @@
#include "../../inc/MarlinConfigPre.h"
#if HAS_MARLINUI_U8GLIB
#if HAS_MARLINUI_U8GLIB && DISABLED(TFT_CLASSIC_UI)
#include "HAL_LCD_com_defines.h"

View file

@ -73,10 +73,8 @@ TFT_IO tftio;
#define HEIGHT LCD_PIXEL_HEIGHT
#define PAGE_HEIGHT 8
#include "../scaled_tft.h"
#include "../touch/touch_buttons.h"
#define UPSCALE0(M) ((M) * (GRAPHICAL_TFT_UPSCALE))
#define UPSCALE(A,M) (UPSCALE0(M) + (A))
#define X_HI (UPSCALE(TFT_PIXEL_OFFSET_X, WIDTH) - 1)
#define Y_HI (UPSCALE(TFT_PIXEL_OFFSET_Y, HEIGHT) - 1)
@ -276,29 +274,10 @@ static void setWindow(u8g_t *u8g, u8g_dev_t *dev, uint16_t Xmin, uint16_t Ymin,
B01111111,B11111111,B11111111,B11111110,
};
#define BUTTON_SIZE_X 32
#define BUTTON_SIZE_Y 20
// 14, 90, 166, 242, 185 are the original values upscaled 2x.
#define BUTTOND_X_LO UPSCALE0(14 / 2)
#define BUTTOND_X_HI (UPSCALE(BUTTOND_X_LO, BUTTON_SIZE_X) - 1)
#define BUTTONA_X_LO UPSCALE0(90 / 2)
#define BUTTONA_X_HI (UPSCALE(BUTTONA_X_LO, BUTTON_SIZE_X) - 1)
#define BUTTONB_X_LO UPSCALE0(166 / 2)
#define BUTTONB_X_HI (UPSCALE(BUTTONB_X_LO, BUTTON_SIZE_X) - 1)
#define BUTTONC_X_LO UPSCALE0(242 / 2)
#define BUTTONC_X_HI (UPSCALE(BUTTONC_X_LO, BUTTON_SIZE_X) - 1)
#define BUTTON_Y_LO UPSCALE0(140 / 2) + 44 // 184 2x, 254 3x
#define BUTTON_Y_HI (UPSCALE(BUTTON_Y_LO, BUTTON_SIZE_Y) - 1)
void drawImage(const uint8_t *data, u8g_t *u8g, u8g_dev_t *dev, uint16_t length, uint16_t height, uint16_t color) {
uint16_t buffer[BUTTON_SIZE_X * sq(GRAPHICAL_TFT_UPSCALE)];
uint16_t buffer[BUTTON_WIDTH * sq(GRAPHICAL_TFT_UPSCALE)];
if (length > BUTTON_SIZE_X) return;
if (length > BUTTON_WIDTH) return;
for (uint16_t i = 0; i < height; i++) {
uint16_t k = 0;
@ -368,16 +347,16 @@ uint8_t u8g_dev_tft_320x240_upscale_from_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, u
// Bottom buttons
#if HAS_TOUCH_XPT2046
setWindow(u8g, dev, BUTTOND_X_LO, BUTTON_Y_LO, BUTTOND_X_HI, BUTTON_Y_HI);
drawImage(buttonD, u8g, dev, 32, 20, TFT_BTCANCEL_COLOR);
drawImage(buttonD, u8g, dev, BUTTON_DRAW_WIDTH, BUTTON_DRAW_HEIGHT, TFT_BTCANCEL_COLOR);
setWindow(u8g, dev, BUTTONA_X_LO, BUTTON_Y_LO, BUTTONA_X_HI, BUTTON_Y_HI);
drawImage(buttonA, u8g, dev, 32, 20, TFT_BTARROWS_COLOR);
drawImage(buttonA, u8g, dev, BUTTON_DRAW_WIDTH, BUTTON_DRAW_HEIGHT, TFT_BTARROWS_COLOR);
setWindow(u8g, dev, BUTTONB_X_LO, BUTTON_Y_LO, BUTTONB_X_HI, BUTTON_Y_HI);
drawImage(buttonB, u8g, dev, 32, 20, TFT_BTARROWS_COLOR);
drawImage(buttonB, u8g, dev, BUTTON_DRAW_WIDTH, BUTTON_DRAW_HEIGHT, TFT_BTARROWS_COLOR);
setWindow(u8g, dev, BUTTONC_X_LO, BUTTON_Y_LO, BUTTONC_X_HI, BUTTON_Y_HI);
drawImage(buttonC, u8g, dev, 32, 20, TFT_BTOKMENU_COLOR);
drawImage(buttonC, u8g, dev, BUTTON_DRAW_WIDTH, BUTTON_DRAW_HEIGHT, TFT_BTOKMENU_COLOR);
#endif // HAS_TOUCH_XPT2046
return 0;

View file

@ -33,6 +33,38 @@
#include "ultralcd_st7920_u8glib_rrd_AVR.h"
#if F_CPU >= 20000000
#define CPU_ST7920_DELAY_1 DELAY_NS(0)
#define CPU_ST7920_DELAY_2 DELAY_NS(0)
#define CPU_ST7920_DELAY_3 DELAY_NS(50)
#elif MB(3DRAG, K8200, K8400)
#define CPU_ST7920_DELAY_1 DELAY_NS(0)
#define CPU_ST7920_DELAY_2 DELAY_NS(188)
#define CPU_ST7920_DELAY_3 DELAY_NS(0)
#elif MB(MINIRAMBO, EINSY_RAMBO, EINSY_RETRO, SILVER_GATE)
#define CPU_ST7920_DELAY_1 DELAY_NS(0)
#define CPU_ST7920_DELAY_2 DELAY_NS(250)
#define CPU_ST7920_DELAY_3 DELAY_NS(0)
#elif MB(RAMBO)
#define CPU_ST7920_DELAY_1 DELAY_NS(0)
#define CPU_ST7920_DELAY_2 DELAY_NS(0)
#define CPU_ST7920_DELAY_3 DELAY_NS(0)
#elif MB(BQ_ZUM_MEGA_3D)
#define CPU_ST7920_DELAY_1 DELAY_NS(0)
#define CPU_ST7920_DELAY_2 DELAY_NS(0)
#define CPU_ST7920_DELAY_3 DELAY_NS(189)
#elif defined(ARDUINO_ARCH_STM32)
#define CPU_ST7920_DELAY_1 DELAY_NS(300)
#define CPU_ST7920_DELAY_2 DELAY_NS(40)
#define CPU_ST7920_DELAY_3 DELAY_NS(340)
#elif F_CPU == 16000000
#define CPU_ST7920_DELAY_1 DELAY_NS(0)
#define CPU_ST7920_DELAY_2 DELAY_NS(0)
#define CPU_ST7920_DELAY_3 DELAY_NS(63)
#else
#error "No valid condition for delays in 'ultralcd_st7920_u8glib_rrd_AVR.h'"
#endif
#ifndef ST7920_DELAY_1
#ifdef BOARD_ST7920_DELAY_1
#define ST7920_DELAY_1 BOARD_ST7920_DELAY_1

View file

@ -37,43 +37,6 @@
#include <U8glib.h>
// If you want you can define your own set of delays in Configuration.h
//#define ST7920_DELAY_1 DELAY_NS(0)
//#define ST7920_DELAY_2 DELAY_NS(0)
//#define ST7920_DELAY_3 DELAY_NS(0)
#if F_CPU >= 20000000
#define CPU_ST7920_DELAY_1 DELAY_NS(0)
#define CPU_ST7920_DELAY_2 DELAY_NS(0)
#define CPU_ST7920_DELAY_3 DELAY_NS(50)
#elif MB(3DRAG, K8200, K8400)
#define CPU_ST7920_DELAY_1 DELAY_NS(0)
#define CPU_ST7920_DELAY_2 DELAY_NS(188)
#define CPU_ST7920_DELAY_3 DELAY_NS(0)
#elif MB(MINIRAMBO, EINSY_RAMBO, EINSY_RETRO, SILVER_GATE)
#define CPU_ST7920_DELAY_1 DELAY_NS(0)
#define CPU_ST7920_DELAY_2 DELAY_NS(250)
#define CPU_ST7920_DELAY_3 DELAY_NS(0)
#elif MB(RAMBO)
#define CPU_ST7920_DELAY_1 DELAY_NS(0)
#define CPU_ST7920_DELAY_2 DELAY_NS(0)
#define CPU_ST7920_DELAY_3 DELAY_NS(0)
#elif MB(BQ_ZUM_MEGA_3D)
#define CPU_ST7920_DELAY_1 DELAY_NS(0)
#define CPU_ST7920_DELAY_2 DELAY_NS(0)
#define CPU_ST7920_DELAY_3 DELAY_NS(189)
#elif defined(ARDUINO_ARCH_STM32)
#define CPU_ST7920_DELAY_1 DELAY_NS(300)
#define CPU_ST7920_DELAY_2 DELAY_NS(40)
#define CPU_ST7920_DELAY_3 DELAY_NS(340)
#elif F_CPU == 16000000
#define CPU_ST7920_DELAY_1 DELAY_NS(0)
#define CPU_ST7920_DELAY_2 DELAY_NS(0)
#define CPU_ST7920_DELAY_3 DELAY_NS(63)
#else
#error "No valid condition for delays in 'ultralcd_st7920_u8glib_rrd_AVR.h'"
#endif
void ST7920_SWSPI_SND_8BIT(uint8_t val);
#if DOGM_SPI_DELAY_US > 0
@ -82,8 +45,8 @@ void ST7920_SWSPI_SND_8BIT(uint8_t val);
#define U8G_DELAY() DELAY_US(10)
#endif
#define ST7920_CS() { WRITE(ST7920_CS_PIN,1); U8G_DELAY(); }
#define ST7920_NCS() { WRITE(ST7920_CS_PIN,0); }
#define ST7920_CS() { WRITE(ST7920_CS_PIN, HIGH); U8G_DELAY(); }
#define ST7920_NCS() { WRITE(ST7920_CS_PIN, LOW); }
#define ST7920_SET_CMD() { ST7920_SWSPI_SND_8BIT(0xF8); U8G_DELAY(); }
#define ST7920_SET_DAT() { ST7920_SWSPI_SND_8BIT(0xFA); U8G_DELAY(); }
#define ST7920_WRITE_BYTE(a) { ST7920_SWSPI_SND_8BIT((uint8_t)((a)&0xF0u)); ST7920_SWSPI_SND_8BIT((uint8_t)((a)<<4U)); U8G_DELAY(); }

View file

@ -594,7 +594,7 @@ inline void Item_Prepare_Home(const uint8_t row) {
if (HMI_IsChinese()) {
#if HAS_BED_PROBE
DWIN_Frame_AreaCopy(1, 174, 164, 223, 177, LBLX, MBASE(row));
DWIN_Draw_Signed_Float(font8x16, Color_Bg_Black, 2, 2, 202, MBASE(row), BABY_Z_VAR * 100);
DWIN_Draw_Signed_Float(font8x16, Color_Bg_Black, 2, 2, 202, MBASE(row), probe.offset.z * 100);
#else
DWIN_Frame_AreaCopy(1, 43, 89, 98, 101, LBLX, MBASE(row));
#endif
@ -602,7 +602,7 @@ inline void Item_Prepare_Home(const uint8_t row) {
else {
#if HAS_BED_PROBE
DWIN_Frame_AreaCopy(1, 93, 179, 141, 189, LBLX, MBASE(row)); // "Z-Offset"
DWIN_Draw_Signed_Float(font8x16, Color_Bg_Black, 2, 2, 202, MBASE(row), BABY_Z_VAR * 100);
DWIN_Draw_Signed_Float(font8x16, Color_Bg_Black, 2, 2, 202, MBASE(row), probe.offset.z * 100);
#else
DWIN_Frame_AreaCopy(1, 1, 76, 106, 86, LBLX, MBASE(row)); // "..."
#endif
@ -1271,14 +1271,8 @@ void HMI_Move_Z() {
probe.offset.z = dwin_zoffset;
TERN_(EEPROM_SETTINGS, settings.save());
#endif
if (HMI_ValueStruct.show_mode == -4) {
checkkey = Prepare;
checkkey = HMI_ValueStruct.show_mode == -4 ? Prepare : Tune;
DWIN_Draw_Signed_Float(font8x16, Color_Bg_Black, 2, 2, 202, MBASE(zoff_line), TERN(HAS_BED_PROBE, BABY_Z_VAR * 100, HMI_ValueStruct.offset_value));
}
else {
checkkey = Tune;
DWIN_Draw_Signed_Float(font8x16, Color_Bg_Black, 2, 2, 202, MBASE(zoff_line), TERN(HAS_BED_PROBE, BABY_Z_VAR * 100, HMI_ValueStruct.offset_value));
}
DWIN_UpdateLCD();
return;
}
@ -1311,11 +1305,7 @@ void HMI_Move_Z() {
}
if (Apply_Encoder(encoder_diffState, HMI_ValueStruct.E_Temp)) {
EncoderRate.enabled = false;
if (HMI_ValueStruct.show_mode == -1) { // temperature
checkkey = TemperatureID;
DWIN_Draw_IntValue(true, true, 0, font8x16, Color_White, Color_Bg_Black, 3, 216, MBASE(temp_line), HMI_ValueStruct.E_Temp);
}
else if (HMI_ValueStruct.show_mode == -2) {
if (HMI_ValueStruct.show_mode == -2) {
checkkey = PLAPreheat;
ui.material_preset[0].hotend_temp = HMI_ValueStruct.E_Temp;
DWIN_Draw_IntValue(true, true, 0, font8x16, Color_White, Color_Bg_Black, 3, 216, MBASE(temp_line), ui.material_preset[0].hotend_temp);
@ -1327,10 +1317,11 @@ void HMI_Move_Z() {
DWIN_Draw_IntValue(true, true, 0, font8x16, Color_White, Color_Bg_Black, 3, 216, MBASE(temp_line), ui.material_preset[1].hotend_temp);
return;
}
else { // tune
else if (HMI_ValueStruct.show_mode == -1) // Temperature
checkkey = TemperatureID;
else
checkkey = Tune;
DWIN_Draw_IntValue(true, true, 0, font8x16, Color_White, Color_Bg_Black, 3, 216, MBASE(temp_line), HMI_ValueStruct.E_Temp);
}
thermalManager.setTargetHotend(HMI_ValueStruct.E_Temp, 0);
return;
}
@ -1358,11 +1349,7 @@ void HMI_Move_Z() {
}
if (Apply_Encoder(encoder_diffState, HMI_ValueStruct.Bed_Temp)) {
EncoderRate.enabled = false;
if (HMI_ValueStruct.show_mode == -1) {
checkkey = TemperatureID;
DWIN_Draw_IntValue(true, true, 0, font8x16, Color_White, Color_Bg_Black, 3, 216, MBASE(bed_line), HMI_ValueStruct.Bed_Temp);
}
else if (HMI_ValueStruct.show_mode == -2) {
if (HMI_ValueStruct.show_mode == -2) {
checkkey = PLAPreheat;
ui.material_preset[0].bed_temp = HMI_ValueStruct.Bed_Temp;
DWIN_Draw_IntValue(true, true, 0, font8x16, Color_White, Color_Bg_Black, 3, 216, MBASE(bed_line), ui.material_preset[0].bed_temp);
@ -1374,10 +1361,11 @@ void HMI_Move_Z() {
DWIN_Draw_IntValue(true, true, 0, font8x16, Color_White, Color_Bg_Black, 3, 216, MBASE(bed_line), ui.material_preset[1].bed_temp);
return;
}
else {
else if (HMI_ValueStruct.show_mode == -1)
checkkey = TemperatureID;
else
checkkey = Tune;
DWIN_Draw_IntValue(true, true, 0, font8x16, Color_White, Color_Bg_Black, 3, 216, MBASE(bed_line), HMI_ValueStruct.Bed_Temp);
}
thermalManager.setTargetBed(HMI_ValueStruct.Bed_Temp);
return;
}
@ -1406,11 +1394,7 @@ void HMI_Move_Z() {
if (Apply_Encoder(encoder_diffState, HMI_ValueStruct.Fan_speed)) {
EncoderRate.enabled = false;
if (HMI_ValueStruct.show_mode == -1) {
checkkey = TemperatureID;
DWIN_Draw_IntValue(true, true, 0, font8x16, Color_White, Color_Bg_Black, 3, 216, MBASE(fan_line), HMI_ValueStruct.Fan_speed);
}
else if (HMI_ValueStruct.show_mode == -2) {
if (HMI_ValueStruct.show_mode == -2) {
checkkey = PLAPreheat;
ui.material_preset[0].fan_speed = HMI_ValueStruct.Fan_speed;
DWIN_Draw_IntValue(true, true, 0, font8x16, Color_White, Color_Bg_Black, 3, 216, MBASE(fan_line), ui.material_preset[0].fan_speed);
@ -1422,10 +1406,11 @@ void HMI_Move_Z() {
DWIN_Draw_IntValue(true, true, 0, font8x16, Color_White, Color_Bg_Black, 3, 216, MBASE(fan_line), ui.material_preset[1].fan_speed);
return;
}
else {
else if (HMI_ValueStruct.show_mode == -1)
checkkey = TemperatureID;
else
checkkey = Tune;
DWIN_Draw_IntValue(true, true, 0, font8x16, Color_White, Color_Bg_Black, 3, 216, MBASE(fan_line), HMI_ValueStruct.Fan_speed);
}
thermalManager.set_fan_speed(0, HMI_ValueStruct.Fan_speed);
return;
}
@ -1844,7 +1829,8 @@ void Draw_Status_Area(const bool with_update) {
#if HAS_ZOFFSET_ITEM
DWIN_ICON_Show(ICON, ICON_Zoffset, 158, 428);
DWIN_Draw_Signed_Float(DWIN_FONT_STAT, Color_Bg_Black, 2, 2, 178, 429, BABY_Z_VAR * 100);
dwin_zoffset = BABY_Z_VAR;
DWIN_Draw_Signed_Float(DWIN_FONT_STAT, Color_Bg_Black, 2, 2, 178, 429, dwin_zoffset * 100);
#endif
if (with_update) {
@ -2158,7 +2144,7 @@ void HMI_Printing() {
#endif
#endif
strcat_P(cmd, PSTR("M24"));
strcat_P(cmd, M24_STR);
queue.inject(cmd);
}
else {
@ -3573,7 +3559,7 @@ void EachMomentUpdate() {
else if (dwin_abort_flag && !HMI_flag.home_flag) { // Print Stop
dwin_abort_flag = false;
HMI_ValueStruct.print_speed = feedrate_percentage = 100;
dwin_zoffset = TERN0(HAS_BED_PROBE, probe.offset.z);
dwin_zoffset = BABY_Z_VAR;
select_page.set(0);
Goto_MainMenu();
}
@ -3681,6 +3667,7 @@ void DWIN_HandleScreen() {
void DWIN_CompletedHoming() {
HMI_flag.home_flag = false;
dwin_zoffset = TERN0(HAS_BED_PROBE, probe.offset.z);
if (checkkey == Last_Prepare) {
checkkey = Prepare;
select_prepare.now = PREPARE_CASE_HOME;
@ -3689,7 +3676,6 @@ void DWIN_CompletedHoming() {
}
else if (checkkey == Back_Main) {
HMI_ValueStruct.print_speed = feedrate_percentage = 100;
dwin_zoffset = TERN0(HAS_BED_PROBE, probe.offset.z);
planner.finish_and_disable();
Goto_MainMenu();
}

View file

@ -54,7 +54,7 @@
#define MAX_PATH_LEN 16 * MAX_FOLDER_DEPTH // Maximum number of characters in a SD file path
#define AC_HEATER_FAULT_VALIDATION_TIME 5 // number of 1/2 second loops before signalling a heater fault
#define AC_LOWEST_MESHPOINT_VAL -7.00 // The lowest value you can set for a single mesh point offset
#define AC_LOWEST_MESHPOINT_VAL Z_PROBE_LOW_POINT // The lowest value you can set for a single mesh point offset
// TFT panel commands
#define AC_msg_sd_card_inserted PSTR("J00")

View file

@ -26,7 +26,7 @@
#if ENABLED(DGUS_LCD_UI_FYSETC)
#include "../DGUSDisplayDef.h"
#include "DGUSDisplayDef.h"
#include "../DGUSDisplay.h"
#include "../DGUSScreenHandler.h"

View file

@ -21,6 +21,8 @@
*/
#pragma once
#include "../DGUSDisplayDef.h"
enum DGUSLCD_Screens : uint8_t {
DGUSLCD_SCREEN_BOOT = 0,
DGUSLCD_SCREEN_MAIN = 1,

View file

@ -253,6 +253,9 @@
#define __TERN(T,V...) ___TERN(_CAT(_NO,T),V) // Prepend '_NO' to get '_NOT_0' or '_NOT_1'
#define ___TERN(P,V...) THIRD(P,V) // If first argument has a comma, A. Else B.
#define IF_ENABLED TERN_
#define IF_DISABLED(O,A) _TERN(_ENA_1(O),,A)
#define ANY(V...) !DISABLED(V)
#define NONE(V...) DISABLED(V)
#define ALL(V...) ENABLED(V)

View file

@ -435,7 +435,7 @@
base_char = base_special ? NO_DOT_I : std_char;
}
// If cmd != NULL, draw the glyph to the screen
// If cmd != nullptr, draw the glyph to the screen
if (cmd) {
ext_vertex2ii(*cmd, x, y, base_special ? alt_font : std_font, base_char);
if (accent_char)

View file

@ -90,7 +90,7 @@ class PolyReader {
if (start_x != eol)
close_loop();
else
p = NULL;
p = nullptr;
}
else {
x = pgm_read_word_far(p++);
@ -106,7 +106,7 @@ class PolyReader {
}
}
bool has_more() { return p != NULL; }
bool has_more() { return p != nullptr; }
bool end_of_loop() { return start_x == eol; }
};

View file

@ -10,7 +10,7 @@
* 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/>. *
* location: <https://www.gnu.org/licenses/>. *
****************************************************************************/
/**

View file

@ -181,7 +181,7 @@ static void disp_language(uint8_t language, uint8_t state) {
strcat_P(public_buf_l, PSTR(".bin"));
lv_obj_set_event_cb_mks(obj, event_handler, id, nullptr, 0);
lv_obj_set_event_cb_mks(obj, event_handler, id, "", 0);
lv_imgbtn_set_src_both(obj, public_buf_l);
if (state == UNSELECTED) lv_obj_refresh_ext_draw_pad(obj);

View file

@ -279,7 +279,7 @@ void disp_gcode_icon(uint8_t file_num) {
cutFileName((char *)list_file.long_name[i], 16, 8, (char *)public_buf_m);
if (list_file.IsFolder[i]) {
lv_obj_set_event_cb_mks(buttonGcode[i], event_handler, (i + 1), nullptr, 0);
lv_obj_set_event_cb_mks(buttonGcode[i], event_handler, (i + 1), "", 0);
lv_imgbtn_set_src_both(buttonGcode[i], "F:/bmp_dir.bin");
if (i < 3)
lv_obj_set_pos(buttonGcode[i], BTN_X_PIXEL * i + INTERVAL_V * (i + 1), titleHeight);
@ -298,7 +298,7 @@ void disp_gcode_icon(uint8_t file_num) {
strcat(test_public_buf_l, list_file.file_name[i]);
char *temp = strstr(test_public_buf_l, ".GCO");
if (temp) strcpy(temp, ".bin");
lv_obj_set_event_cb_mks(buttonGcode[i], event_handler, (i + 1), nullptr, 0);
lv_obj_set_event_cb_mks(buttonGcode[i], event_handler, (i + 1), "", 0);
lv_imgbtn_set_src_both(buttonGcode[i], test_public_buf_l);
if (i < 3) {
lv_obj_set_pos(buttonGcode[i], BTN_X_PIXEL * i + INTERVAL_V * (i + 1) + FILE_PRE_PIC_X_OFFSET, titleHeight + FILE_PRE_PIC_Y_OFFSET);
@ -308,7 +308,7 @@ void disp_gcode_icon(uint8_t file_num) {
lv_btn_use_label_style(buttonText[i]);
lv_obj_clear_protect(buttonText[i], LV_PROTECT_FOLLOW);
lv_btn_set_layout(buttonText[i], LV_LAYOUT_OFF);
//lv_obj_set_event_cb_mks(buttonText[i], event_handler,(i+10),nullptr, 0);
//lv_obj_set_event_cb_mks(buttonText[i], event_handler,(i+10),"", 0);
lv_obj_set_pos(buttonText[i], BTN_X_PIXEL * i + INTERVAL_V * (i + 1) + FILE_PRE_PIC_X_OFFSET, titleHeight + FILE_PRE_PIC_Y_OFFSET + 100);
lv_obj_set_size(buttonText[i], 100, 40);
}
@ -320,7 +320,7 @@ void disp_gcode_icon(uint8_t file_num) {
lv_btn_use_label_style(buttonText[i]);
lv_obj_clear_protect(buttonText[i], LV_PROTECT_FOLLOW);
lv_btn_set_layout(buttonText[i], LV_LAYOUT_OFF);
//lv_obj_set_event_cb_mks(buttonText[i], event_handler,(i+10),nullptr, 0);
//lv_obj_set_event_cb_mks(buttonText[i], event_handler,(i+10),"", 0);
lv_obj_set_pos(buttonText[i], BTN_X_PIXEL * (i - 3) + INTERVAL_V * ((i - 3) + 1) + FILE_PRE_PIC_X_OFFSET, BTN_Y_PIXEL + INTERVAL_H + titleHeight + FILE_PRE_PIC_Y_OFFSET + 100);
lv_obj_set_size(buttonText[i], 100, 40);
}
@ -328,7 +328,7 @@ void disp_gcode_icon(uint8_t file_num) {
lv_obj_align(labelPageUp[i], buttonText[i], LV_ALIGN_IN_BOTTOM_MID, 0, 0);
}
else {
lv_obj_set_event_cb_mks(buttonGcode[i], event_handler, (i + 1), nullptr, 0);
lv_obj_set_event_cb_mks(buttonGcode[i], event_handler, (i + 1), "", 0);
lv_imgbtn_set_src_both(buttonGcode[i], "F:/bmp_file.bin");
if (i < 3)
lv_obj_set_pos(buttonGcode[i], BTN_X_PIXEL * i + INTERVAL_V * (i + 1), titleHeight);

View file

@ -1680,7 +1680,7 @@ lv_obj_t* lv_label_create(lv_obj_t *par, lv_coord_t x, lv_coord_t y, const char
lv_obj_t* lv_btn_create(lv_obj_t *par, lv_event_cb_t cb, const int id/*=0*/, lv_style_t *style/*=&style_para_value*/) {
lv_obj_t *btn = lv_btn_create(par, nullptr);
if (id)
lv_obj_set_event_cb_mks(btn, cb, id, nullptr, 0);
lv_obj_set_event_cb_mks(btn, cb, id, "", 0);
else
lv_obj_set_event_cb(btn, cb);
lv_btn_set_style_both(btn, style);
@ -1748,7 +1748,7 @@ lv_obj_t* lv_imgbtn_create(lv_obj_t *par, const char *img, lv_event_cb_t cb, con
lv_obj_t *btn = lv_imgbtn_create(par, nullptr);
if (img) lv_imgbtn_set_src_both(btn, img);
if (id)
lv_obj_set_event_cb_mks(btn, cb, id, nullptr, 0);
lv_obj_set_event_cb_mks(btn, cb, id, "", 0);
else
lv_obj_set_event_cb(btn, cb);
lv_imgbtn_use_label_style(btn);
@ -1785,7 +1785,7 @@ lv_obj_t* lv_screen_menu_item(lv_obj_t *par, const char *text, lv_coord_t x, lv_
lv_obj_t *btn = lv_btn_create(par, nullptr); /*Add a button the current screen*/
lv_obj_set_pos(btn, x, y); /*Set its position*/
lv_obj_set_size(btn, PARA_UI_SIZE_X, PARA_UI_SIZE_Y); /*Set its size*/
if (id > -1) lv_obj_set_event_cb_mks(btn, cb, id, nullptr, 0);
if (id > -1) lv_obj_set_event_cb_mks(btn, cb, id, "", 0);
lv_btn_use_label_style(btn);
lv_btn_set_layout(btn, LV_LAYOUT_OFF);
lv_obj_t *label = lv_label_create_empty(btn); /*Add a label to the button*/

View file

@ -73,7 +73,7 @@ void lv_draw_wifi(void) {
buttonReconnect = lv_imgbtn_create(scr, nullptr);
lv_obj_set_event_cb_mks(buttonReconnect, event_handler, ID_W_RECONNECT, nullptr, 0);
lv_obj_set_event_cb_mks(buttonReconnect, event_handler, ID_W_RECONNECT, "", 0);
lv_imgbtn_set_src_both(buttonReconnect, "F:/bmp_wifi.bin");
lv_imgbtn_use_label_style(buttonReconnect);

View file

@ -32,6 +32,7 @@
#include "../../../../module/motion.h"
#include "../../../../sd/cardreader.h"
#include "../../../../inc/MarlinConfig.h"
#include "../../../../MarlinCore.h"
#if ENABLED(POWER_LOSS_RECOVERY)
#include "../../../../feature/powerloss.h"
@ -95,7 +96,7 @@ void printer_state_polling() {
gcode.process_subcommands_now(public_buf_l);
gcode.process_subcommands_now_P(PSTR("G90"));
}
gcode.process_subcommands_now_P(PSTR("M24"));
gcode.process_subcommands_now_P(M24_STR);
uiCfg.print_state = WORKING;
start_print_time();

View file

@ -21,7 +21,7 @@
*/
#include "../../../../inc/MarlinConfigPre.h"
#if HAS_TFT_LVGL_UI
#if BOTH(HAS_TFT_LVGL_UI, USE_WIFI_FUNCTION)
#include "draw_ui.h"
#include "wifi_module.h"
@ -822,4 +822,4 @@ int32_t wifi_upload(int type) {
return esp_upload.uploadResult == success ? 0 : -1;
}
#endif // HAS_TFT_LVGL_UI
#endif // HAS_TFT_LVGL_UI && USE_WIFI_FUNCTION

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