Misc patches preceding DGUS PR

This commit is contained in:
Scott Lahteine 2020-01-02 17:59:06 -06:00
parent c75b560604
commit 5b75a018b7
23 changed files with 100 additions and 103 deletions

View file

@ -91,19 +91,19 @@ typedef int8_t pin_t;
#define NUM_SERIAL 1
#else
#if !WITHIN(SERIAL_PORT, -1, 3)
#error "SERIAL_PORT must be from -1 to 3"
#error "SERIAL_PORT must be from -1 to 3. Please update your configuration."
#endif
#define MYSERIAL0 customizedSerial1
#ifdef SERIAL_PORT_2
#if !WITHIN(SERIAL_PORT_2, -1, 3)
#error "SERIAL_PORT_2 must be from -1 to 3"
#error "SERIAL_PORT_2 must be from -1 to 3. Please update your configuration."
#elif SERIAL_PORT_2 == SERIAL_PORT
#error "SERIAL_PORT_2 must be different than SERIAL_PORT"
#error "SERIAL_PORT_2 must be different than SERIAL_PORT. Please update your configuration."
#endif
#define NUM_SERIAL 2
#define MYSERIAL1 customizedSerial2
#define NUM_SERIAL 2
#else
#define NUM_SERIAL 1
#endif

View file

@ -56,8 +56,7 @@
#ifdef SERIAL_PORT_2
#if SERIAL_PORT_2 == SERIAL_PORT
#error "SERIAL_PORT_2 must be different from SERIAL_PORT. Please update your configuration."
#endif
#if SERIAL_PORT_2 == -1
#elif SERIAL_PORT_2 == -1
#define MYSERIAL1 customizedSerial2
#elif SERIAL_PORT_2 == 0
#define MYSERIAL1 Serial

View file

@ -48,8 +48,8 @@ extern portMUX_TYPE spinlock;
#define MYSERIAL0 flushableSerial
#if ENABLED(WIFISUPPORT)
#define NUM_SERIAL 2
#define MYSERIAL1 webSocketSerial
#define NUM_SERIAL 2
#else
#define NUM_SERIAL 1
#endif

View file

@ -61,10 +61,6 @@ extern "C" volatile uint32_t _millis;
#define ST7920_DELAY_3 DELAY_NS(750)
#endif
#if !WITHIN(SERIAL_PORT, -1, 3)
#error "SERIAL_PORT must be from -1 to 3"
#endif
#if SERIAL_PORT == -1
#define MYSERIAL0 UsbSerial
#elif SERIAL_PORT == 0
@ -75,16 +71,14 @@ extern "C" volatile uint32_t _millis;
#define MYSERIAL0 MSerial2
#elif SERIAL_PORT == 3
#define MYSERIAL0 MSerial3
#else
#error "SERIAL_PORT must be from -1 to 3. Please update your configuration."
#endif
#ifdef SERIAL_PORT_2
#if !WITHIN(SERIAL_PORT_2, -1, 3)
#error "SERIAL_PORT_2 must be from -1 to 3"
#elif SERIAL_PORT_2 == SERIAL_PORT
#error "SERIAL_PORT_2 must be different than SERIAL_PORT"
#endif
#define NUM_SERIAL 2
#if SERIAL_PORT_2 == -1
#if SERIAL_PORT_2 == SERIAL_PORT
#error "SERIAL_PORT_2 must be different than SERIAL_PORT. Please update your configuration."
#elif SERIAL_PORT_2 == -1
#define MYSERIAL1 UsbSerial
#elif SERIAL_PORT_2 == 0
#define MYSERIAL1 MSerial
@ -94,7 +88,10 @@ extern "C" volatile uint32_t _millis;
#define MYSERIAL1 MSerial2
#elif SERIAL_PORT_2 == 3
#define MYSERIAL1 MSerial3
#else
#error "SERIAL_PORT_2 must be from -1 to 3. Please update your configuration."
#endif
#define NUM_SERIAL 2
#else
#define NUM_SERIAL 1
#endif

View file

