Merge remote-tracking branch 'upstream/bugfix-2.0.x' into PRR/20383_AddMinimumTempForNozzleAsProbe
This commit is contained in:
@@ -1197,6 +1197,7 @@
|
||||
|
||||
#define SD_MENU_CONFIRM_START // Confirm the selected SD file before printing
|
||||
|
||||
//#define NO_SD_AUTOSTART // Remove auto#.g file support completely to save some Flash, SRAM
|
||||
//#define MENU_ADDAUTOSTART // Add a menu option to run auto#.g files
|
||||
|
||||
//#define BROWSE_MEDIA_ON_INSERT // Open the file browser when media is inserted
|
||||
|
||||
@@ -212,3 +212,11 @@ inline void HAL_reboot() {} // reboot the board or restart the bootloader
|
||||
#ifndef strcmp_P
|
||||
#define strcmp_P(a, b) strcmp((a), (b))
|
||||
#endif
|
||||
|
||||
#ifndef strcat_P
|
||||
#define strcat_P(a, b) strcat((a), (b))
|
||||
#endif
|
||||
|
||||
#ifndef strcpy_P
|
||||
#define strcpy_P(a, b) strcpy((a), (b))
|
||||
#endif
|
||||
|
||||
@@ -51,3 +51,7 @@
|
||||
#elif ENABLED(SERIAL_STATS_DROPPED_RX)
|
||||
#error "SERIAL_STATS_DROPPED_RX is not supported on this platform."
|
||||
#endif
|
||||
|
||||
#if ANY(TFT_COLOR_UI, TFT_LVGL_UI, TFT_CLASSIC_UI) && NOT_TARGET(STM32F4xx, STM32F1xx)
|
||||
#error "TFT_COLOR_UI, TFT_LVGL_UI and TFT_CLASSIC_UI are currently only supported on STM32F4 and STM32F1 hardware."
|
||||
#endif
|
||||
|
||||
@@ -137,32 +137,18 @@ const XrefInfo pin_xref[] PROGMEM = {
|
||||
#endif
|
||||
|
||||
uint8_t get_pin_mode(const pin_t Ard_num) {
|
||||
uint32_t mode_all = 0;
|
||||
const PinName dp = digitalPinToPinName(Ard_num);
|
||||
switch (PORT_ALPHA(dp)) {
|
||||
case 'A' : mode_all = GPIOA->MODER; break;
|
||||
case 'B' : mode_all = GPIOB->MODER; break;
|
||||
case 'C' : mode_all = GPIOC->MODER; break;
|
||||
case 'D' : mode_all = GPIOD->MODER; break;
|
||||
#ifdef PE_0
|
||||
case 'E' : mode_all = GPIOE->MODER; break;
|
||||
#elif defined(PF_0)
|
||||
case 'F' : mode_all = GPIOF->MODER; break;
|
||||
#elif defined(PG_0)
|
||||
case 'G' : mode_all = GPIOG->MODER; break;
|
||||
#elif defined(PH_0)
|
||||
case 'H' : mode_all = GPIOH->MODER; break;
|
||||
#elif defined(PI_0)
|
||||
case 'I' : mode_all = GPIOI->MODER; break;
|
||||
#elif defined(PJ_0)
|
||||
case 'J' : mode_all = GPIOJ->MODER; break;
|
||||
#elif defined(PK_0)
|
||||
case 'K' : mode_all = GPIOK->MODER; break;
|
||||
#elif defined(PL_0)
|
||||
case 'L' : mode_all = GPIOL->MODER; break;
|
||||
#endif
|
||||
uint32_t ll_pin = STM_LL_GPIO_PIN(dp);
|
||||
GPIO_TypeDef *port = get_GPIO_Port(STM_PORT(dp));
|
||||
uint32_t mode = LL_GPIO_GetPinMode(port, ll_pin);
|
||||
switch (mode) {
|
||||
case LL_GPIO_MODE_ANALOG: return MODE_PIN_ANALOG;
|
||||
case LL_GPIO_MODE_INPUT: return MODE_PIN_INPUT;
|
||||
case LL_GPIO_MODE_OUTPUT: return MODE_PIN_OUTPUT;
|
||||
case LL_GPIO_MODE_ALTERNATE: return MODE_PIN_ALT;
|
||||
TERN_(STM32F1xx, case LL_GPIO_MODE_FLOATING:)
|
||||
default: return 0;
|
||||
}
|
||||
return (mode_all >> (2 * uint8_t(PIN_NUM(dp)))) & 0x03;
|
||||
}
|
||||
|
||||
bool GET_PINMODE(const pin_t Ard_num) {
|
||||
@@ -217,58 +203,62 @@ bool pwm_status(const pin_t Ard_num) {
|
||||
}
|
||||
|
||||
void pwm_details(const pin_t Ard_num) {
|
||||
if (pwm_status(Ard_num)) {
|
||||
uint32_t alt_all = 0;
|
||||
const PinName dp = digitalPinToPinName(Ard_num);
|
||||
pin_t pin_number = uint8_t(PIN_NUM(dp));
|
||||
const bool over_7 = pin_number >= 8;
|
||||
const uint8_t ind = over_7 ? 1 : 0;
|
||||
switch (PORT_ALPHA(dp)) { // get alt function
|
||||
case 'A' : alt_all = GPIOA->AFR[ind]; break;
|
||||
case 'B' : alt_all = GPIOB->AFR[ind]; break;
|
||||
case 'C' : alt_all = GPIOC->AFR[ind]; break;
|
||||
case 'D' : alt_all = GPIOD->AFR[ind]; break;
|
||||
#ifdef PE_0
|
||||
case 'E' : alt_all = GPIOE->AFR[ind]; break;
|
||||
#elif defined (PF_0)
|
||||
case 'F' : alt_all = GPIOF->AFR[ind]; break;
|
||||
#elif defined (PG_0)
|
||||
case 'G' : alt_all = GPIOG->AFR[ind]; break;
|
||||
#elif defined (PH_0)
|
||||
case 'H' : alt_all = GPIOH->AFR[ind]; break;
|
||||
#elif defined (PI_0)
|
||||
case 'I' : alt_all = GPIOI->AFR[ind]; break;
|
||||
#elif defined (PJ_0)
|
||||
case 'J' : alt_all = GPIOJ->AFR[ind]; break;
|
||||
#elif defined (PK_0)
|
||||
case 'K' : alt_all = GPIOK->AFR[ind]; break;
|
||||
#elif defined (PL_0)
|
||||
case 'L' : alt_all = GPIOL->AFR[ind]; break;
|
||||
#endif
|
||||
}
|
||||
if (over_7) pin_number -= 8;
|
||||
#ifndef STM32F1xx
|
||||
if (pwm_status(Ard_num)) {
|
||||
uint32_t alt_all = 0;
|
||||
const PinName dp = digitalPinToPinName(Ard_num);
|
||||
pin_t pin_number = uint8_t(PIN_NUM(dp));
|
||||
const bool over_7 = pin_number >= 8;
|
||||
const uint8_t ind = over_7 ? 1 : 0;
|
||||
switch (PORT_ALPHA(dp)) { // get alt function
|
||||
case 'A' : alt_all = GPIOA->AFR[ind]; break;
|
||||
case 'B' : alt_all = GPIOB->AFR[ind]; break;
|
||||
case 'C' : alt_all = GPIOC->AFR[ind]; break;
|
||||
case 'D' : alt_all = GPIOD->AFR[ind]; break;
|
||||
#ifdef PE_0
|
||||
case 'E' : alt_all = GPIOE->AFR[ind]; break;
|
||||
#elif defined (PF_0)
|
||||
case 'F' : alt_all = GPIOF->AFR[ind]; break;
|
||||
#elif defined (PG_0)
|
||||
case 'G' : alt_all = GPIOG->AFR[ind]; break;
|
||||
#elif defined (PH_0)
|
||||
case 'H' : alt_all = GPIOH->AFR[ind]; break;
|
||||
#elif defined (PI_0)
|
||||
case 'I' : alt_all = GPIOI->AFR[ind]; break;
|
||||
#elif defined (PJ_0)
|
||||
case 'J' : alt_all = GPIOJ->AFR[ind]; break;
|
||||
#elif defined (PK_0)
|
||||
case 'K' : alt_all = GPIOK->AFR[ind]; break;
|
||||
#elif defined (PL_0)
|
||||
case 'L' : alt_all = GPIOL->AFR[ind]; break;
|
||||
#endif
|
||||
}
|
||||
if (over_7) pin_number -= 8;
|
||||
|
||||
uint8_t alt_func = (alt_all >> (4 * pin_number)) & 0x0F;
|
||||
SERIAL_ECHOPAIR("Alt Function: ", alt_func);
|
||||
if (alt_func < 10) SERIAL_CHAR(' ');
|
||||
SERIAL_ECHOPGM(" - ");
|
||||
switch (alt_func) {
|
||||
case 0 : SERIAL_ECHOPGM("system (misc. I/O)"); break;
|
||||
case 1 : SERIAL_ECHOPGM("TIM1/TIM2 (probably PWM)"); break;
|
||||
case 2 : SERIAL_ECHOPGM("TIM3..5 (probably PWM)"); break;
|
||||
case 3 : SERIAL_ECHOPGM("TIM8..11 (probably PWM)"); break;
|
||||
case 4 : SERIAL_ECHOPGM("I2C1..3"); break;
|
||||
case 5 : SERIAL_ECHOPGM("SPI1/SPI2"); break;
|
||||
case 6 : SERIAL_ECHOPGM("SPI3"); break;
|
||||
case 7 : SERIAL_ECHOPGM("USART1..3"); break;
|
||||
case 8 : SERIAL_ECHOPGM("USART4..6"); break;
|
||||
case 9 : SERIAL_ECHOPGM("CAN1/CAN2, TIM12..14 (probably PWM)"); break;
|
||||
case 10 : SERIAL_ECHOPGM("OTG"); break;
|
||||
case 11 : SERIAL_ECHOPGM("ETH"); break;
|
||||
case 12 : SERIAL_ECHOPGM("FSMC, SDIO, OTG"); break;
|
||||
case 13 : SERIAL_ECHOPGM("DCMI"); break;
|
||||
case 14 : SERIAL_ECHOPGM("unused (shouldn't see this)"); break;
|
||||
case 15 : SERIAL_ECHOPGM("EVENTOUT"); break;
|
||||
uint8_t alt_func = (alt_all >> (4 * pin_number)) & 0x0F;
|
||||
SERIAL_ECHOPAIR("Alt Function: ", alt_func);
|
||||
if (alt_func < 10) SERIAL_CHAR(' ');
|
||||
SERIAL_ECHOPGM(" - ");
|
||||
switch (alt_func) {
|
||||
case 0 : SERIAL_ECHOPGM("system (misc. I/O)"); break;
|
||||
case 1 : SERIAL_ECHOPGM("TIM1/TIM2 (probably PWM)"); break;
|
||||
case 2 : SERIAL_ECHOPGM("TIM3..5 (probably PWM)"); break;
|
||||
case 3 : SERIAL_ECHOPGM("TIM8..11 (probably PWM)"); break;
|
||||
case 4 : SERIAL_ECHOPGM("I2C1..3"); break;
|
||||
case 5 : SERIAL_ECHOPGM("SPI1/SPI2"); break;
|
||||
case 6 : SERIAL_ECHOPGM("SPI3"); break;
|
||||
case 7 : SERIAL_ECHOPGM("USART1..3"); break;
|
||||
case 8 : SERIAL_ECHOPGM("USART4..6"); break;
|
||||
case 9 : SERIAL_ECHOPGM("CAN1/CAN2, TIM12..14 (probably PWM)"); break;
|
||||
case 10 : SERIAL_ECHOPGM("OTG"); break;
|
||||
case 11 : SERIAL_ECHOPGM("ETH"); break;
|
||||
case 12 : SERIAL_ECHOPGM("FSMC, SDIO, OTG"); break;
|
||||
case 13 : SERIAL_ECHOPGM("DCMI"); break;
|
||||
case 14 : SERIAL_ECHOPGM("unused (shouldn't see this)"); break;
|
||||
case 15 : SERIAL_ECHOPGM("EVENTOUT"); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
// TODO: F1 doesn't support changing pins function, so we need to check the function of the PIN and if it's enabled
|
||||
#endif
|
||||
} // pwm_details
|
||||
|
||||
@@ -34,22 +34,13 @@ DMA_HandleTypeDef TFT_SPI::DMAtx;
|
||||
void TFT_SPI::Init() {
|
||||
SPI_TypeDef *spiInstance;
|
||||
|
||||
#if PIN_EXISTS(TFT_RESET)
|
||||
OUT_WRITE(TFT_RESET_PIN, HIGH);
|
||||
HAL_Delay(100);
|
||||
#endif
|
||||
|
||||
#if PIN_EXISTS(TFT_BACKLIGHT)
|
||||
OUT_WRITE(TFT_BACKLIGHT_PIN, HIGH);
|
||||
#endif
|
||||
|
||||
OUT_WRITE(TFT_A0_PIN, HIGH);
|
||||
OUT_WRITE(TFT_CS_PIN, HIGH);
|
||||
|
||||
if ((spiInstance = (SPI_TypeDef *)pinmap_peripheral(digitalPinToPinName(TFT_SCK_PIN), PinMap_SPI_SCLK)) == NP) return;
|
||||
if (spiInstance != (SPI_TypeDef *)pinmap_peripheral(digitalPinToPinName(TFT_MOSI_PIN), PinMap_SPI_MOSI)) return;
|
||||
|
||||
#if PIN_EXISTS(TFT_MISO) && (TFT_MISO_PIN != TFT_MOSI_PIN)
|
||||
#if PIN_EXISTS(TFT_MISO) && TFT_MISO_PIN != TFT_MOSI_PIN
|
||||
if (spiInstance != (SPI_TypeDef *)pinmap_peripheral(digitalPinToPinName(TFT_MISO_PIN), PinMap_SPI_MISO)) return;
|
||||
#endif
|
||||
|
||||
@@ -57,12 +48,7 @@ void TFT_SPI::Init() {
|
||||
SPIx.State = HAL_SPI_STATE_RESET;
|
||||
SPIx.Init.NSS = SPI_NSS_SOFT;
|
||||
SPIx.Init.Mode = SPI_MODE_MASTER;
|
||||
SPIx.Init.Direction =
|
||||
#if TFT_MISO_PIN == TFT_MOSI_PIN
|
||||
SPI_DIRECTION_1LINE;
|
||||
#else
|
||||
SPI_DIRECTION_2LINES;
|
||||
#endif
|
||||
SPIx.Init.Direction = (TFT_MISO_PIN == TFT_MOSI_PIN) ? SPI_DIRECTION_1LINE : SPI_DIRECTION_2LINES;
|
||||
SPIx.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_2;
|
||||
SPIx.Init.CLKPhase = SPI_PHASE_1EDGE;
|
||||
SPIx.Init.CLKPolarity = SPI_POLARITY_LOW;
|
||||
@@ -74,7 +60,7 @@ void TFT_SPI::Init() {
|
||||
|
||||
pinmap_pinout(digitalPinToPinName(TFT_SCK_PIN), PinMap_SPI_SCLK);
|
||||
pinmap_pinout(digitalPinToPinName(TFT_MOSI_PIN), PinMap_SPI_MOSI);
|
||||
#if PIN_EXISTS(TFT_MISO) && (TFT_MISO_PIN != TFT_MOSI_PIN)
|
||||
#if PIN_EXISTS(TFT_MISO) && TFT_MISO_PIN != TFT_MOSI_PIN
|
||||
pinmap_pinout(digitalPinToPinName(TFT_MISO_PIN), PinMap_SPI_MISO);
|
||||
#endif
|
||||
pin_PullConfig(get_GPIO_Port(STM_PORT(digitalPinToPinName(TFT_SCK_PIN))), STM_LL_GPIO_PIN(digitalPinToPinName(TFT_SCK_PIN)), GPIO_PULLDOWN);
|
||||
@@ -82,23 +68,41 @@ void TFT_SPI::Init() {
|
||||
#ifdef SPI1_BASE
|
||||
if (SPIx.Instance == SPI1) {
|
||||
__HAL_RCC_SPI1_CLK_ENABLE();
|
||||
__HAL_RCC_DMA1_CLK_ENABLE();
|
||||
#ifdef STM32F1xx
|
||||
__HAL_RCC_DMA1_CLK_ENABLE();
|
||||
DMAtx.Instance = DMA1_Channel3;
|
||||
#elif defined(STM32F4xx)
|
||||
__HAL_RCC_DMA2_CLK_ENABLE();
|
||||
DMAtx.Instance = DMA2_Stream3;
|
||||
DMAtx.Init.Channel = DMA_CHANNEL_3;
|
||||
#endif
|
||||
SPIx.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_4;
|
||||
DMAtx.Instance = DMA1_Channel3;
|
||||
}
|
||||
#endif
|
||||
#ifdef SPI2_BASE
|
||||
if (SPIx.Instance == SPI2) {
|
||||
__HAL_RCC_SPI2_CLK_ENABLE();
|
||||
__HAL_RCC_DMA1_CLK_ENABLE();
|
||||
DMAtx.Instance = DMA1_Channel5;
|
||||
#ifdef STM32F1xx
|
||||
__HAL_RCC_DMA1_CLK_ENABLE();
|
||||
DMAtx.Instance = DMA1_Channel5;
|
||||
#elif defined(STM32F4xx)
|
||||
__HAL_RCC_DMA1_CLK_ENABLE();
|
||||
DMAtx.Instance = DMA1_Stream4;
|
||||
DMAtx.Init.Channel = DMA_CHANNEL_4;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
#ifdef SPI3_BASE
|
||||
if (SPIx.Instance == SPI3) {
|
||||
__HAL_RCC_SPI3_CLK_ENABLE();
|
||||
__HAL_RCC_DMA2_CLK_ENABLE();
|
||||
DMAtx.Instance = DMA2_Channel2;
|
||||
#ifdef STM32F1xx
|
||||
__HAL_RCC_DMA2_CLK_ENABLE();
|
||||
DMAtx.Instance = DMA2_Channel2;
|
||||
#elif defined(STM32F4xx)
|
||||
__HAL_RCC_DMA1_CLK_ENABLE();
|
||||
DMAtx.Instance = DMA1_Stream5;
|
||||
DMAtx.Init.Channel = DMA_CHANNEL_5;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -110,6 +114,9 @@ void TFT_SPI::Init() {
|
||||
DMAtx.Init.MemDataAlignment = DMA_MDATAALIGN_HALFWORD;
|
||||
DMAtx.Init.Mode = DMA_NORMAL;
|
||||
DMAtx.Init.Priority = DMA_PRIORITY_LOW;
|
||||
#ifdef STM32F4xx
|
||||
DMAtx.Init.FIFOMode = DMA_FIFOMODE_DISABLE;
|
||||
#endif
|
||||
}
|
||||
|
||||
void TFT_SPI::DataTransferBegin(uint16_t DataSize) {
|
||||
@@ -128,11 +135,10 @@ uint32_t TFT_SPI::GetID() {
|
||||
}
|
||||
|
||||
uint32_t TFT_SPI::ReadID(uint16_t Reg) {
|
||||
#if !PIN_EXISTS(TFT_MISO)
|
||||
return 0;
|
||||
#else
|
||||
uint32_t Data = 0;
|
||||
#if PIN_EXISTS(TFT_MISO)
|
||||
uint32_t BaudRatePrescaler = SPIx.Init.BaudRatePrescaler;
|
||||
uint32_t i, Data = 0;
|
||||
uint32_t i;
|
||||
|
||||
SPIx.Init.BaudRatePrescaler = SPIx.Instance == SPI1 ? SPI_BAUDRATEPRESCALER_8 : SPI_BAUDRATEPRESCALER_4;
|
||||
DataTransferBegin(DATASIZE_8BIT);
|
||||
@@ -156,27 +162,39 @@ uint32_t TFT_SPI::ReadID(uint16_t Reg) {
|
||||
DataTransferEnd();
|
||||
|
||||
SPIx.Init.BaudRatePrescaler = BaudRatePrescaler;
|
||||
|
||||
return Data >> 7;
|
||||
#endif
|
||||
|
||||
return Data >> 7;
|
||||
}
|
||||
|
||||
bool TFT_SPI::isBusy() {
|
||||
if (DMAtx.Instance->CCR & DMA_CCR_EN)
|
||||
#if defined(STM32F1xx)
|
||||
volatile bool dmaEnabled = (DMAtx.Instance->CCR & DMA_CCR_EN) != RESET;
|
||||
#elif defined(STM32F4xx)
|
||||
volatile bool dmaEnabled = DMAtx.Instance->CR & DMA_SxCR_EN;
|
||||
#endif
|
||||
if (dmaEnabled) {
|
||||
if (__HAL_DMA_GET_FLAG(&DMAtx, __HAL_DMA_GET_TC_FLAG_INDEX(&DMAtx)) != 0 || __HAL_DMA_GET_FLAG(&DMAtx, __HAL_DMA_GET_TE_FLAG_INDEX(&DMAtx)) != 0)
|
||||
Abort();
|
||||
return DMAtx.Instance->CCR & DMA_CCR_EN;
|
||||
}
|
||||
else
|
||||
Abort();
|
||||
return dmaEnabled;
|
||||
}
|
||||
|
||||
void TFT_SPI::Abort() {
|
||||
__HAL_DMA_DISABLE(&DMAtx);
|
||||
// First, abort any running dma
|
||||
HAL_DMA_Abort(&DMAtx);
|
||||
// DeInit objects
|
||||
HAL_DMA_DeInit(&DMAtx);
|
||||
HAL_SPI_DeInit(&SPIx);
|
||||
// Deselect CS
|
||||
DataTransferEnd();
|
||||
}
|
||||
|
||||
void TFT_SPI::Transmit(uint16_t Data) {
|
||||
#if TFT_MISO_PIN == TFT_MOSI_PIN
|
||||
if (TFT_MISO_PIN == TFT_MOSI_PIN)
|
||||
SPI_1LINE_TX(&SPIx);
|
||||
#endif
|
||||
|
||||
__HAL_SPI_ENABLE(&SPIx);
|
||||
|
||||
@@ -185,26 +203,23 @@ void TFT_SPI::Transmit(uint16_t Data) {
|
||||
while ((SPIx.Instance->SR & SPI_FLAG_TXE) != SPI_FLAG_TXE) {}
|
||||
while ((SPIx.Instance->SR & SPI_FLAG_BSY) == SPI_FLAG_BSY) {}
|
||||
|
||||
#if TFT_MISO_PIN != TFT_MOSI_PIN
|
||||
if (TFT_MISO_PIN != TFT_MOSI_PIN)
|
||||
__HAL_SPI_CLEAR_OVRFLAG(&SPIx); /* Clear overrun flag in 2 Lines communication mode because received is not read */
|
||||
#endif
|
||||
}
|
||||
|
||||
void TFT_SPI::TransmitDMA(uint32_t MemoryIncrease, uint16_t *Data, uint16_t Count) {
|
||||
// Wait last dma finish, to start another
|
||||
while(isBusy()) { }
|
||||
|
||||
DMAtx.Init.MemInc = MemoryIncrease;
|
||||
HAL_DMA_Init(&DMAtx);
|
||||
|
||||
if (TFT_MISO_PIN == TFT_MOSI_PIN)
|
||||
SPI_1LINE_TX(&SPIx);
|
||||
|
||||
DataTransferBegin();
|
||||
|
||||
#if TFT_MISO_PIN == TFT_MOSI_PIN
|
||||
SPI_1LINE_TX(&SPIx);
|
||||
#endif
|
||||
|
||||
DMAtx.DmaBaseAddress->IFCR = (DMA_ISR_GIF1 << DMAtx.ChannelIndex);
|
||||
DMAtx.Instance->CNDTR = Count;
|
||||
DMAtx.Instance->CPAR = (uint32_t)&(SPIx.Instance->DR);
|
||||
DMAtx.Instance->CMAR = (uint32_t)Data;
|
||||
__HAL_DMA_ENABLE(&DMAtx);
|
||||
HAL_DMA_Start(&DMAtx, (uint32_t)Data, (uint32_t)&(SPIx.Instance->DR), Count);
|
||||
__HAL_SPI_ENABLE(&SPIx);
|
||||
|
||||
SET_BIT(SPIx.Instance->CR2, SPI_CR2_TXDMAEN); /* Enable Tx DMA Request */
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
#error "LCD_SERIAL_PORT must be -1 or from 1 to 3. Please update your configuration."
|
||||
#endif
|
||||
|
||||
#define SERIAL_GET_TX_BUFFER_FREE LCD_SERIAL.availableForWrite
|
||||
#define SERIAL_GET_TX_BUFFER_FREE() LCD_SERIAL.availableForWrite()
|
||||
#endif
|
||||
|
||||
// Set interrupt grouping for this MCU
|
||||
|
||||
@@ -77,6 +77,10 @@
|
||||
#include "lcd/dwin/e3v2/rotary_encoder.h"
|
||||
#endif
|
||||
|
||||
#if ENABLED(EXTENSIBLE_UI)
|
||||
#include "lcd/extui/ui_api.h"
|
||||
#endif
|
||||
|
||||
#if HAS_ETHERNET
|
||||
#include "feature/ethernet.h"
|
||||
#endif
|
||||
@@ -360,6 +364,8 @@ void enable_all_steppers() {
|
||||
ENABLE_AXIS_Y();
|
||||
ENABLE_AXIS_Z();
|
||||
enable_e_steppers();
|
||||
|
||||
TERN_(EXTENSIBLE_UI, ExtUI::onSteppersEnabled());
|
||||
}
|
||||
|
||||
void disable_e_steppers() {
|
||||
@@ -379,6 +385,8 @@ void disable_all_steppers() {
|
||||
DISABLE_AXIS_Y();
|
||||
DISABLE_AXIS_Z();
|
||||
disable_e_steppers();
|
||||
|
||||
TERN_(EXTENSIBLE_UI, ExtUI::onSteppersDisabled());
|
||||
}
|
||||
|
||||
#if ENABLED(G29_RETRY_AND_RECOVER)
|
||||
@@ -452,6 +460,7 @@ void startOrResumeJob() {
|
||||
#if ENABLED(SDSUPPORT)
|
||||
|
||||
inline void abortSDPrinting() {
|
||||
IF_DISABLED(NO_SD_AUTOSTART, card.autofile_cancel());
|
||||
card.endFilePrint(TERN_(SD_RESORT, true));
|
||||
queue.clear();
|
||||
quickstop_stepper();
|
||||
@@ -577,7 +586,7 @@ inline void manage_inactivity(const bool ignore_stepper_queue=false) {
|
||||
if (ELAPSED(ms, next_home_key_ms)) {
|
||||
next_home_key_ms = ms + HOME_DEBOUNCE_DELAY;
|
||||
LCD_MESSAGEPGM(MSG_AUTO_HOME);
|
||||
queue.enqueue_now_P(G28_STR);
|
||||
queue.inject_P(G28_STR);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -701,6 +710,10 @@ inline void manage_inactivity(const bool ignore_stepper_queue=false) {
|
||||
* - Handle Joystick jogging
|
||||
*/
|
||||
void idle(TERN_(ADVANCED_PAUSE_FEATURE, bool no_stepper_sleep/*=false*/)) {
|
||||
#if ENABLED(MARLIN_DEV_MODE)
|
||||
static uint8_t idle_depth = 0;
|
||||
if (++idle_depth > 5) SERIAL_ECHOLNPAIR("idle() call depth: ", int(idle_depth));
|
||||
#endif
|
||||
|
||||
// Core Marlin activities
|
||||
manage_inactivity(TERN_(ADVANCED_PAUSE_FEATURE, no_stepper_sleep));
|
||||
@@ -712,7 +725,7 @@ void idle(TERN_(ADVANCED_PAUSE_FEATURE, bool no_stepper_sleep/*=false*/)) {
|
||||
TERN_(MAX7219_DEBUG, max7219.idle_tasks());
|
||||
|
||||
// Return if setup() isn't completed
|
||||
if (marlin_state == MF_INITIALIZING) return;
|
||||
if (marlin_state == MF_INITIALIZING) goto IDLE_DONE;
|
||||
|
||||
// Handle filament runout sensors
|
||||
TERN_(HAS_FILAMENT_SENSOR, runout.run());
|
||||
@@ -756,6 +769,7 @@ void idle(TERN_(ADVANCED_PAUSE_FEATURE, bool no_stepper_sleep/*=false*/)) {
|
||||
|
||||
// Run i2c Position Encoders
|
||||
#if ENABLED(I2C_POSITION_ENCODERS)
|
||||
{
|
||||
static millis_t i2cpem_next_update_ms;
|
||||
if (planner.has_blocks_queued()) {
|
||||
const millis_t ms = millis();
|
||||
@@ -764,6 +778,7 @@ void idle(TERN_(ADVANCED_PAUSE_FEATURE, bool no_stepper_sleep/*=false*/)) {
|
||||
i2cpem_next_update_ms = ms + I2CPE_MIN_UPD_TIME_MS;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// Auto-report Temperatures / SD Status
|
||||
@@ -785,6 +800,10 @@ void idle(TERN_(ADVANCED_PAUSE_FEATURE, bool no_stepper_sleep/*=false*/)) {
|
||||
|
||||
// Update the LVGL interface
|
||||
TERN_(HAS_TFT_LVGL_UI, LV_TASK_HANDLER());
|
||||
|
||||
IDLE_DONE:
|
||||
TERN_(MARLIN_DEV_MODE, idle_depth--);
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1336,7 +1355,6 @@ void loop() {
|
||||
idle();
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
card.checkautostart();
|
||||
if (card.flag.abort_sd_printing) abortSDPrinting();
|
||||
if (marlin_state == MF_SD_COMPLETE) finishSDPrinting();
|
||||
#endif
|
||||
|
||||
@@ -365,6 +365,7 @@
|
||||
#define BOARD_FYSETC_S6_V2_0 4216 // FYSETC S6 v2.0 board
|
||||
#define BOARD_FLYF407ZG 4217 // FLYF407ZG board (STM32F407ZG)
|
||||
#define BOARD_MKS_ROBIN2 4218 // MKS_ROBIN2 (STM32F407ZE)
|
||||
#define BOARD_MKS_ROBIN_PRO_V2 4219 // MKS Robin Pro V2 (STM32F407VE)
|
||||
|
||||
//
|
||||
// ARM Cortex M7
|
||||
|
||||
@@ -727,7 +727,7 @@
|
||||
* Probe all invalidated locations of the mesh that can be reached by the probe.
|
||||
* This attempts to fill in locations closest to the nozzle's start location first.
|
||||
*/
|
||||
void unified_bed_leveling::probe_entire_mesh(const xy_pos_t &pos, const bool do_ubl_mesh_map, const bool stow_probe, const bool do_furthest) {
|
||||
void unified_bed_leveling::probe_entire_mesh(const xy_pos_t &nearby, const bool do_ubl_mesh_map, const bool stow_probe, const bool do_furthest) {
|
||||
probe.deploy(); // Deploy before ui.capture() to allow for PAUSE_BEFORE_DEPLOY_STOW
|
||||
|
||||
TERN_(HAS_LCD_MENU, ui.capture());
|
||||
@@ -758,7 +758,7 @@
|
||||
|
||||
best = do_furthest
|
||||
? find_furthest_invalid_mesh_point()
|
||||
: find_closest_mesh_point_of_type(INVALID, pos, true);
|
||||
: find_closest_mesh_point_of_type(INVALID, nearby, true);
|
||||
|
||||
if (best.pos.x >= 0) { // mesh point found and is reachable by probe
|
||||
TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(best.pos, ExtUI::PROBE_START));
|
||||
@@ -788,8 +788,8 @@
|
||||
restore_ubl_active_state_and_leave();
|
||||
|
||||
do_blocking_move_to_xy(
|
||||
constrain(pos.x - probe.offset_xy.x, MESH_MIN_X, MESH_MAX_X),
|
||||
constrain(pos.y - probe.offset_xy.y, MESH_MIN_Y, MESH_MAX_Y)
|
||||
constrain(nearby.x - probe.offset_xy.x, MESH_MIN_X, MESH_MAX_X),
|
||||
constrain(nearby.y - probe.offset_xy.y, MESH_MIN_Y, MESH_MAX_Y)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1206,7 +1206,7 @@
|
||||
|
||||
found_a_NAN = true;
|
||||
|
||||
xy_int8_t near_pos { -1, -1 };
|
||||
xy_int8_t nearby { -1, -1 };
|
||||
float d1, d2 = 99999.9f;
|
||||
GRID_LOOP(k, l) {
|
||||
if (isnan(z_values[k][l])) continue;
|
||||
@@ -1221,7 +1221,7 @@
|
||||
|
||||
if (d1 < d2) { // Invalid mesh point (i,j) is closer to the defined point (k,l)
|
||||
d2 = d1;
|
||||
near_pos.set(i, j);
|
||||
nearby.set(i, j);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1229,8 +1229,8 @@
|
||||
// At this point d2 should have the near defined mesh point to invalid mesh point (i,j)
|
||||
//
|
||||
|
||||
if (found_a_real && near_pos.x >= 0 && d2 > farthest.distance) {
|
||||
farthest.pos = near_pos; // Found an invalid location farther from the defined mesh point
|
||||
if (found_a_real && nearby.x >= 0 && d2 > farthest.distance) {
|
||||
farthest.pos = nearby; // Found an invalid location farther from the defined mesh point
|
||||
farthest.distance = d2;
|
||||
}
|
||||
} // GRID_LOOP
|
||||
|
||||
@@ -152,7 +152,7 @@ class PrintJobRecovery {
|
||||
static void resume();
|
||||
static void purge();
|
||||
|
||||
static inline void cancel() { purge(); card.autostart_index = 0; }
|
||||
static inline void cancel() { purge(); IF_DISABLED(NO_SD_AUTOSTART, card.autofile_begin()); }
|
||||
|
||||
static void load();
|
||||
static void save(const bool force=ENABLED(SAVE_EACH_CMD_MODE), const float zraise=0);
|
||||
|
||||
@@ -177,6 +177,8 @@ G29_TYPE GcodeSuite::G29() {
|
||||
if (DISABLED(PROBE_MANUALLY) && seenQ) G29_RETURN(false);
|
||||
#endif
|
||||
|
||||
TERN_(EXTENSIBLE_UI, ExtUI::onMeshLevelingStart());
|
||||
|
||||
const bool seenA = TERN0(PROBE_MANUALLY, parser.seen('A')),
|
||||
no_action = seenA || seenQ,
|
||||
faux = ENABLED(DEBUG_LEVELING_FEATURE) && DISABLED(PROBE_MANUALLY) ? parser.boolval('C') : no_action;
|
||||
@@ -392,6 +394,11 @@ G29_TYPE GcodeSuite::G29() {
|
||||
|
||||
planner.synchronize();
|
||||
|
||||
#if ENABLED(AUTO_BED_LEVELING_3POINT)
|
||||
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("> 3-point Leveling");
|
||||
points[0].z = points[1].z = points[2].z = 0; // Probe at 3 arbitrary points
|
||||
#endif
|
||||
|
||||
if (!faux) remember_feedrate_scaling_off();
|
||||
|
||||
// Disable auto bed leveling during G29.
|
||||
@@ -409,7 +416,6 @@ G29_TYPE GcodeSuite::G29() {
|
||||
#endif
|
||||
|
||||
#if ENABLED(AUTO_BED_LEVELING_BILINEAR)
|
||||
|
||||
if (TERN1(PROBE_MANUALLY, !no_action)
|
||||
&& (gridSpacing != bilinear_grid_spacing || probe_position_lf != bilinear_start)
|
||||
) {
|
||||
@@ -423,18 +429,8 @@ G29_TYPE GcodeSuite::G29() {
|
||||
// Can't re-enable (on error) until the new grid is written
|
||||
abl_should_enable = false;
|
||||
}
|
||||
|
||||
#endif // AUTO_BED_LEVELING_BILINEAR
|
||||
|
||||
#if ENABLED(AUTO_BED_LEVELING_3POINT)
|
||||
|
||||
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("> 3-point Leveling");
|
||||
|
||||
// Probe at 3 arbitrary points
|
||||
points[0].z = points[1].z = points[2].z = 0;
|
||||
|
||||
#endif // AUTO_BED_LEVELING_3POINT
|
||||
|
||||
} // !g29_in_progress
|
||||
|
||||
#if ENABLED(PROBE_MANUALLY)
|
||||
|
||||
@@ -50,6 +50,10 @@
|
||||
#include "../../lcd/dwin/e3v2/dwin.h"
|
||||
#endif
|
||||
|
||||
#if ENABLED(EXTENSIBLE_UI)
|
||||
#include "../../lcd/extui/ui_api.h"
|
||||
#endif
|
||||
|
||||
#if HAS_L64XX // set L6470 absolute position registers to counts
|
||||
#include "../../libs/L64XX/L64XX_Marlin.h"
|
||||
#endif
|
||||
@@ -207,8 +211,6 @@ void GcodeSuite::G28() {
|
||||
|
||||
TERN_(LASER_MOVE_G28_OFF, cutter.set_inline_enabled(false)); // turn off laser
|
||||
|
||||
TERN_(DWIN_CREALITY_LCD, HMI_flag.home_flag = true);
|
||||
|
||||
#if ENABLED(DUAL_X_CARRIAGE)
|
||||
bool IDEX_saved_duplication_state = extruder_duplication_enabled;
|
||||
DualXMode IDEX_saved_mode = dual_x_carriage_mode;
|
||||
@@ -230,17 +232,17 @@ void GcodeSuite::G28() {
|
||||
return;
|
||||
}
|
||||
|
||||
TERN_(DWIN_CREALITY_LCD, DWIN_StartHoming());
|
||||
TERN_(EXTENSIBLE_UI, ExtUI::onHomingStart());
|
||||
|
||||
planner.synchronize(); // Wait for planner moves to finish!
|
||||
|
||||
SET_SOFT_ENDSTOP_LOOSE(false); // Reset a leftover 'loose' motion state
|
||||
|
||||
// Disable the leveling matrix before homing
|
||||
#if HAS_LEVELING
|
||||
|
||||
// Cancel the active G29 session
|
||||
TERN_(PROBE_MANUALLY, g29_in_progress = false);
|
||||
|
||||
TERN_(RESTORE_LEVELING_AFTER_G28, const bool leveling_was_active = planner.leveling_active);
|
||||
TERN_(PROBE_MANUALLY, g29_in_progress = false); // Cancel the active G29 session
|
||||
set_bed_leveling_enabled(false);
|
||||
#endif
|
||||
|
||||
@@ -461,6 +463,7 @@ void GcodeSuite::G28() {
|
||||
ui.refresh();
|
||||
|
||||
TERN_(DWIN_CREALITY_LCD, DWIN_CompletedHoming());
|
||||
TERN_(EXTENSIBLE_UI, ExtUI::onHomingComplete());
|
||||
|
||||
report_current_position();
|
||||
|
||||
|
||||
@@ -27,6 +27,10 @@
|
||||
#include "../gcode.h"
|
||||
#include "../../module/printcounter.h"
|
||||
|
||||
#if DISABLED(NO_SD_AUTOSTART)
|
||||
#include "../../sd/cardreader.h"
|
||||
#endif
|
||||
|
||||
#ifdef SD_FINISHED_RELEASECOMMAND
|
||||
#include "../queue.h"
|
||||
#endif
|
||||
@@ -60,6 +64,11 @@
|
||||
* M1001: Execute actions for SD print completion
|
||||
*/
|
||||
void GcodeSuite::M1001() {
|
||||
// If there's another auto#.g file to run...
|
||||
if (TERN(NO_SD_AUTOSTART, false, card.autofile_check())) return;
|
||||
|
||||
// Purge the recovery file...
|
||||
TERN_(POWER_LOSS_RECOVERY, recovery.purge());
|
||||
|
||||
// Report total print time
|
||||
const bool long_print = print_job_timer.duration() > 60;
|
||||
@@ -71,9 +80,6 @@ void GcodeSuite::M1001() {
|
||||
// Set the progress bar "done" state
|
||||
TERN_(LCD_SET_PROGRESS_MANUALLY, ui.set_progress_done());
|
||||
|
||||
// Purge the recovery file
|
||||
TERN_(POWER_LOSS_RECOVERY, recovery.purge());
|
||||
|
||||
// Announce SD file completion
|
||||
{
|
||||
PORT_REDIRECT(SERIAL_BOTH);
|
||||
@@ -93,9 +99,11 @@ void GcodeSuite::M1001() {
|
||||
|
||||
// Inject SD_FINISHED_RELEASECOMMAND, if any
|
||||
#ifdef SD_FINISHED_RELEASECOMMAND
|
||||
queue.inject_P(PSTR(SD_FINISHED_RELEASECOMMAND));
|
||||
gcode.process_subcommands_now_P(PSTR(SD_FINISHED_RELEASECOMMAND));
|
||||
#endif
|
||||
|
||||
TERN_(EXTENSIBLE_UI, ExtUI::onPrintFinished());
|
||||
|
||||
// Re-select the last printed file in the UI
|
||||
TERN_(SD_REPRINT_LAST_SELECTED_FILE, ui.reselect_last_file());
|
||||
}
|
||||
|
||||
@@ -142,6 +142,10 @@
|
||||
#undef SD_FINISHED_RELEASECOMMAND
|
||||
#endif
|
||||
|
||||
#if ENABLED(NO_SD_AUTOSTART)
|
||||
#undef MENU_ADDAUTOSTART
|
||||
#endif
|
||||
|
||||
#if EITHER(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY)
|
||||
#define HAS_PRINT_PROGRESS 1
|
||||
#endif
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
* version was tagged.
|
||||
*/
|
||||
#ifndef STRING_DISTRIBUTION_DATE
|
||||
#define STRING_DISTRIBUTION_DATE "2020-12-05"
|
||||
#define STRING_DISTRIBUTION_DATE "2020-12-09"
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
||||
@@ -369,5 +369,7 @@ void DWIN_Update();
|
||||
void EachMomentUpdate();
|
||||
void DWIN_HandleScreen();
|
||||
|
||||
inline void DWIN_StartHoming() { HMI_flag.home_flag = true; }
|
||||
|
||||
void DWIN_CompletedHoming();
|
||||
void DWIN_CompletedLeveling();
|
||||
|
||||
@@ -62,6 +62,10 @@ namespace ExtUI {
|
||||
void onUserConfirmRequired(const char * const msg) { Chiron.ConfirmationRequest(msg); }
|
||||
void onStatusChanged(const char * const msg) { Chiron.StatusChange(msg); }
|
||||
|
||||
void onHomingStart() {}
|
||||
void onHomingComplete() {}
|
||||
void onPrintFinished() {}
|
||||
|
||||
void onFactoryReset() {}
|
||||
|
||||
void onStoreSettings(char *buff) {
|
||||
@@ -95,6 +99,8 @@ namespace ExtUI {
|
||||
}
|
||||
|
||||
#if HAS_MESH
|
||||
void onMeshLevelingStart() {}
|
||||
|
||||
void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval) {
|
||||
// Called when any mesh points are updated
|
||||
//SERIAL_ECHOLNPAIR("onMeshUpdate() x:", xpos, " y:", ypos, " z:", zval);
|
||||
@@ -116,6 +122,9 @@ namespace ExtUI {
|
||||
// Called for temperature PID tuning result
|
||||
}
|
||||
#endif
|
||||
|
||||
void onSteppersDisabled() {}
|
||||
void onSteppersEnabled() {}
|
||||
}
|
||||
|
||||
#endif // ANYCUBIC_LCD_CHIRON
|
||||
|
||||
@@ -52,6 +52,11 @@ namespace ExtUI {
|
||||
void onFilamentRunout(const extruder_t extruder) { AnycubicTFT.OnFilamentRunout(); }
|
||||
void onUserConfirmRequired(const char * const msg) { AnycubicTFT.OnUserConfirmRequired(msg); }
|
||||
void onStatusChanged(const char * const msg) {}
|
||||
|
||||
void onHomingStart() {}
|
||||
void onHomingComplete() {}
|
||||
void onPrintFinished() {}
|
||||
|
||||
void onFactoryReset() {}
|
||||
|
||||
void onStoreSettings(char *buff) {
|
||||
@@ -84,9 +89,14 @@ namespace ExtUI {
|
||||
// whether successful or not.
|
||||
}
|
||||
|
||||
void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval) {
|
||||
// Called when any mesh points are updated
|
||||
}
|
||||
#if HAS_MESH
|
||||
|
||||
void onMeshLevelingStart() {}
|
||||
|
||||
void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval) {
|
||||
// Called when any mesh points are updated
|
||||
}
|
||||
#endif
|
||||
|
||||
#if ENABLED(POWER_LOSS_RECOVERY)
|
||||
void onPowerLossResume() {
|
||||
@@ -99,6 +109,9 @@ namespace ExtUI {
|
||||
// Called for temperature PID tuning result
|
||||
}
|
||||
#endif
|
||||
|
||||
void onSteppersDisabled() {}
|
||||
void onSteppersEnabled() {}
|
||||
}
|
||||
|
||||
#endif // ANYCUBIC_LCD_I3MEGA
|
||||
|
||||
@@ -76,7 +76,12 @@ namespace ExtUI {
|
||||
|
||||
void onStatusChanged(const char * const msg) { ScreenHandler.setstatusmessage(msg); }
|
||||
|
||||
void onHomingStart() {}
|
||||
void onHomingComplete() {}
|
||||
void onPrintFinished() {}
|
||||
|
||||
void onFactoryReset() {}
|
||||
|
||||
void onStoreSettings(char *buff) {
|
||||
// Called when saving to EEPROM (i.e. M500). If the ExtUI needs
|
||||
// permanent data to be stored, it can write up to eeprom_data_size bytes
|
||||
@@ -108,6 +113,8 @@ namespace ExtUI {
|
||||
}
|
||||
|
||||
#if HAS_MESH
|
||||
void onMeshLevelingStart() {}
|
||||
|
||||
void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval) {
|
||||
// Called when any mesh points are updated
|
||||
}
|
||||
@@ -146,5 +153,8 @@ namespace ExtUI {
|
||||
}
|
||||
#endif
|
||||
|
||||
void onSteppersDisabled() {}
|
||||
void onSteppersEnabled() {}
|
||||
}
|
||||
|
||||
#endif // HAS_DGUS_LCD
|
||||
|
||||
@@ -47,9 +47,9 @@ namespace ExtUI {
|
||||
}
|
||||
void onIdle() {}
|
||||
void onPrinterKilled(PGM_P const error, PGM_P const component) {}
|
||||
void onMediaInserted() {};
|
||||
void onMediaError() {};
|
||||
void onMediaRemoved() {};
|
||||
void onMediaInserted() {}
|
||||
void onMediaError() {}
|
||||
void onMediaRemoved() {}
|
||||
void onPlayTone(const uint16_t frequency, const uint16_t duration) {}
|
||||
void onPrintTimerStarted() {}
|
||||
void onPrintTimerPaused() {}
|
||||
@@ -57,6 +57,11 @@ namespace ExtUI {
|
||||
void onFilamentRunout(const extruder_t extruder) {}
|
||||
void onUserConfirmRequired(const char * const msg) {}
|
||||
void onStatusChanged(const char * const msg) {}
|
||||
|
||||
void onHomingStart() {}
|
||||
void onHomingComplete() {}
|
||||
void onPrintFinished() {}
|
||||
|
||||
void onFactoryReset() {}
|
||||
|
||||
void onStoreSettings(char *buff) {
|
||||
@@ -90,6 +95,8 @@ namespace ExtUI {
|
||||
}
|
||||
|
||||
#if HAS_MESH
|
||||
void onMeshLevelingStart() {}
|
||||
|
||||
void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval) {
|
||||
// Called when any mesh points are updated
|
||||
}
|
||||
@@ -110,6 +117,9 @@ namespace ExtUI {
|
||||
// Called for temperature PID tuning result
|
||||
}
|
||||
#endif
|
||||
|
||||
void onSteppersDisabled() {}
|
||||
void onSteppersEnabled() {}
|
||||
}
|
||||
|
||||
#endif // EXTUI_EXAMPLE && EXTENSIBLE_UI
|
||||
|
||||
@@ -87,8 +87,9 @@ namespace ExtUI {
|
||||
InterfaceSoundsScreen::playEventSound(InterfaceSoundsScreen::PRINTING_FINISHED);
|
||||
}
|
||||
|
||||
void onPrintTimerPaused() {
|
||||
}
|
||||
void onPrintTimerPaused() {}
|
||||
|
||||
void onPrintFinished() {}
|
||||
|
||||
void onFilamentRunout(const extruder_t extruder) {
|
||||
char lcd_msg[30];
|
||||
@@ -97,6 +98,9 @@ namespace ExtUI {
|
||||
InterfaceSoundsScreen::playEventSound(InterfaceSoundsScreen::PRINTING_FAILED, FTDI::PLAY_SYNCHRONOUS);
|
||||
}
|
||||
|
||||
void onHomingStart() {}
|
||||
void onHomingComplete() {}
|
||||
|
||||
void onFactoryReset() {
|
||||
InterfaceSettingsScreen::defaultSettings();
|
||||
}
|
||||
@@ -134,6 +138,8 @@ namespace ExtUI {
|
||||
}
|
||||
|
||||
#if HAS_LEVELING && HAS_MESH
|
||||
void onMeshLevelingStart() {}
|
||||
|
||||
void onMeshUpdate(const int8_t x, const int8_t y, const float val) {
|
||||
BedMeshScreen::onMeshUpdate(x, y, val);
|
||||
}
|
||||
@@ -170,6 +176,9 @@ namespace ExtUI {
|
||||
GOTO_SCREEN(StatusScreen);
|
||||
}
|
||||
#endif // HAS_PID_HEATING
|
||||
|
||||
void onSteppersDisabled() {}
|
||||
void onSteppersEnabled() {}
|
||||
}
|
||||
|
||||
#endif // TOUCH_UI_FTDI_EVE
|
||||
|
||||
@@ -511,12 +511,15 @@ namespace ExtUI {
|
||||
|
||||
// Not needed for Malyan LCD
|
||||
void onStatusChanged(const char * const) {}
|
||||
void onMediaInserted() {};
|
||||
void onMediaError() {};
|
||||
void onMediaRemoved() {};
|
||||
void onMediaInserted() {}
|
||||
void onMediaError() {}
|
||||
void onMediaRemoved() {}
|
||||
void onPlayTone(const uint16_t, const uint16_t) {}
|
||||
void onFilamentRunout(const extruder_t extruder) {}
|
||||
void onUserConfirmRequired(const char * const) {}
|
||||
void onHomingStart() {}
|
||||
void onHomingComplete() {}
|
||||
void onPrintFinished() {}
|
||||
void onFactoryReset() {}
|
||||
void onStoreSettings(char*) {}
|
||||
void onLoadSettings(const char*) {}
|
||||
@@ -524,6 +527,7 @@ namespace ExtUI {
|
||||
void onConfigurationStoreRead(bool) {}
|
||||
|
||||
#if HAS_MESH
|
||||
void onMeshLevelingStart() {}
|
||||
void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval) {}
|
||||
void onMeshUpdate(const int8_t xpos, const int8_t ypos, const ExtUI::probe_state_t state) {}
|
||||
#endif
|
||||
@@ -531,6 +535,9 @@ namespace ExtUI {
|
||||
#if ENABLED(POWER_LOSS_RECOVERY)
|
||||
void onPowerLossResume() {}
|
||||
#endif
|
||||
|
||||
void onSteppersDisabled() {}
|
||||
void onSteppersEnabled() {}
|
||||
}
|
||||
|
||||
#endif // MALYAN_LCD
|
||||
|
||||
@@ -140,6 +140,7 @@ namespace ExtUI {
|
||||
bed_mesh_t& getMeshArray();
|
||||
float getMeshPoint(const xy_uint8_t &pos);
|
||||
void setMeshPoint(const xy_uint8_t &pos, const float zval);
|
||||
void onMeshLevelingStart();
|
||||
void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval);
|
||||
inline void onMeshUpdate(const xy_int8_t &pos, const float zval) { onMeshUpdate(pos.x, pos.y, zval); }
|
||||
|
||||
@@ -344,11 +345,16 @@ namespace ExtUI {
|
||||
void onPrintTimerStarted();
|
||||
void onPrintTimerPaused();
|
||||
void onPrintTimerStopped();
|
||||
void onPrintFinished();
|
||||
void onFilamentRunout(const extruder_t extruder);
|
||||
void onUserConfirmRequired(const char * const msg);
|
||||
void onUserConfirmRequired_P(PGM_P const pstr);
|
||||
void onStatusChanged(const char * const msg);
|
||||
void onStatusChanged_P(PGM_P const pstr);
|
||||
void onHomingStart();
|
||||
void onHomingComplete();
|
||||
void onSteppersDisabled();
|
||||
void onSteppersEnabled();
|
||||
void onFactoryReset();
|
||||
void onStoreSettings(char *);
|
||||
void onLoadSettings(const char *);
|
||||
|
||||
@@ -431,9 +431,9 @@ namespace Language_en {
|
||||
PROGMEM Language_Str MSG_FILAMENTCHANGE = _UxGT("Change Filament");
|
||||
PROGMEM Language_Str MSG_FILAMENTCHANGE_E = _UxGT("Change Filament *");
|
||||
PROGMEM Language_Str MSG_FILAMENTLOAD = _UxGT("Load Filament");
|
||||
PROGMEM Language_Str MSG_FILAMENTLOAD_E = _UxGT("Load Filament *");
|
||||
PROGMEM Language_Str MSG_FILAMENTLOAD_E = _UxGT("Load *");
|
||||
PROGMEM Language_Str MSG_FILAMENTUNLOAD = _UxGT("Unload Filament");
|
||||
PROGMEM Language_Str MSG_FILAMENTUNLOAD_E = _UxGT("Unload Filament *");
|
||||
PROGMEM Language_Str MSG_FILAMENTUNLOAD_E = _UxGT("Unload *");
|
||||
PROGMEM Language_Str MSG_FILAMENTUNLOAD_ALL = _UxGT("Unload All");
|
||||
PROGMEM Language_Str MSG_ATTACH_MEDIA = _UxGT("Attach Media");
|
||||
PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Change Media");
|
||||
|
||||
@@ -136,7 +136,7 @@ void menu_main() {
|
||||
// Run Auto Files
|
||||
//
|
||||
#if ENABLED(MENU_ADDAUTOSTART)
|
||||
ACTION_ITEM(MSG_RUN_AUTO_FILES, card.beginautostart);
|
||||
ACTION_ITEM(MSG_RUN_AUTO_FILES, card.autofile_begin);
|
||||
#endif
|
||||
|
||||
if (card_detected) {
|
||||
@@ -238,7 +238,7 @@ void menu_main() {
|
||||
// Autostart
|
||||
//
|
||||
#if ENABLED(MENU_ADDAUTOSTART)
|
||||
ACTION_ITEM(MSG_RUN_AUTO_FILES, card.beginautostart);
|
||||
ACTION_ITEM(MSG_RUN_AUTO_FILES, card.autofile_begin);
|
||||
#endif
|
||||
|
||||
if (card_detected) {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (C) 2016 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
|
||||
* 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
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
// SD Connection
|
||||
//
|
||||
#ifndef SDCARD_CONNECTION
|
||||
#define SDCARD_CONNECTION LCD
|
||||
#define SDCARD_CONNECTION LCD
|
||||
#endif
|
||||
|
||||
//
|
||||
@@ -244,7 +244,7 @@
|
||||
// SD Connection
|
||||
//
|
||||
#if SD_CONNECTION_IS(LCD)
|
||||
#define SS_PIN EXPA2_07_PIN
|
||||
#define SS_PIN EXPA2_07_PIN
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -286,24 +286,24 @@
|
||||
* LCD LCD
|
||||
*/
|
||||
|
||||
#define LCD_PINS_RS EXPA1_03_PIN
|
||||
#define LCD_PINS_RS EXPA1_03_PIN
|
||||
|
||||
#define BTN_EN1 EXPA1_06_PIN
|
||||
#define BTN_EN2 EXPA1_04_PIN
|
||||
#define BTN_ENC EXPA1_08_PIN
|
||||
#define BTN_EN1 EXPA1_06_PIN
|
||||
#define BTN_EN2 EXPA1_04_PIN
|
||||
#define BTN_ENC EXPA1_08_PIN
|
||||
|
||||
#define LCD_PINS_ENABLE EXPA1_05_PIN
|
||||
#define LCD_PINS_D4 EXPA1_07_PIN
|
||||
#define LCD_PINS_ENABLE EXPA1_05_PIN
|
||||
#define LCD_PINS_D4 EXPA1_07_PIN
|
||||
|
||||
#elif ENABLED(CR10_STOCKDISPLAY)
|
||||
#define BTN_ENC EXPA1_09_PIN // (58) open-drain
|
||||
#define LCD_PINS_RS EXPA1_04_PIN
|
||||
#define BTN_ENC EXPA1_09_PIN // (58) open-drain
|
||||
#define LCD_PINS_RS EXPA1_04_PIN
|
||||
|
||||
#define BTN_EN1 EXPA1_08_PIN
|
||||
#define BTN_EN2 EXPA1_06_PIN
|
||||
#define BTN_EN1 EXPA1_08_PIN
|
||||
#define BTN_EN2 EXPA1_06_PIN
|
||||
|
||||
#define LCD_PINS_ENABLE EXPA1_03_PIN
|
||||
#define LCD_PINS_D4 EXPA1_05_PIN
|
||||
#define LCD_PINS_ENABLE EXPA1_03_PIN
|
||||
#define LCD_PINS_D4 EXPA1_05_PIN
|
||||
|
||||
#elif ENABLED(ENDER2_STOCKDISPLAY)
|
||||
|
||||
@@ -318,36 +318,36 @@
|
||||
* EXP1
|
||||
*/
|
||||
|
||||
#define BTN_EN1 EXPA1_08_PIN
|
||||
#define BTN_EN2 EXPA1_06_PIN
|
||||
#define BTN_ENC EXPA1_09_PIN
|
||||
#define BTN_EN1 EXPA1_08_PIN
|
||||
#define BTN_EN2 EXPA1_06_PIN
|
||||
#define BTN_ENC EXPA1_09_PIN
|
||||
|
||||
#define DOGLCD_CS EXPA1_04_PIN
|
||||
#define DOGLCD_A0 EXPA1_05_PIN
|
||||
#define DOGLCD_SCK EXPA1_10_PIN
|
||||
#define DOGLCD_MOSI EXPA1_03_PIN
|
||||
#define DOGLCD_CS EXPA1_04_PIN
|
||||
#define DOGLCD_A0 EXPA1_05_PIN
|
||||
#define DOGLCD_SCK EXPA1_10_PIN
|
||||
#define DOGLCD_MOSI EXPA1_03_PIN
|
||||
#define FORCE_SOFT_SPI
|
||||
#define LCD_BACKLIGHT_PIN -1
|
||||
|
||||
#elif HAS_SPI_TFT // Config for Classic UI (emulated DOGM) and Color UI
|
||||
#define TFT_CS_PIN EXPA1_04_PIN
|
||||
#define TFT_A0_PIN EXPA1_03_PIN
|
||||
#define TFT_DC_PIN EXPA1_03_PIN
|
||||
#define TFT_MISO_PIN EXPA2_10_PIN
|
||||
#define TFT_BACKLIGHT_PIN EXPA1_08_PIN
|
||||
#define TFT_RESET_PIN EXPA1_07_PIN
|
||||
#define TFT_CS_PIN EXPA1_04_PIN
|
||||
#define TFT_A0_PIN EXPA1_03_PIN
|
||||
#define TFT_DC_PIN EXPA1_03_PIN
|
||||
#define TFT_MISO_PIN EXPA2_10_PIN
|
||||
#define TFT_BACKLIGHT_PIN EXPA1_08_PIN
|
||||
#define TFT_RESET_PIN EXPA1_07_PIN
|
||||
|
||||
#define LCD_USE_DMA_SPI
|
||||
|
||||
#define TOUCH_INT_PIN EXPA1_05_PIN
|
||||
#define TOUCH_CS_PIN EXPA1_06_PIN
|
||||
#define TOUCH_INT_PIN EXPA1_05_PIN
|
||||
#define TOUCH_CS_PIN EXPA1_06_PIN
|
||||
#define TOUCH_BUTTONS_HW_SPI
|
||||
#define TOUCH_BUTTONS_HW_SPI_DEVICE 1
|
||||
|
||||
// SPI 1
|
||||
#define SCK_PIN EXPA2_09_PIN
|
||||
#define MISO_PIN EXPA2_10_PIN
|
||||
#define MOSI_PIN EXPA2_05_PIN
|
||||
#define SCK_PIN EXPA2_09_PIN
|
||||
#define MISO_PIN EXPA2_10_PIN
|
||||
#define MOSI_PIN EXPA2_05_PIN
|
||||
|
||||
// Disable any LCD related PINs config
|
||||
#define LCD_PINS_ENABLE -1
|
||||
@@ -358,72 +358,72 @@
|
||||
#elif IS_TFTGLCD_PANEL
|
||||
|
||||
#if ENABLED(TFTGLCD_PANEL_SPI)
|
||||
#define TFTGLCD_CS EXPA2_08_PIN
|
||||
#define TFTGLCD_CS EXPA2_08_PIN
|
||||
#endif
|
||||
|
||||
#define SD_DETECT_PIN EXPA2_04_PIN
|
||||
#define SD_DETECT_PIN EXPA2_04_PIN
|
||||
|
||||
#else
|
||||
|
||||
#define BTN_ENC EXPA1_09_PIN // (58) open-drain
|
||||
#define LCD_PINS_RS EXPA1_07_PIN
|
||||
#define BTN_ENC EXPA1_09_PIN // (58) open-drain
|
||||
#define LCD_PINS_RS EXPA1_07_PIN
|
||||
|
||||
#define BTN_EN1 EXPA2_08_PIN // (31) J3-2 & AUX-4
|
||||
#define BTN_EN2 EXPA2_06_PIN // (33) J3-4 & AUX-4
|
||||
#define BTN_EN1 EXPA2_08_PIN // (31) J3-2 & AUX-4
|
||||
#define BTN_EN2 EXPA2_06_PIN // (33) J3-4 & AUX-4
|
||||
|
||||
#define LCD_PINS_ENABLE EXPA1_08_PIN
|
||||
#define LCD_PINS_D4 EXPA1_06_PIN
|
||||
#define LCD_PINS_ENABLE EXPA1_08_PIN
|
||||
#define LCD_PINS_D4 EXPA1_06_PIN
|
||||
|
||||
#define LCD_SDSS EXPA2_07_PIN // (16) J3-7 & AUX-4
|
||||
#define LCD_SDSS EXPA2_07_PIN // (16) J3-7 & AUX-4
|
||||
|
||||
#if SD_CONNECTION_IS(LCD)
|
||||
#define SD_DETECT_PIN EXPA2_04_PIN // (49) (NOT 5V tolerant)
|
||||
#define SD_DETECT_PIN EXPA2_04_PIN // (49) (NOT 5V tolerant)
|
||||
#endif
|
||||
|
||||
#if ENABLED(FYSETC_MINI_12864)
|
||||
#define DOGLCD_CS EXPA1_08_PIN
|
||||
#define DOGLCD_A0 EXPA1_07_PIN
|
||||
#define DOGLCD_SCK EXPA2_09_PIN
|
||||
#define DOGLCD_MOSI EXPA2_05_PIN
|
||||
#define DOGLCD_CS EXPA1_08_PIN
|
||||
#define DOGLCD_A0 EXPA1_07_PIN
|
||||
#define DOGLCD_SCK EXPA2_09_PIN
|
||||
#define DOGLCD_MOSI EXPA2_05_PIN
|
||||
|
||||
#define LCD_BACKLIGHT_PIN -1
|
||||
|
||||
#define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems
|
||||
// results in LCD soft SPI mode 3, SD soft SPI mode 0
|
||||
|
||||
#define LCD_RESET_PIN EXPA1_06_PIN // Must be high or open for LCD to operate normally.
|
||||
#define LCD_RESET_PIN EXPA1_06_PIN // Must be high or open for LCD to operate normally.
|
||||
|
||||
#if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0)
|
||||
#ifndef RGB_LED_R_PIN
|
||||
#define RGB_LED_R_PIN EXPA1_05_PIN
|
||||
#define RGB_LED_R_PIN EXPA1_05_PIN
|
||||
#endif
|
||||
#ifndef RGB_LED_G_PIN
|
||||
#define RGB_LED_G_PIN EXPA1_04_PIN
|
||||
#define RGB_LED_G_PIN EXPA1_04_PIN
|
||||
#endif
|
||||
#ifndef RGB_LED_B_PIN
|
||||
#define RGB_LED_B_PIN EXPA1_03_PIN
|
||||
#define RGB_LED_B_PIN EXPA1_03_PIN
|
||||
#endif
|
||||
#elif ENABLED(FYSETC_MINI_12864_2_1)
|
||||
#define NEOPIXEL_PIN EXPA1_05_PIN
|
||||
#define NEOPIXEL_PIN EXPA1_05_PIN
|
||||
#endif
|
||||
|
||||
#else // !FYSETC_MINI_12864
|
||||
|
||||
#if ENABLED(MKS_MINI_12864)
|
||||
#define DOGLCD_CS EXPA1_05_PIN
|
||||
#define DOGLCD_A0 EXPA1_04_PIN
|
||||
#define DOGLCD_SCK EXPA2_09_PIN
|
||||
#define DOGLCD_MOSI EXPA2_05_PIN
|
||||
#define DOGLCD_CS EXPA1_05_PIN
|
||||
#define DOGLCD_A0 EXPA1_04_PIN
|
||||
#define DOGLCD_SCK EXPA2_09_PIN
|
||||
#define DOGLCD_MOSI EXPA2_05_PIN
|
||||
#define FORCE_SOFT_SPI
|
||||
#endif
|
||||
|
||||
#if IS_ULTIPANEL
|
||||
#define LCD_PINS_D5 EXPA1_05_PIN
|
||||
#define LCD_PINS_D6 EXPA1_04_PIN
|
||||
#define LCD_PINS_D7 EXPA1_03_PIN
|
||||
#define LCD_PINS_D5 EXPA1_05_PIN
|
||||
#define LCD_PINS_D6 EXPA1_04_PIN
|
||||
#define LCD_PINS_D7 EXPA1_03_PIN
|
||||
|
||||
#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
|
||||
#define BTN_ENC_EN EXPA1_03_PIN // Detect the presence of the encoder
|
||||
#define BTN_ENC_EN EXPA1_03_PIN // Detect the presence of the encoder
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -33,8 +33,12 @@
|
||||
// https://github.com/bigtreetech/BTT-Expansion-module/tree/master/BTT%20EXP-MOT
|
||||
//#define HAS_BTT_EXP_MOT 1
|
||||
|
||||
#if BOTH(HAS_WIRED_LCD,HAS_BTT_EXP_MOT)
|
||||
#ERROR "Having a LCD on EXP1/EXP2 and a expanion motor module on EXP1/EXP2 is not possable."
|
||||
#if BOTH(HAS_WIRED_LCD, HAS_BTT_EXP_MOT)
|
||||
#if EITHER(CR10_STOCKDISPLAY, ENDER2_STOCKDISPLAY)
|
||||
#define EXP_MOT_USE_EXP2_ONLY
|
||||
#else
|
||||
#error "Having a LCD that uses both EXP1/EXP2 and a expanion motor module on EXP1/EXP2 is not possible."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Ignore temp readings during development.
|
||||
@@ -125,44 +129,60 @@
|
||||
#endif
|
||||
|
||||
#if HAS_BTT_EXP_MOT
|
||||
/* _____ _____
|
||||
* NC | · · | GND NC | · · | GND
|
||||
* NC | · · | 1.31 (M1EN) (M2EN) 1.23 | · · | 1.22 (M3EN)
|
||||
* (M1STP) 0.18 | · · 3.25 (M1DIR) (M1RX) 1.21 | · · 1.20 (M1DIAG)
|
||||
* (M2DIR) 0.16 | · · | 3.26 (M2STP) (M2RX) 1.19 | · · | 1.18 (M2DIAG)
|
||||
* (M3DIR) 0.15 | · · | 0.17 (M3STP) (M3RX) 0.28 | · · | 1.30 (M3DIAG)
|
||||
* ----- -----
|
||||
* EXP2 EXP1
|
||||
*/
|
||||
|
||||
/** _____ _____
|
||||
* NC | · · | GND NC | · · | GND
|
||||
* NC | · · | 1.31 (M1EN) (M2EN) 1.23 | · · | 1.22 (M3EN)
|
||||
* (M1STP) 0.18 | · · 3.25 (M1DIR) (M1RX) 1.21 | · · 1.20 (M1DIAG)
|
||||
* (M2DIR) 0.16 | · · | 3.26 (M2STP) (M2RX) 1.19 | · · | 1.18 (M2DIAG)
|
||||
* (M3DIR) 0.15 | · · | 0.17 (M3STP) (M3RX) 0.28 | · · | 1.30 (M3DIAG)
|
||||
* ----- -----
|
||||
* EXP2 EXP1
|
||||
*
|
||||
* NB In EXP_MOT_USE_EXP2_ONLY mode EXP1 is not used and M2EN and M3EN need to be jumpered to M1EN
|
||||
*/
|
||||
|
||||
// M1 on Driver Expansion Module
|
||||
#define E2_STEP_PIN EXPA2_05_PIN
|
||||
#define E2_DIR_PIN EXPA2_06_PIN
|
||||
#define E2_ENABLE_PIN EXPA2_04_PIN
|
||||
#define E2_DIAG_PIN EXPA1_06_PIN
|
||||
#define E2_CS_PIN EXPA1_05_PIN
|
||||
#if HAS_TMC_UART
|
||||
#define E2_SERIAL_TX_PIN EXPA1_05_PIN
|
||||
#define E2_SERIAL_RX_PIN EXPA1_05_PIN
|
||||
#define E2_STEP_PIN EXPA2_05_PIN
|
||||
#define E2_DIR_PIN EXPA2_06_PIN
|
||||
#define E2_ENABLE_PIN EXPA2_04_PIN
|
||||
#ifndef EXP_MOT_USE_EXP2_ONLY
|
||||
#define E2_DIAG_PIN EXPA1_06_PIN
|
||||
#define E2_CS_PIN EXPA1_05_PIN
|
||||
#if HAS_TMC_UART
|
||||
#define E2_SERIAL_TX_PIN EXPA1_05_PIN
|
||||
#define E2_SERIAL_RX_PIN EXPA1_05_PIN
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// M2 on Driver Expansion Module
|
||||
#define E3_STEP_PIN EXPA2_08_PIN
|
||||
#define E3_DIR_PIN EXPA2_07_PIN
|
||||
#define E3_ENABLE_PIN EXPA1_03_PIN
|
||||
#define E3_DIAG_PIN EXPA1_08_PIN
|
||||
#define E3_CS_PIN EXPA1_07_PIN
|
||||
#if HAS_TMC_UART
|
||||
#define E3_SERIAL_TX_PIN EXPA1_07_PIN
|
||||
#define E3_SERIAL_RX_PIN EXPA1_07_PIN
|
||||
#define E3_STEP_PIN EXPA2_08_PIN
|
||||
#define E3_DIR_PIN EXPA2_07_PIN
|
||||
#ifndef EXP_MOT_USE_EXP2_ONLY
|
||||
#define E3_ENABLE_PIN EXPA1_03_PIN
|
||||
#define E3_DIAG_PIN EXPA1_08_PIN
|
||||
#define E3_CS_PIN EXPA1_07_PIN
|
||||
#if HAS_TMC_UART
|
||||
#define E3_SERIAL_TX_PIN EXPA1_07_PIN
|
||||
#define E3_SERIAL_RX_PIN EXPA1_07_PIN
|
||||
#endif
|
||||
#else
|
||||
#define E3_ENABLE_PIN EXPA2_04_PIN
|
||||
#endif
|
||||
|
||||
// M3 on Driver Expansion Module
|
||||
#define E4_STEP_PIN EXPA2_10_PIN
|
||||
#define E4_DIR_PIN EXPA2_09_PIN
|
||||
#define E4_ENABLE_PIN EXPA1_04_PIN
|
||||
#define E4_DIAG_PIN EXPA1_10_PIN
|
||||
#define E4_CS_PIN EXPA1_09_PIN
|
||||
#if HAS_TMC_UART
|
||||
#define E4_SERIAL_TX_PIN EXPA1_09_PIN
|
||||
#define E4_SERIAL_RX_PIN EXPA1_09_PIN
|
||||
#define E4_STEP_PIN EXPA2_10_PIN
|
||||
#define E4_DIR_PIN EXPA2_09_PIN
|
||||
#ifndef EXP_MOT_USE_EXP2_ONLY
|
||||
#define E4_ENABLE_PIN EXPA1_04_PIN
|
||||
#define E4_DIAG_PIN EXPA1_10_PIN
|
||||
#define E4_CS_PIN EXPA1_09_PIN
|
||||
#if HAS_TMC_UART
|
||||
#define E4_SERIAL_TX_PIN EXPA1_09_PIN
|
||||
#define E4_SERIAL_RX_PIN EXPA1_09_PIN
|
||||
#endif
|
||||
#else
|
||||
#define E4_ENABLE_PIN EXPA2_04_PIN
|
||||
#endif
|
||||
|
||||
#endif // HAS_BTT_EXP_MOT
|
||||
|
||||
@@ -582,12 +582,14 @@
|
||||
#include "stm32f4/pins_VAKE403D.h" // STM32F4
|
||||
#elif MB(FYSETC_S6)
|
||||
#include "stm32f4/pins_FYSETC_S6.h" // STM32F4 env:FYSETC_S6
|
||||
#elif MB(FYSETC_S6_V2_0)
|
||||
#include "stm32f4/pins_FYSETC_S6_V2_0.h" // STM32F4 env:FYSETC_S6
|
||||
#elif MB(FLYF407ZG)
|
||||
#include "stm32f4/pins_FLYF407ZG.h" // STM32F4 env:FLYF407ZG
|
||||
#elif MB(MKS_ROBIN2)
|
||||
#include "stm32f4/pins_MKS_ROBIN2.h" // STM32F4 env:MKS_ROBIN2
|
||||
#elif MB(FYSETC_S6_V2_0)
|
||||
#include "stm32f4/pins_FYSETC_S6_V2_0.h" // STM32F4 env:FYSETC_S6
|
||||
#elif MB(MKS_ROBIN_PRO_V2)
|
||||
#include "stm32f4/pins_MKS_ROBIN_PRO_V2.h" // STM32F4 env:mks_robin_pro2
|
||||
|
||||
//
|
||||
// ARM Cortex M7
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (C) 2016 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
|
||||
* 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
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (C) 2016 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
|
||||
* 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
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (C) 2016 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
|
||||
* 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
|
||||
@@ -27,7 +27,7 @@
|
||||
#if NOT_TARGET(__STM32F1__)
|
||||
#error "Oops! Select an STM32F1 board in 'Tools > Board.'"
|
||||
#elif HOTENDS > 1 || E_STEPPERS > 1
|
||||
#error "Creality_V4 only supports one hotend / E-stepper. Comment out this line to continue."
|
||||
#error "Creality V4 only supports one hotend / E-stepper. Comment out this line to continue."
|
||||
#endif
|
||||
|
||||
#ifndef BOARD_INFO_NAME
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (C) 2016 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
|
||||
* 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
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (C) 2020 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
|
||||
* 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
|
||||
@@ -16,7 +16,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -33,81 +33,88 @@
|
||||
#define BOARD_NAME "Creality v4.5.2"
|
||||
#define DEFAULT_MACHINE_NAME "Creality3D"
|
||||
|
||||
//
|
||||
// Release PB4 (Z_STEP_PIN) from JTAG NRST role
|
||||
//
|
||||
#define DISABLE_DEBUG
|
||||
|
||||
#define BOARD_NO_NATIVE_USB
|
||||
|
||||
//
|
||||
// EEPROM
|
||||
//
|
||||
#if NO_EEPROM_SELECTED
|
||||
#define IIC_BL24CXX_EEPROM // EEPROM on I2C-0
|
||||
#define IIC_BL24CXX_EEPROM // EEPROM on I2C-0
|
||||
//#define SDCARD_EEPROM_EMULATION
|
||||
#endif
|
||||
|
||||
#if ENABLED(IIC_BL24CXX_EEPROM)
|
||||
#define IIC_EEPROM_SDA PA11
|
||||
#define IIC_EEPROM_SCL PA12
|
||||
#define MARLIN_EEPROM_SIZE 0x800 // 2Kb (24C16)
|
||||
#define IIC_EEPROM_SDA PA11
|
||||
#define IIC_EEPROM_SCL PA12
|
||||
#define MARLIN_EEPROM_SIZE 0x800 // 2Kb (24C16)
|
||||
#elif ENABLED(SDCARD_EEPROM_EMULATION)
|
||||
#define MARLIN_EEPROM_SIZE 0x800 // 2Kb
|
||||
#define MARLIN_EEPROM_SIZE 0x800 // 2Kb
|
||||
#endif
|
||||
|
||||
//
|
||||
// Limit Switches
|
||||
//
|
||||
#define X_MIN_PIN PC4
|
||||
// #define X_MAX_PIN PA7
|
||||
#define Y_MIN_PIN PC5
|
||||
#define Z_MIN_PIN PA4
|
||||
#define PROBE_TARE_PIN PA5
|
||||
#define X_STOP_PIN PC4
|
||||
#define Y_STOP_PIN PC5
|
||||
#define Z_STOP_PIN PA4
|
||||
|
||||
#define FIL_RUNOUT_PIN PA7
|
||||
|
||||
//
|
||||
// Probe
|
||||
//
|
||||
#define PROBE_TARE_PIN PA5
|
||||
#define PROBE_ENABLE_PIN PC6 // Optoswitch to Enable Z Probe
|
||||
|
||||
//
|
||||
// Steppers
|
||||
//
|
||||
#define X_ENABLE_PIN PC3
|
||||
#define X_STEP_PIN PB8
|
||||
#define X_DIR_PIN PB7
|
||||
#define X_ENABLE_PIN PC3
|
||||
#define X_STEP_PIN PB8
|
||||
#define X_DIR_PIN PB7
|
||||
|
||||
#define Y_ENABLE_PIN PC3
|
||||
#define Y_STEP_PIN PB6
|
||||
#define Y_DIR_PIN PB5
|
||||
#define Y_ENABLE_PIN PC3
|
||||
#define Y_STEP_PIN PB6
|
||||
#define Y_DIR_PIN PB5
|
||||
|
||||
#define Z_ENABLE_PIN PC3
|
||||
#define Z_STEP_PIN PB4
|
||||
#define Z_DIR_PIN PB3
|
||||
#define Z_ENABLE_PIN PC3
|
||||
#define Z_STEP_PIN PB4
|
||||
#define Z_DIR_PIN PB3
|
||||
|
||||
#define E0_ENABLE_PIN PC3
|
||||
#define E0_STEP_PIN PC2
|
||||
#define E0_DIR_PIN PB9
|
||||
|
||||
|
||||
//
|
||||
// Release PB4 (Z_STEP_PIN) from JTAG NRST role
|
||||
//
|
||||
#define DISABLE_DEBUG
|
||||
#define E0_ENABLE_PIN PC3
|
||||
#define E0_STEP_PIN PC2
|
||||
#define E0_DIR_PIN PB9
|
||||
|
||||
//
|
||||
// Temperature Sensors
|
||||
//
|
||||
#define TEMP_0_PIN PB1 // TH1
|
||||
#define TEMP_BED_PIN PB0 // TB1
|
||||
#define TEMP_0_PIN PB1 // TH1
|
||||
#define TEMP_BED_PIN PB0 // TB1
|
||||
|
||||
//
|
||||
// Heaters / Fans
|
||||
//
|
||||
#define HEATER_0_PIN PA1 // HEATER1
|
||||
#define HEATER_BED_PIN PA2 // HOT BED
|
||||
|
||||
#define HEATER_0_PIN PA1 // HEATER1
|
||||
#define HEATER_BED_PIN PA2 // HOT BED
|
||||
|
||||
#define FAN_PIN PA0 // FAN
|
||||
#define FAN_PIN PA0 // FAN
|
||||
#define FAN_SOFT_PWM
|
||||
|
||||
/* SD card detect */
|
||||
#define SD_DETECT_PIN PC7
|
||||
#define NO_SD_HOST_DRIVE // SD is only seen by the printer
|
||||
//
|
||||
// SD Card
|
||||
//
|
||||
#define SD_DETECT_PIN PC7
|
||||
#define NO_SD_HOST_DRIVE // SD is only seen by the printer
|
||||
|
||||
#define SDIO_SUPPORT // Extra added by Creality
|
||||
#define SDIO_CLOCK 6000000 // In original source code overridden by Creality in sdio.h
|
||||
#define SDIO_SUPPORT // Extra added by Creality
|
||||
#define SDIO_CLOCK 6000000 // In original source code overridden by Creality in sdio.h
|
||||
|
||||
#define CASE_LIGHT_PIN PA6
|
||||
|
||||
#define FIL_RUNOUT_PIN PA7
|
||||
#define PROBE_ENABLE_PIN PC6 // Optoswitch to Enable Z Probe
|
||||
//
|
||||
// Misc. Functions
|
||||
//
|
||||
#define CASE_LIGHT_PIN PA6
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
//
|
||||
#if NO_EEPROM_SELECTED
|
||||
#define FLASH_EEPROM_EMULATION
|
||||
//#define SRAM_EEPROM_EMULATION
|
||||
//#define I2C_EEPROM
|
||||
#endif
|
||||
|
||||
@@ -51,7 +50,7 @@
|
||||
// 128 kB sector allocated for EEPROM emulation.
|
||||
#define FLASH_EEPROM_LEVELING
|
||||
#elif ENABLED(I2C_EEPROM)
|
||||
#define MARLIN_EEPROM_SIZE 0x1000 // 4KB
|
||||
#define MARLIN_EEPROM_SIZE 0x0800 // 2KB
|
||||
#endif
|
||||
|
||||
//
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
#if NO_EEPROM_SELECTED
|
||||
#undef NO_EEPROM_SELECTED
|
||||
//#define FLASH_EEPROM_EMULATION
|
||||
//#define SRAM_EEPROM_EMULATION
|
||||
#define I2C_EEPROM
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,381 @@
|
||||
/**
|
||||
* 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
|
||||
|
||||
#if NOT_TARGET(STM32F4, STM32F4xx)
|
||||
#error "Oops! Select an STM32F4 board in 'Tools > Board.'"
|
||||
#elif HOTENDS > 2 || E_STEPPERS > 2
|
||||
#error "MKS Robin Nano V3 supports up to 1 hotends / E-steppers."
|
||||
#endif
|
||||
|
||||
#define BOARD_INFO_NAME "MKS Robin PRO V2"
|
||||
|
||||
// Use one of these or SDCard-based Emulation will be used
|
||||
//#define SRAM_EEPROM_EMULATION // Use BackSRAM-based EEPROM emulation
|
||||
//#define FLASH_EEPROM_EMULATION // Use Flash-based EEPROM emulation
|
||||
#define I2C_EEPROM
|
||||
|
||||
//
|
||||
// Release PB4 (Y_ENABLE_PIN) from JTAG NRST role
|
||||
//
|
||||
|
||||
//
|
||||
// Note: MKS Robin board is using SPI2 interface.
|
||||
//
|
||||
//#define SPI_MODULE 2
|
||||
|
||||
//
|
||||
// Limit Switches
|
||||
//
|
||||
#define X_DIAG_PIN PA15
|
||||
#define Y_DIAG_PIN PA12
|
||||
#define Z_DIAG_PIN PA11
|
||||
#define E0_DIAG_PIN PC4
|
||||
#define E1_DIAG_PIN PE7
|
||||
|
||||
//
|
||||
|
||||
#define X_STOP_PIN PA15
|
||||
#define Y_STOP_PIN PA12
|
||||
#define Z_MIN_PIN PA11
|
||||
#define Z_MAX_PIN PC4
|
||||
|
||||
#ifndef FIL_RUNOUT_PIN
|
||||
#define FIL_RUNOUT_PIN PA4 // MT_DET
|
||||
#endif
|
||||
|
||||
//
|
||||
// Steppers
|
||||
//
|
||||
#define X_ENABLE_PIN PE4
|
||||
#define X_STEP_PIN PE3
|
||||
#define X_DIR_PIN PE2
|
||||
#ifndef X_CS_PIN
|
||||
#define X_CS_PIN PD5
|
||||
#endif
|
||||
|
||||
#define Y_ENABLE_PIN PE1
|
||||
#define Y_STEP_PIN PE0
|
||||
#define Y_DIR_PIN PB9
|
||||
#ifndef Y_CS_PIN
|
||||
#define Y_CS_PIN PD7
|
||||
#endif
|
||||
|
||||
#define Z_ENABLE_PIN PB8
|
||||
#define Z_STEP_PIN PB5
|
||||
#define Z_DIR_PIN PB4
|
||||
#ifndef Z_CS_PIN
|
||||
#define Z_CS_PIN PD4
|
||||
#endif
|
||||
|
||||
#define E0_ENABLE_PIN PB3
|
||||
#define E0_STEP_PIN PD6
|
||||
#define E0_DIR_PIN PD3
|
||||
#ifndef E0_CS_PIN
|
||||
#define E0_CS_PIN PD9
|
||||
#endif
|
||||
|
||||
#define E1_ENABLE_PIN PA3
|
||||
#define E1_STEP_PIN PD15
|
||||
#define E1_DIR_PIN PA1
|
||||
#ifndef E1_CS_PIN
|
||||
#define E1_CS_PIN PD8
|
||||
#endif
|
||||
|
||||
//
|
||||
// Software SPI pins for TMC2130 stepper drivers
|
||||
//
|
||||
#if ENABLED(TMC_USE_SW_SPI)
|
||||
#ifndef TMC_SW_MOSI
|
||||
#define TMC_SW_MOSI PD14
|
||||
#endif
|
||||
#ifndef TMC_SW_MISO
|
||||
#define TMC_SW_MISO PD1
|
||||
#endif
|
||||
#ifndef TMC_SW_SCK
|
||||
#define TMC_SW_SCK PD0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAS_TMC_UART
|
||||
/**
|
||||
* TMC2208/TMC2209 stepper drivers
|
||||
*
|
||||
* Hardware serial communication ports.
|
||||
* If undefined software serial is used according to the pins below
|
||||
*/
|
||||
//#define X_HARDWARE_SERIAL Serial1
|
||||
//#define X2_HARDWARE_SERIAL Serial1
|
||||
//#define Y_HARDWARE_SERIAL Serial1
|
||||
//#define Y2_HARDWARE_SERIAL Serial1
|
||||
//#define Z_HARDWARE_SERIAL Serial1
|
||||
//#define Z2_HARDWARE_SERIAL Serial1
|
||||
//#define E0_HARDWARE_SERIAL Serial1
|
||||
//#define E1_HARDWARE_SERIAL Serial1
|
||||
//#define E2_HARDWARE_SERIAL Serial1
|
||||
//#define E3_HARDWARE_SERIAL Serial1
|
||||
//#define E4_HARDWARE_SERIAL Serial1
|
||||
|
||||
//
|
||||
// Software serial
|
||||
//
|
||||
|
||||
#define X_SERIAL_TX_PIN PD5
|
||||
#define X_SERIAL_RX_PIN PD5
|
||||
|
||||
#define Y_SERIAL_TX_PIN PD7
|
||||
#define Y_SERIAL_RX_PIN PD7
|
||||
|
||||
#define Z_SERIAL_TX_PIN PD4
|
||||
#define Z_SERIAL_RX_PIN PD4
|
||||
|
||||
#define E0_SERIAL_TX_PIN PD9
|
||||
#define E0_SERIAL_RX_PIN PD9
|
||||
|
||||
#define E1_SERIAL_TX_PIN PD8
|
||||
#define E1_SERIAL_RX_PIN PD8
|
||||
|
||||
// Reduce baud rate to improve software serial reliability
|
||||
#define TMC_BAUD_RATE 19200
|
||||
#endif // TMC2208 || TMC2209
|
||||
|
||||
//
|
||||
// Temperature Sensors
|
||||
//
|
||||
#define TEMP_0_PIN PC1 // TH1
|
||||
#define TEMP_1_PIN PC2 // TH2
|
||||
#define TEMP_BED_PIN PC0 // TB1
|
||||
|
||||
//
|
||||
// Heaters / Fans
|
||||
//
|
||||
#define HEATER_0_PIN PC3 // HEATER1
|
||||
#define HEATER_1_PIN PB0 // HEATER2
|
||||
#define HEATER_BED_PIN PA0 // HOT BED
|
||||
|
||||
#define FAN_PIN PB1 // FAN
|
||||
|
||||
//
|
||||
// Thermocouples
|
||||
//
|
||||
//#define MAX6675_SS_PIN PE5 // TC1 - CS1
|
||||
//#define MAX6675_SS_PIN PE6 // TC2 - CS2
|
||||
|
||||
//
|
||||
// Misc. Functions
|
||||
//
|
||||
// #define POWER_LOSS_PIN PA2 // PW_DET
|
||||
// #define PS_ON_PIN PA3 // PW_OFF
|
||||
// #define SUICIDE_PIN PB2 // Enable MKSPWC support
|
||||
// #define KILL_PIN PA2 // Enable MKSPWC support
|
||||
// #define KILL_PIN_INVERTING true // Enable MKSPWC support
|
||||
#define SERVO0_PIN PA8 // Enable BLTOUCH support
|
||||
//#define LED_PIN PB2
|
||||
|
||||
#ifndef SDCARD_CONNECTION
|
||||
#define SDCARD_CONNECTION ONBOARD
|
||||
#endif
|
||||
|
||||
// #define USE_NEW_SPI_API 1
|
||||
|
||||
//
|
||||
// Onboard SD card
|
||||
// NOT compatible with LCD
|
||||
//
|
||||
// detect pin dont work when ONBOARD and NO_SD_HOST_DRIVE disabled
|
||||
#if !defined(SDCARD_CONNECTION) || SDCARD_CONNECTION == ONBOARD
|
||||
#define CUSTOM_SPI_PINS
|
||||
#if ENABLED(CUSTOM_SPI_PINS)
|
||||
|
||||
#if USE_NEW_SPI_API
|
||||
#define SD_SPI MARLIN_SPI(HardwareSPI3, PC9)
|
||||
#else
|
||||
#define ENABLE_SPI3
|
||||
#define SS_PIN -1
|
||||
#define SDSS PC9
|
||||
#define SCK_PIN PC10
|
||||
#define MISO_PIN PC11
|
||||
#define MOSI_PIN PC12
|
||||
#endif
|
||||
#define SD_DETECT_PIN PD12
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
//
|
||||
// LCD SD
|
||||
//
|
||||
#if SDCARD_CONNECTION == LCD
|
||||
#define CUSTOM_SPI_PINS
|
||||
#if ENABLED(CUSTOM_SPI_PINS)
|
||||
#define ENABLE_SPI1
|
||||
#define SDSS PE10
|
||||
#define SCK_PIN PA5
|
||||
#define MISO_PIN PA6
|
||||
#define MOSI_PIN PA7
|
||||
#define SD_DETECT_PIN PE12
|
||||
#endif
|
||||
#endif
|
||||
*/
|
||||
|
||||
//
|
||||
// LCD / Controller
|
||||
#define SPI_FLASH
|
||||
// #define HAS_SPI_FLASH 1
|
||||
#define SPI_DEVICE 2
|
||||
#define SPI_FLASH_SIZE 0x1000000
|
||||
#if ENABLED(SPI_FLASH)
|
||||
#define W25QXX_CS_PIN PB12
|
||||
#define W25QXX_MOSI_PIN PB15
|
||||
#define W25QXX_MISO_PIN PB14
|
||||
#define W25QXX_SCK_PIN PB13
|
||||
#endif
|
||||
|
||||
/**
|
||||
* _____ _____
|
||||
* (BEEPER)PC5 | · · | PE13(BTN_ENC) (SPI1 MISO) PA6 | · · | PA5 (SPI1 SCK)
|
||||
* (LCD_EN)PD13 | · · | PC6(LCD_RS) (BTN_EN1) PE8 | · · | PE10 (SPI1 CS)
|
||||
* (LCD_D4)PE14 | · · | PE15(LCD_D5) (BTN_EN2) PE11 | · · | PA7 (SPI1 MOSI)
|
||||
* (LCD_D6)PD11 | · · | PD10(LCD_D7) (SPI DET) PE12 | · · | RESET
|
||||
* GND | · · | 5V GND | · · | 3.3V
|
||||
*  ̄ ̄ ̄  ̄ ̄ ̄
|
||||
* EXP1 EXP2
|
||||
*/
|
||||
|
||||
#if EITHER(TFT_480x320_SPI, TFT_LVGL_UI_SPI)
|
||||
#ifndef TOUCH_CALIBRATION_X
|
||||
#define TOUCH_CALIBRATION_X -17253
|
||||
#endif
|
||||
#ifndef TOUCH_CALIBRATION_Y
|
||||
#define TOUCH_CALIBRATION_Y 11579
|
||||
#endif
|
||||
#ifndef TOUCH_OFFSET_X
|
||||
#define TOUCH_OFFSET_X 514
|
||||
#endif
|
||||
#ifndef TOUCH_OFFSET_Y
|
||||
#define TOUCH_OFFSET_Y -24
|
||||
#endif
|
||||
#ifndef TOUCH_ORIENTATION
|
||||
#define TOUCH_ORIENTATION TOUCH_LANDSCAPE
|
||||
#endif
|
||||
|
||||
#define TFT_CS_PIN PD11
|
||||
#define TFT_SCK_PIN PA5
|
||||
#define TFT_MISO_PIN PA6
|
||||
#define TFT_MOSI_PIN PA7
|
||||
#define TFT_DC_PIN PD10
|
||||
#define TFT_RST_PIN PC6
|
||||
#define TFT_A0_PIN TFT_DC_PIN
|
||||
|
||||
#define TFT_RESET_PIN PC6
|
||||
#define TFT_BACKLIGHT_PIN PD13
|
||||
|
||||
#define TOUCH_BUTTONS_HW_SPI
|
||||
#define TOUCH_BUTTONS_HW_SPI_DEVICE 1
|
||||
|
||||
#define LCD_BACKLIGHT_PIN PD13
|
||||
#ifndef TFT_WIDTH
|
||||
#define TFT_WIDTH 480
|
||||
#endif
|
||||
#ifndef TFT_HEIGHT
|
||||
#define TFT_HEIGHT 320
|
||||
#endif
|
||||
|
||||
#define TOUCH_CS_PIN PE14 // SPI1_NSS
|
||||
#define TOUCH_SCK_PIN PA5 // SPI1_SCK
|
||||
#define TOUCH_MISO_PIN PA6 // SPI1_MISO
|
||||
#define TOUCH_MOSI_PIN PA7 // SPI1_MOSI
|
||||
|
||||
#define BTN_EN1 PE8
|
||||
#define BTN_EN2 PE11
|
||||
#define BEEPER_PIN PC5
|
||||
#define BTN_ENC PE13
|
||||
|
||||
#define LCD_READ_ID 0xD3
|
||||
#define LCD_USE_DMA_SPI
|
||||
|
||||
// #define TFT_DRIVER ST7796
|
||||
#define TFT_BUFFER_SIZE 14400
|
||||
|
||||
#elif HAS_SPI_LCD
|
||||
#define BEEPER_PIN PC5
|
||||
#define BTN_ENC PE13
|
||||
#define LCD_PINS_ENABLE PD13
|
||||
#define LCD_PINS_RS PC6
|
||||
#define BTN_EN1 PE8
|
||||
#define BTN_EN2 PE11
|
||||
#define LCD_BACKLIGHT_PIN -1
|
||||
|
||||
// MKS MINI12864 and MKS LCD12864B; If using MKS LCD12864A (Need to remove RPK2 resistor)
|
||||
#if ENABLED(MKS_MINI_12864)
|
||||
//#define LCD_BACKLIGHT_PIN -1
|
||||
//#define LCD_RESET_PIN -1
|
||||
#define DOGLCD_A0 PD11
|
||||
#define DOGLCD_CS PE15
|
||||
//#define DOGLCD_SCK PA5
|
||||
//#define DOGLCD_MOSI PA7
|
||||
|
||||
// Required for MKS_MINI_12864 with this board
|
||||
//#define MKS_LCD12864B
|
||||
//#undef SHOW_BOOTSCREEN
|
||||
|
||||
#else // !MKS_MINI_12864
|
||||
|
||||
#define LCD_PINS_D4 PE14
|
||||
#if ENABLED(ULTIPANEL)
|
||||
#define LCD_PINS_D5 PE15
|
||||
#define LCD_PINS_D6 PD11
|
||||
#define LCD_PINS_D7 PD10
|
||||
#endif
|
||||
|
||||
#ifndef ST7920_DELAY_1
|
||||
#define ST7920_DELAY_1 DELAY_NS(96)
|
||||
#endif
|
||||
#ifndef ST7920_DELAY_2
|
||||
#define ST7920_DELAY_2 DELAY_NS(48)
|
||||
#endif
|
||||
#ifndef ST7920_DELAY_3
|
||||
#define ST7920_DELAY_3 DELAY_NS(600)
|
||||
#endif
|
||||
|
||||
#endif // !MKS_MINI_12864
|
||||
|
||||
#elif ENABLED(SPI_GRAPHICAL_TFT)
|
||||
#define SPI_TFT_CS_PIN PD11
|
||||
#define SPI_TFT_SCK_PIN PA5
|
||||
#define SPI_TFT_MISO_PIN PA6
|
||||
#define SPI_TFT_MOSI_PIN PA7
|
||||
#define SPI_TFT_DC_PIN PD10
|
||||
#define SPI_TFT_RST_PIN PC6
|
||||
|
||||
#define LCD_BACKLIGHT_PIN PD13
|
||||
|
||||
#define TOUCH_CS_PIN PE14 // SPI1_NSS
|
||||
#define TOUCH_SCK_PIN PA5 // SPI1_SCK
|
||||
#define TOUCH_MISO_PIN PA6 // SPI1_MISO
|
||||
#define TOUCH_MOSI_PIN PA7 // SPI1_MOSI
|
||||
|
||||
#define BTN_EN1 PE8
|
||||
#define BTN_EN2 PE11
|
||||
#define BEEPER_PIN PC5
|
||||
#define BTN_ENC PE13
|
||||
#endif // HAS_SPI_LCD
|
||||
@@ -61,7 +61,8 @@
|
||||
|
||||
card_flags_t CardReader::flag;
|
||||
char CardReader::filename[FILENAME_LENGTH], CardReader::longFilename[LONG_FILENAME_LENGTH];
|
||||
int8_t CardReader::autostart_index;
|
||||
|
||||
IF_DISABLED(NO_SD_AUTOSTART, uint8_t CardReader::autofile_index); // = 0
|
||||
|
||||
#if BOTH(HAS_MULTI_SERIAL, BINARY_FILE_TRANSFER)
|
||||
int8_t CardReader::transfer_port_index;
|
||||
@@ -135,17 +136,17 @@ CardReader::CardReader() {
|
||||
//sort_reverse = false;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
flag.sdprinting = flag.mounted = flag.saving = flag.logging = false;
|
||||
filesize = sdpos = 0;
|
||||
|
||||
TERN_(HAS_MEDIA_SUBCALLS, file_subcall_ctr = 0);
|
||||
|
||||
IF_DISABLED(NO_SD_AUTOSTART, autofile_cancel());
|
||||
|
||||
workDirDepth = 0;
|
||||
ZERO(workDirParents);
|
||||
|
||||
// Disable autostart until card is initialized
|
||||
autostart_index = -1;
|
||||
|
||||
#if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT)
|
||||
SET_INPUT_PULLUP(SD_DETECT_PIN);
|
||||
#endif
|
||||
@@ -442,12 +443,14 @@ void CardReader::manage_media() {
|
||||
|
||||
if (stat) {
|
||||
TERN_(SDCARD_EEPROM_EMULATION, settings.first_load());
|
||||
if (old_stat == 2) // First mount?
|
||||
if (old_stat == 2) { // First mount?
|
||||
DEBUG_ECHOLNPGM("First mount.");
|
||||
TERN(POWER_LOSS_RECOVERY,
|
||||
recovery.check(), // Check for PLR file. (If not there it will beginautostart)
|
||||
beginautostart() // Look for auto0.g on the next loop
|
||||
);
|
||||
#if ENABLED(POWER_LOSS_RECOVERY)
|
||||
recovery.check(); // Check for PLR file. (If not there then call autofile_begin)
|
||||
#elif DISABLED(NO_SD_AUTOSTART)
|
||||
autofile_begin(); // Look for auto0.g on the next loop
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -477,12 +480,12 @@ void CardReader::release() {
|
||||
* Enqueues M23 and M24 commands to initiate a media print.
|
||||
*/
|
||||
void CardReader::openAndPrintFile(const char *name) {
|
||||
char cmd[4 + strlen(name) + 1]; // Room for "M23 ", filename, and null
|
||||
char cmd[4 + strlen(name) + 1 + 3 + 1]; // Room for "M23 ", filename, "\n", "M24", and null
|
||||
extern const char M23_STR[];
|
||||
sprintf_P(cmd, M23_STR, name);
|
||||
for (char *c = &cmd[4]; *c; c++) *c = tolower(*c);
|
||||
queue.enqueue_one_now(cmd);
|
||||
queue.enqueue_now_P(M24_STR);
|
||||
strcat_P(cmd, PSTR("\nM24"));
|
||||
queue.inject(cmd);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -511,7 +514,7 @@ void CardReader::endFilePrint(TERN_(SD_RESORT, const bool re_sort/*=false*/)) {
|
||||
|
||||
void CardReader::openLogFile(char * const path) {
|
||||
flag.logging = DISABLED(SDCARD_READONLY);
|
||||
TERN(SDCARD_READONLY,,openFileWrite(path));
|
||||
IF_DISABLED(SDCARD_READONLY, openFileWrite(path));
|
||||
}
|
||||
|
||||
//
|
||||
@@ -662,14 +665,24 @@ void CardReader::openFileWrite(char * const path) {
|
||||
//
|
||||
bool CardReader::fileExists(const char * const path) {
|
||||
if (!isMounted()) return false;
|
||||
|
||||
DEBUG_ECHOLNPAIR("fileExists: ", path);
|
||||
|
||||
// Dive to the file's directory and get the base name
|
||||
SdFile *diveDir = nullptr;
|
||||
const char * const fname = diveToFile(false, diveDir, path);
|
||||
if (fname) {
|
||||
diveDir->rewind();
|
||||
selectByName(*diveDir, fname);
|
||||
//diveDir->close();
|
||||
}
|
||||
return !!fname;
|
||||
if (!fname) return false;
|
||||
|
||||
// Get the longname of the checked file
|
||||
//diveDir->rewind();
|
||||
//selectByName(*diveDir, fname);
|
||||
//diveDir->close();
|
||||
|
||||
// Try to open the file and return the result
|
||||
SdFile tmpFile;
|
||||
const bool success = tmpFile.open(diveDir, fname, O_READ);
|
||||
if (success) tmpFile.close();
|
||||
return success;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -725,42 +738,48 @@ void CardReader::write_command(char * const buf) {
|
||||
if (file.writeError) SERIAL_ERROR_MSG(STR_SD_ERR_WRITE_TO_FILE);
|
||||
}
|
||||
|
||||
//
|
||||
// Run the next autostart file. Called:
|
||||
// - On boot after successful card init
|
||||
// - After finishing the previous autostart file
|
||||
// - From the LCD command to run the autostart file
|
||||
//
|
||||
#if DISABLED(NO_SD_AUTOSTART)
|
||||
/**
|
||||
* Run all the auto#.g files. Called:
|
||||
* - On boot after successful card init.
|
||||
* - From the LCD command to Run Auto Files
|
||||
*/
|
||||
void CardReader::autofile_begin() {
|
||||
autofile_index = 1;
|
||||
(void)autofile_check();
|
||||
}
|
||||
|
||||
void CardReader::checkautostart() {
|
||||
/**
|
||||
* Run the next auto#.g file. Called:
|
||||
* - On boot after successful card init
|
||||
* - After finishing the previous auto#.g file
|
||||
* - From the LCD command to begin the auto#.g files
|
||||
*
|
||||
* Return 'true' if there was nothing to do
|
||||
*/
|
||||
bool CardReader::autofile_check() {
|
||||
if (!autofile_index) return true;
|
||||
|
||||
if (autostart_index < 0 || flag.sdprinting) return;
|
||||
if (!isMounted())
|
||||
mount();
|
||||
else if (ENABLED(SDCARD_EEPROM_EMULATION))
|
||||
settings.first_load();
|
||||
|
||||
if (!isMounted()) mount();
|
||||
TERN_(SDCARD_EEPROM_EMULATION, else settings.first_load());
|
||||
|
||||
// Don't run auto#.g when a PLR file exists
|
||||
if (isMounted() && TERN1(POWER_LOSS_RECOVERY, !recovery.valid())) {
|
||||
char autoname[8];
|
||||
sprintf_P(autoname, PSTR("auto%c.g"), autostart_index + '0');
|
||||
dir_t p;
|
||||
root.rewind();
|
||||
while (root.readDir(&p, nullptr) > 0) {
|
||||
for (int8_t i = (int8_t)strlen((char*)p.name); i--;) p.name[i] = tolower(p.name[i]);
|
||||
if (p.name[9] != '~' && strncmp((char*)p.name, autoname, 5) == 0) {
|
||||
// Don't run auto#.g when a PLR file exists
|
||||
if (isMounted() && TERN1(POWER_LOSS_RECOVERY, !recovery.valid())) {
|
||||
char autoname[10];
|
||||
sprintf_P(autoname, PSTR("/auto%c.g"), '0' + autofile_index - 1);
|
||||
if (fileExists(autoname)) {
|
||||
cdroot();
|
||||
openAndPrintFile(autoname);
|
||||
autostart_index++;
|
||||
return;
|
||||
autofile_index++;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
autofile_cancel();
|
||||
return true;
|
||||
}
|
||||
autostart_index = -1;
|
||||
}
|
||||
|
||||
void CardReader::beginautostart() {
|
||||
autostart_index = 0;
|
||||
cdroot();
|
||||
}
|
||||
#endif
|
||||
|
||||
void CardReader::closefile(const bool store_location/*=false*/) {
|
||||
file.sync();
|
||||
@@ -1231,7 +1250,7 @@ void CardReader::fileHasFinished() {
|
||||
if (!isMounted()) return;
|
||||
if (recovery.file.isOpen()) return;
|
||||
if (!recovery.file.open(&root, recovery.filename, read ? O_READ : O_CREAT | O_WRITE | O_TRUNC | O_SYNC))
|
||||
SERIAL_ECHOLNPAIR(STR_SD_OPEN_FILE_FAIL, recovery.filename, ".");
|
||||
openFailed(recovery.filename);
|
||||
else if (!read)
|
||||
echo_write_to_file(recovery.filename);
|
||||
}
|
||||
|
||||
@@ -90,10 +90,12 @@ public:
|
||||
static void openLogFile(char * const path);
|
||||
static void write_command(char * const buf);
|
||||
|
||||
// Auto-Start files
|
||||
static int8_t autostart_index; // Index of autoX.g files
|
||||
static void beginautostart();
|
||||
static void checkautostart();
|
||||
#if DISABLED(NO_SD_AUTOSTART) // Auto-Start auto#.g file handling
|
||||
static uint8_t autofile_index; // Next auto#.g index to run, plus one. Ignored by autofile_check when zero.
|
||||
static void autofile_begin(); // Begin check. Called automatically after boot-up.
|
||||
static bool autofile_check(); // Check for the next auto-start file and run it.
|
||||
static inline void autofile_cancel() { autofile_index = 0; }
|
||||
#endif
|
||||
|
||||
// Basic file ops
|
||||
static void openFileRead(char * const path, const uint8_t subcall=0);
|
||||
|
||||
@@ -49,7 +49,7 @@ opt_set TEMP_SENSOR_4 1000
|
||||
opt_set TEMP_SENSOR_BED 1
|
||||
opt_enable AUTO_BED_LEVELING_UBL RESTORE_LEVELING_AFTER_G28 DEBUG_LEVELING_FEATURE G26_MESH_VALIDATION ENABLE_LEVELING_FADE_HEIGHT SKEW_CORRECTION \
|
||||
REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER LIGHTWEIGHT_UI STATUS_MESSAGE_SCROLLING BOOT_MARLIN_LOGO_SMALL \
|
||||
SDSUPPORT SDCARD_SORT_ALPHA USB_FLASH_DRIVE_SUPPORT SCROLL_LONG_FILENAMES CANCEL_OBJECTS \
|
||||
SDSUPPORT SDCARD_SORT_ALPHA USB_FLASH_DRIVE_SUPPORT SCROLL_LONG_FILENAMES CANCEL_OBJECTS NO_SD_AUTOSTART \
|
||||
EEPROM_SETTINGS EEPROM_CHITCHAT GCODE_MACROS CUSTOM_USER_MENUS \
|
||||
MULTI_NOZZLE_DUPLICATION CLASSIC_JERK LIN_ADVANCE QUICK_HOME \
|
||||
LCD_SET_PROGRESS_MANUALLY PRINT_PROGRESS_SHOW_DECIMALS SHOW_REMAINING_TIME \
|
||||
|
||||
+21
-1
@@ -203,7 +203,7 @@ extra_scripts =
|
||||
pre:buildroot/share/PlatformIO/scripts/common-dependencies.py
|
||||
pre:buildroot/share/PlatformIO/scripts/common-cxxflags.py
|
||||
post:buildroot/share/PlatformIO/scripts/common-dependencies-post.py
|
||||
build_flags = -fmax-errors=5 -g -D__MARLIN_FIRMWARE__ -fmerge-all-constants
|
||||
build_flags = -fmax-errors=5 -g -D__MARLIN_FIRMWARE__ -fmerge-constants
|
||||
lib_deps =
|
||||
|
||||
#
|
||||
@@ -1351,6 +1351,26 @@ extra_scripts = ${common.extra_scripts}
|
||||
buildroot/share/PlatformIO/scripts/stm32_bootloader.py
|
||||
buildroot/share/PlatformIO/scripts/mks_encrypt.py
|
||||
|
||||
#
|
||||
# MKS Robin Pro V2
|
||||
#
|
||||
[env:mks_robin_pro2]
|
||||
platform = ${common_stm32.platform}
|
||||
extends = common_stm32
|
||||
build_flags = ${common_stm32.build_flags} -DHAL_HCD_MODULE_ENABLED -DUSBHOST -DARDUINO_BLACK_F407VE
|
||||
board = genericSTM32F407VET6
|
||||
board_build.core = stm32
|
||||
board_build.variant = MARLIN_F407VE
|
||||
board_build.ldscript = ldscript.ld
|
||||
board_build.firmware = Robin_nano35.bin
|
||||
build_unflags = ${common_stm32.build_unflags} -DUSBCON -DUSBD_USE_CDC
|
||||
debug_tool = jlink
|
||||
upload_protocol = jlink
|
||||
extra_scripts = ${common.extra_scripts}
|
||||
pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py
|
||||
buildroot/share/PlatformIO/scripts/stm32_bootloader.py
|
||||
buildroot/share/PlatformIO/scripts/mks_encrypt.py
|
||||
|
||||
#################################
|
||||
# #
|
||||
# Other Architectures #
|
||||
|
||||
Reference in New Issue
Block a user