@ -33,11 +33,9 @@
#include "MarlinSerial_AGCM4.h"
// Serial ports
#if !WITHIN(SERIAL_PORT, -1, 3)
#error "SERIAL_PORT must be from -1 to 3"
#endif
// MYSERIAL0 required before MarlinSerial includes!
#if SERIAL_PORT == -1
#define MYSERIAL0 Serial
#elif SERIAL_PORT == 0
@ -46,18 +44,16 @@
#define MYSERIAL0 Serial2
#elif SERIAL_PORT == 2
#define MYSERIAL0 Serial3
#else
#elif SERIAL_PORT == 3
#define MYSERIAL0 Serial4
#else
#error "SERIAL_PORT must be from -1 to 3. Please update your configuration."
#endif
#ifdef SERIAL_PORT_2
#if !WITHIN(SERIAL_PORT_2, -1, 3)
#error "SERIAL_PORT_2 must be from -1 to 3"
#elif SERIAL_PORT_2 == SERIAL_PORT
#error "SERIAL_PORT_2 must be different than SERIAL_PORT"
#endif
#define NUM_SERIAL 2
#if SERIAL_PORT_2 == -1
#if SERIAL_PORT_2 == SERIAL_PORT
#error "SERIAL_PORT_2 must be different than SERIAL_PORT. Please update your configuration."
#elif SERIAL_PORT_2 == -1
#define MYSERIAL1 Serial
#elif SERIAL_PORT_2 == 0
#define MYSERIAL1 Serial1
@ -65,9 +61,12 @@
#define MYSERIAL1 Serial2
#elif SERIAL_PORT_2 == 2
#define MYSERIAL1 Serial3
#else
#elif SERIAL_PORT_2 == 3
#define MYSERIAL1 Serial4
#else
#error "SERIAL_PORT_2 must be from -1 to 3. Please update your configuration."
#endif
#define NUM_SERIAL 2
#else
#define NUM_SERIAL 1
#endif

View file

@ -44,13 +44,8 @@
// ------------------------
#if SERIAL_PORT == 0
#error "Serial port 0 does not exist"
#endif
#if !WITHIN(SERIAL_PORT, -1, 6)
#error "SERIAL_PORT must be from -1 to 6"
#endif
#if SERIAL_PORT == -1
#error "SERIAL_PORT cannot be 0. (Port 0 does not exist.) Please update your configuration."
#elif SERIAL_PORT == -1
#define MYSERIAL0 SerialUSB
#elif SERIAL_PORT == 1
#define MYSERIAL0 Serial1
@ -64,20 +59,17 @@
#define MYSERIAL0 Serial5
#elif SERIAL_PORT == 6
#define MYSERIAL0 Serial6
#else
#error "SERIAL_PORT must be from -1 to 6. Please update your configuration."
#endif
#ifdef SERIAL_PORT_2
#if SERIAL_PORT_2 == 0
#error "Serial port 0 does not exist"
#endif
#if !WITHIN(SERIAL_PORT_2, -1, 6)
#error "SERIAL_PORT_2 must be from -1 to 6"
#elif SERIAL_PORT_2 == SERIAL_PORT
#error "SERIAL_PORT_2 must be different than SERIAL_PORT"
#endif
#define NUM_SERIAL 2
#if SERIAL_PORT_2 == -1
#if SERIAL_PORT_2 == 0
#error "SERIAL_PORT_2 cannot be 0. (Port 0 does not exist.) Please update your configuration."
#elif SERIAL_PORT_2 == SERIAL_PORT
#error "SERIAL_PORT_2 must be different than SERIAL_PORT. Please update your configuration."
#elif SERIAL_PORT_2 == -1
#define MYSERIAL1 SerialUSB
#elif SERIAL_PORT_2 == 1
#define MYSERIAL1 Serial1
@ -91,6 +83,8 @@
#define MYSERIAL1 Serial5
#elif SERIAL_PORT_2 == 6
#define MYSERIAL1 Serial6
#else
#error "SERIAL_PORT_2 must be from -1 to 6. Please update your configuration."
#endif
#else
#define NUM_SERIAL 1

View file

@ -78,13 +78,10 @@
#define MSerial5 Serial4
#endif
#if !WITHIN(SERIAL_PORT, -1, 5)
#error "SERIAL_PORT must be from -1 to 5"
#endif
#if SERIAL_PORT == -1
#if SERIAL_PORT == 0
#error "SERIAL_PORT cannot be 0. (Port 0 does not exist.) Please update your configuration."
#elif SERIAL_PORT == -1
#define MYSERIAL0 UsbSerial
#elif SERIAL_PORT == 0
#error "Serial port 0 does not exist"
#elif SERIAL_PORT == 1
#define MYSERIAL0 MSerial1
#elif SERIAL_PORT == 2
@ -95,19 +92,17 @@
#define MYSERIAL0 MSerial4
#elif SERIAL_PORT == 5
#define MYSERIAL0 MSerial5
#else
#error "SERIAL_PORT must be from -1 to 5. Please update your configuration."
#endif
#ifdef SERIAL_PORT_2
#if !WITHIN(SERIAL_PORT_2, -1, 5)
#error "SERIAL_PORT_2 must be from -1 to 5"
#if SERIAL_PORT_2 == 0
#error "SERIAL_PORT_2 cannot be 0. (Port 0 does not exist.) Please update your configuration."
#elif SERIAL_PORT_2 == SERIAL_PORT
#error "SERIAL_PORT_2 must be different than SERIAL_PORT"
#endif
#define NUM_SERIAL 2
#if SERIAL_PORT_2 == -1
#error "SERIAL_PORT_2 must be different than SERIAL_PORT. Please update your configuration."
#elif SERIAL_PORT_2 == -1
#define MYSERIAL1 UsbSerial
#elif SERIAL_PORT_2 == 0
#error "Serial port 0 does not exist"
#elif SERIAL_PORT_2 == 1
#define MYSERIAL1 MSerial1
#elif SERIAL_PORT_2 == 2
@ -118,7 +113,10 @@
#define MYSERIAL1 MSerial4
#elif SERIAL_PORT_2 == 5
#define MYSERIAL1 MSerial5
#else
#error "SERIAL_PORT_2 must be from -1 to 5. Please update your configuration."
#endif
#define NUM_SERIAL 2
#else
#define NUM_SERIAL 1
#endif

View file

@ -44,17 +44,12 @@
// Defines
// ------------------------
//Serial override
// Serial override
//extern HalSerial usb_serial;
#if defined(STM32F4) && SERIAL_PORT == 0
#error "Serial port 0 does not exist"
#endif
#if !WITHIN(SERIAL_PORT, -1, 6)
#error "SERIAL_PORT must be from -1 to 6"
#endif
#if SERIAL_PORT == -1
#error "SERIAL_PORT cannot be 0. (Port 0 does not exist.) Please update your configuration."
#elif SERIAL_PORT == -1
#define MYSERIAL0 SerialUSB
#elif SERIAL_PORT == 1
#define MYSERIAL0 SerialUART1
@ -68,19 +63,16 @@
#define MYSERIAL0 SerialUART5
#elif SERIAL_PORT == 6
#define MYSERIAL0 SerialUART6
#else
#error "SERIAL_PORT must be from -1 to 6. Please update your configuration."
#endif
#ifdef SERIAL_PORT_2
#if defined(STM32F4) && SERIAL_PORT_2 == 0
#error "Serial port 0 does not exist"
#endif
#if !WITHIN(SERIAL_PORT_2, -1, 6)
#error "SERIAL_PORT_2 must be from -1 to 6"
#error "SERIAL_PORT_2 cannot be 0. (Port 0 does not exist.) Please update your configuration."
#elif SERIAL_PORT_2 == SERIAL_PORT
#error "SERIAL_PORT_2 must be different than SERIAL_PORT"
#endif
#define NUM_SERIAL 2
#if SERIAL_PORT_2 == -1
#error "SERIAL_PORT_2 must be different than SERIAL_PORT. Please update your configuration."
#elif SERIAL_PORT_2 == -1
#define MYSERIAL1 SerialUSB
#elif SERIAL_PORT_2 == 1
#define MYSERIAL1 SerialUART1
@ -94,7 +86,10 @@
#define MYSERIAL1 SerialUART5
#elif SERIAL_PORT_2 == 6
#define MYSERIAL1 SerialUART6
#else
#error "SERIAL_PORT_2 must be from -1 to 6. Please update your configuration."
#endif
#define NUM_SERIAL 2
#else
#define NUM_SERIAL 1
#endif

View file

@ -164,7 +164,7 @@ typedef struct {
* link register (i.e. not a normal register) and the stack pointer value
* supplied.
*
* -If the program was compiled with -funwind-tables , it will use them to
* -If the program was compiled with -funwind-tables it will use them to
* perform the traceback. Otherwise, brute force will be employed
* -If the program was compiled with -mpoke-function-name, then you will
* get function names in the traceback. Otherwise, you will not.

View file

@ -912,7 +912,7 @@ void ST7920_Lite_Status_Screen::on_exit() {
ncs();
}
// This is called prior to the KILL screen to
// Called prior to the KILL screen to
// clear the screen, preventing a garbled display.
void ST7920_Lite_Status_Screen::clear_text_buffer() {
cs();

View file

@ -74,7 +74,7 @@ static const uint8_t u8g_dev_st7920_128x64_HAL_init_seq[] PROGMEM = {
0x038, // 8 Bit interface (DL=1), basic instruction set (RE=0)
0x00C, // display on, cursor & blink off; 0x08: all off
0x006, // Entry mode: Cursor move to right ,DDRAM address counter (AC) plus 1, no shift
0x006, // Entry mode: Cursor move to right, DDRAM address counter (AC) plus 1, no shift
0x002, // disable scroll, enable CGRAM adress
0x001, // clear RAM, needs 1.6 ms
U8G_ESC_DLY(100), // delay 100 ms

View file

@ -179,5 +179,5 @@
#else
#error Unknown or no TOUCH_UI_FTDI_EVE board specified. To add a new board, modify "ftdi_eve_boards.h"
#error "Unknown or no TOUCH_UI_FTDI_EVE board specified. To add a new board, modify 'ftdi_eve_boards.h'."
#endif

View file

@ -1179,7 +1179,7 @@ void CLCD::default_display_orientation() {
#endif
}
#elif ANY(TOUCH_UI_PORTRAIT, TOUCH_UI_MIRRORED)
#error PORTRAIT or MIRRORED orientation not supported on the FT800
#error "PORTRAIT or MIRRORED orientation not supported on the FT800."
#elif ENABLED(TOUCH_UI_INVERTED)
mem_write_32(REG::ROTATE, 1);
#endif

View file

@ -124,5 +124,5 @@
}
#else
#error Unknown or no TOUCH_UI_FTDI_EVE display resolution specified. To add a display resolution, modify "ftdi_eve_resolutions.h"
#error "Unknown or no TOUCH_UI_FTDI_EVE display resolution specified. To add a display resolution, modify 'ftdi_eve_resolutions.h'."
#endif

View file

@ -210,7 +210,9 @@
#define ENABLED(b) _CAT(SWITCH_ENABLED_, b)
#define DISABLED(b) !ENABLED(b)
#define ANY(A,B) (ENABLED(A) || ENABLED(B))
#define EITHER(A,B) (ENABLED(A) || ENABLED(B))
#define BOTH(A,B) (ENABLED(A) && ENABLED(B))
#define NONE(A,B) (DISABLED(A) && DISABLED(B))
// Remove compiler warning on an unused variable
#ifndef UNUSED

View file

@ -29,7 +29,7 @@
#ifdef CR10_TFT_PINMAP
#ifndef __MARLIN_FIRMWARE__
#error This pin mapping requires Marlin.
#error "This pin mapping requires Marlin."
#endif
#define CLCD_USE_SOFT_SPI
@ -49,7 +49,7 @@
#ifdef AO_EXP1_DEPRECATED_PINMAP
#ifndef __MARLIN_FIRMWARE__
#error This pin mapping requires Marlin.
#error "This pin mapping requires Marlin."
#endif
#define CLCD_MOD_RESET LCD_PINS_D4
@ -89,7 +89,7 @@
#ifdef AO_EXP1_PINMAP
#ifndef __MARLIN_FIRMWARE__
#error This pin mapping requires Marlin.
#error "This pin mapping requires Marlin."
#endif
#define CLCD_MOD_RESET LCD_PINS_ENABLE
@ -134,7 +134,7 @@
#ifdef AO_EXP2_PINMAP
#ifndef __MARLIN_FIRMWARE__
#error This pin mapping requires Marlin.
#error "This pin mapping requires Marlin."
#endif
#define CLCD_SPI_CS BTN_EN1

View file

@ -55,7 +55,7 @@ void MainMenu::onRedraw(draw_mode_t what) {
.tag(5).button( BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_DISABLE_STEPPERS))
.tag(6).button( BTN_POS(1,3), BTN_SIZE(2,1), GET_TEXT_F(MSG_TEMPERATURE))
.enabled(
#if DISABLED(TOUCH_UI_LULZBOT_BIO) && DISABLED(TOUCH_UI_COCOA_PRESS)
#if NONE(TOUCH_UI_LULZBOT_BIO, TOUCH_UI_COCOA_PRESS)
1
#endif
)

View file

@ -232,7 +232,7 @@ class SpinnerDialogBox : public DialogBoxBaseClass, public CachedScreen<SPINNER_
static void enqueueAndWait_P(const progmem_str message, const progmem_str commands);
};
#if DISABLED(TOUCH_UI_LULZBOT_BIO) && DISABLED(TOUCH_UI_COCOA_PRESS)
#if NONE(TOUCH_UI_LULZBOT_BIO, TOUCH_UI_COCOA_PRESS)
class StatusScreen : public BaseScreen, public CachedScreen<STATUS_SCREEN_CACHE,STATUS_SCREEN_DL_SIZE> {
private:
static void draw_axis_position(draw_mode_t);

View file

@ -22,7 +22,7 @@
#include "../config.h"
#if ENABLED(TOUCH_UI_FTDI_EVE) && DISABLED(TOUCH_UI_LULZBOT_BIO) && DISABLED(TOUCH_UI_COCOA_PRESS)
#if ENABLED(TOUCH_UI_FTDI_EVE) && NONE(TOUCH_UI_LULZBOT_BIO, TOUCH_UI_COCOA_PRESS)
#include "screens.h"
#include "screen_data.h"

View file

@ -75,7 +75,7 @@ namespace Theme {
constexpr uint32_t gray_color_5 = hsl_to_rgb(accent_hue, gray_sat, 0.78);
constexpr uint32_t gray_color_6 = hsl_to_rgb(accent_hue, gray_sat, 0.91); // Lightest
#if DISABLED(TOUCH_UI_LULZBOT_BIO) && DISABLED(TOUCH_UI_COCOA_PRESS)
#if NONE(TOUCH_UI_LULZBOT_BIO, TOUCH_UI_COCOA_PRESS)
// Lulzbot TAZ Pro
constexpr uint32_t theme_darkest = gray_color_1;
constexpr uint32_t theme_dark = gray_color_2;

View file

@ -34,6 +34,8 @@
#include "extensible_ui/lib/dgus/DGUSDisplay.h"
#include "extensible_ui/lib/dgus/DGUSDisplayDefinition.h"
extern const char NUL_STR[];
namespace ExtUI {
void onStartup() {
@ -44,15 +46,26 @@ namespace ExtUI {
void onIdle() { ScreenHandler.loop(); }
void onPrinterKilled(PGM_P error, PGM_P component) {
extern const char NUL_STR[];
ScreenHandler.sendinfoscreen(GET_TEXT(MSG_HALTED), error, NUL_STR, GET_TEXT(MSG_PLEASE_RESET), true, true, true, true);
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_KILL);
while (!ScreenHandler.loop()); // Wait while anything is left to be sent
}
void onMediaInserted() { ScreenHandler.SDCardInserted(); }
void onMediaError() { ScreenHandler.SDCardError(); }
void onMediaRemoved() { ScreenHandler.SDCardRemoved(); }
void onMediaInserted() {
#if ENABLED(SDSUPPORT)
ScreenHandler.SDCardInserted();
#endif
}
void onMediaError() {
#if ENABLED(SDSUPPORT)
ScreenHandler.SDCardError();
#endif
}
void onMediaRemoved() {
#if ENABLED(SDSUPPORT)
ScreenHandler.SDCardRemoved();
#endif
}
void onPlayTone(const uint16_t frequency, const uint16_t duration) {}
void onPrintTimerStarted() {}

View file

@ -60,7 +60,7 @@ namespace ExtUI {
void onFactoryReset() {}
void onStoreSettings(char *buff) {
// This is called when saving to EEPROM (i.e. M500). If the ExtUI needs
// 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
// into buff.
@ -70,7 +70,7 @@ namespace ExtUI {
}
void onLoadSettings(const char *buff) {
// This is called while loading settings from EEPROM. If the ExtUI
// Called while loading settings from EEPROM. If the ExtUI
// needs to retrieve data, it should copy up to eeprom_data_size bytes
// from buff
@ -80,17 +80,17 @@ namespace ExtUI {
}
void onConfigurationStoreWritten(bool success) {
// This is called after the entire EEPROM has been written,
// Called after the entire EEPROM has been written,
// whether successful or not.
}
void onConfigurationStoreRead(bool success) {
// This is called after the entire EEPROM has been read,
// Called after the entire EEPROM has been read,
// whether successful or not.
}
void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval) {
// This is called when any mesh points are updated
// Called when any mesh points are updated
}
}

View file

@ -117,7 +117,7 @@ Extruder 2 -
;START G-CODE;
M104 T0 S{material_print_temperature, 0}
M104 T1 S{material_print_temperature , 1}
M104 T1 S{material_print_temperature, 1}
M140 S{material_bed_temperature}
G28
;purge right
@ -136,9 +136,9 @@ G92 E0
;purge left
T1
;M104 T0 S{material_standby_temperature, 0}
M104 T1 S{material_print_temperature ,1}
M104 T1 S{material_print_temperature, 1}
G1 X-110 Y-70 Z30 F4800
M109 T1 S{material_print_temperature , 1}
M109 T1 S{material_print_temperature, 1}
G92 E0
G1 Z0.4 F1800
G1 X-67 Y-70 E25 F300 ; purge nozzle