Skip to content

Commit

Permalink
Add LULZBOT_TOUCH_UI (MarlinFirmware#14967)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcio-ao authored and thinkyhead committed Aug 16, 2019
1 parent 179d6c4 commit 274934a
Show file tree
Hide file tree
Showing 356 changed files with 22,195 additions and 58 deletions.
6 changes: 6 additions & 0 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -2033,6 +2033,12 @@
//
//#define MALYAN_LCD

//
// LulzBot Color Touch UI for FTDI EVE (FT800/FT810) displays
// See Configuration_adv.h for all configuration options.
//
//#defined LULZBOT_TOUCH_UI

//
// Third-party or vendor-customized controller interfaces.
// Sources should be installed in 'src/lcd/extensible_ui'.
Expand Down
47 changes: 47 additions & 0 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1143,6 +1143,53 @@

#endif // HAS_GRAPHICAL_LCD

//
// Lulzbot Touch UI
//
#if ENABLED(LULZBOT_TOUCH_UI)
// Display board used
//#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240)
//#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272)
//#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272)
//#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480)
//#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI

// Correct the resolution if not using the stock TFT panel.
//#define TOUCH_UI_320x240
//#define TOUCH_UI_480x272
//#define TOUCH_UI_800x480

// Mappings for boards with a standard RepRapDiscount Display connector
//#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping
//#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping
//#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping
//#define OTHER_PIN_LAYOUT // Define pins manually below
#if ENABLED(OTHER_PIN_LAYOUT)
// The pins for CS and MOD_RESET (PD) must be chosen.
#define CLCD_MOD_RESET 9
#define CLCD_SPI_CS 10

// If using software SPI, specify pins for SCLK, MOSI, MISO
//#define CLCD_USE_SOFT_SPI
#if ENABLED(CLCD_USE_SOFT_SPI)
#define CLCD_SOFT_SPI_MOSI 11
#define CLCD_SOFT_SPI_MISO 12
#define CLCD_SOFT_SPI_SCLK 13
#endif
#endif

// Display Orientation. An inverted (i.e. upside-down) display
// is supported on the FT800. The FT810 and beyond also support
// portrait and mirrored orientations.
//#define TOUCH_UI_INVERTED
//#define TOUCH_UI_PORTRAIT
//#define TOUCH_UI_MIRRORED

// Use a numeric passcode for "Screen lock" keypad.
// (recommended for smaller displays)
//#define TOUCH_UI_PASSCODE
#endif

// @section safety

/**
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/HAL_DUE/fastio_Due.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
const uint32_t mask = MASK(DIO ## IO ## _PIN); \
if (V) port->PIO_SODR = mask; \
else port->PIO_CODR = mask; \
} while(0)
}while(0)

// Toggle a pin
#define _TOGGLE(IO) _WRITE(IO, !READ(IO))
Expand Down
12 changes: 6 additions & 6 deletions Marlin/src/HAL/HAL_DUE/usb/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
* \def unused
* \brief Marking \a v as a unused parameter or value.
*/
#define unused(v) do { (void)(v); } while(0)
#define unused(v) do { (void)(v); }while(0)

/**
* \def barrier
Expand Down Expand Up @@ -169,7 +169,7 @@
* heuristics and inline the function no matter how big it thinks it
* becomes.
*/
#if defined(__CC_ARM)
#ifdef __CC_ARM
# define __always_inline __forceinline
#elif (defined __GNUC__)
#ifdef __always_inline
Expand All @@ -187,7 +187,7 @@
* This annotation instructs the compiler to ignore its inlining
* heuristics and not inline the function.
*/
#if defined(__CC_ARM)
#ifdef __CC_ARM
# define __no_inline __attribute__((noinline))
#elif (defined __GNUC__)
# define __no_inline __attribute__((__noinline__))
Expand All @@ -204,7 +204,7 @@
*
* \param expr Expression to evaluate and supposed to be nonzero.
*/
#if defined(_ASSERT_ENABLE_)
#ifdef _ASSERT_ENABLE_
# if defined(TEST_SUITE_DEFINE_ASSERT_MACRO)
// Assert() is defined in unit_test/suite.h
# include "unit_test/suite.h"
Expand Down Expand Up @@ -998,14 +998,14 @@ typedef U8 Byte; //!< 8-bit unsigned integer.
#endif // #ifndef __ASSEMBLY__


#if defined(__ICCARM__)
#ifdef __ICCARM__
#define SHORTENUM __packed
#elif defined(__GNUC__)
#define SHORTENUM __attribute__((packed))
#endif

/* No operation */
#if defined(__ICCARM__)
#ifdef __ICCARM__
#define nop() __no_operation()
#elif defined(__GNUC__)
#define nop() (__NOP())
Expand Down
8 changes: 4 additions & 4 deletions Marlin/src/HAL/HAL_LINUX/include/serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,10 @@ class HalSerial {
void print_bin(uint32_t value, uint8_t num_digits) {
uint32_t mask = 1 << (num_digits -1);
for (uint8_t i = 0; i < num_digits; i++) {
if (!(i % 4) && i) write(' ');
if (!(i % 16) && i) write(' ');
if (value & mask) write('1');
else write('0');
if (!(i % 4) && i) write(' ');
if (!(i % 16) && i) write(' ');
if (value & mask) write('1');
else write('0');
value <<= 1;
}
}
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/HAL/HAL_SAMD51/Servo_SAMD51.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,12 @@ HAL_SERVO_TIMER_ISR() {
tc->COUNT16.CC[tcChannel].reg = (uint16_t)(tcCounterValue - 4UL); // at least REFRESH_INTERVAL has elapsed
}
if (tcChannel == 0) {
SYNC(tc->COUNT16.SYNCBUSY.bit.CC0);
SYNC(tc->COUNT16.SYNCBUSY.bit.CC0);
// Clear the interrupt
tc->COUNT16.INTFLAG.reg = TC_INTFLAG_MC0;
}
else {
SYNC(tc->COUNT16.SYNCBUSY.bit.CC1);
SYNC(tc->COUNT16.SYNCBUSY.bit.CC1);
// Clear the interrupt
tc->COUNT16.INTFLAG.reg = TC_INTFLAG_MC1;
}
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/HAL_STM32/fastio_STM32.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void FastIO_init(); // Must be called before using fast io macros
#define _WRITE(IO, V) do { \
if (V) FastIOPortMap[STM_PORT(digitalPin[IO])]->BSRR = _BV32(STM_PIN(digitalPin[IO])) ; \
else FastIOPortMap[STM_PORT(digitalPin[IO])]->BRR = _BV32(STM_PIN(digitalPin[IO])) ; \
} while(0)
}while(0)
#else
#define _WRITE(IO, V) (FastIOPortMap[STM_PORT(digitalPin[IO])]->BSRR = _BV32(STM_PIN(digitalPin[IO]) + (V ? 0 : 16)))
#endif
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/HAL/HAL_STM32F1/fastio_STM32F1.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
#define _SET_OUTPUT(IO) _SET_MODE(IO, GPIO_OUTPUT_PP)
#define _SET_OUTPUT_OD(IO) _SET_MODE(IO, GPIO_OUTPUT_OD)

#define OUT_WRITE(IO,V) do{ _SET_OUTPUT(IO); WRITE(IO,V); } while(0)
#define OUT_WRITE_OD(IO,V) do{ _SET_OUTPUT_OD(IO); WRITE(IO,V); } while(0)
#define OUT_WRITE(IO,V) do{ _SET_OUTPUT(IO); WRITE(IO,V); }while(0)
#define OUT_WRITE_OD(IO,V) do{ _SET_OUTPUT_OD(IO); WRITE(IO,V); }while(0)

#define SET_INPUT(IO) _SET_MODE(IO, GPIO_INPUT_FLOATING)
#define SET_INPUT_PULLUP(IO) _SET_MODE(IO, GPIO_INPUT_PU)
Expand Down
12 changes: 6 additions & 6 deletions Marlin/src/core/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,24 +118,24 @@
// Using GCC extensions, but Travis GCC version does not like it and gives
// "error: statement-expressions are not allowed outside functions nor in template-argument lists"
#define NOLESS(v, n) \
do { \
do{ \
__typeof__(n) _n = (n); \
if (v < _n) v = _n; \
} while(0)
}while(0)

#define NOMORE(v, n) \
do { \
do{ \
__typeof__(n) _n = (n); \
if (v > _n) v = _n; \
} while(0)
}while(0)

#define LIMIT(v, n1, n2) \
do { \
do{ \
__typeof__(n1) _n1 = (n1); \
__typeof__(n2) _n2 = (n2); \
if (v < _n1) v = _n1; \
else if (v > _n2) v = _n2; \
} while(0)
}while(0)

#endif

Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/core/serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,5 +184,5 @@ void print_bin(const uint16_t val);

void print_xyz(PGM_P const prefix, PGM_P const suffix, const float x, const float y, const float z);
void print_xyz(PGM_P const prefix, PGM_P const suffix, const float xyz[]);
#define SERIAL_POS(SUFFIX,VAR) do { print_xyz(PSTR(" " STRINGIFY(VAR) "="), PSTR(" : " SUFFIX "\n"), VAR); } while(0)
#define SERIAL_XYZ(PREFIX,V...) do { print_xyz(PSTR(PREFIX), nullptr, V); } while(0)
#define SERIAL_POS(SUFFIX,VAR) do { print_xyz(PSTR(" " STRINGIFY(VAR) "="), PSTR(" : " SUFFIX "\n"), VAR); }while(0)
#define SERIAL_XYZ(PREFIX,V...) do { print_xyz(PSTR(PREFIX), nullptr, V); }while(0)
2 changes: 1 addition & 1 deletion Marlin/src/feature/leds/leds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ void LEDLights::set_color(const LEDColor &incol
// If the pins can do PWM then their intensity will be set.
#define UPDATE_RGBW(C,c) do { if (PWM_PIN(RGB_LED_##C##_PIN)) \
analogWrite(pin_t(RGB_LED_##C##_PIN), incol.c); \
else WRITE(RGB_LED_##C##_PIN, incol.c ? HIGH : LOW); } while(0)
else WRITE(RGB_LED_##C##_PIN, incol.c ? HIGH : LOW); }while(0)
UPDATE_RGBW(R,r);
UPDATE_RGBW(G,g);
UPDATE_RGBW(B,b);
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/calibrate/G33.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ void GcodeSuite::G33() {
_tower_results = (_4p_calibration && towers_set) || probe_points >= 3,
_opposite_results = (_4p_calibration && !towers_set) || probe_points >= 3,
_endstop_results = probe_points != 1 && probe_points != -1 && probe_points != 0,
_angle_results = probe_points >= 3 && towers_set;
_angle_results = probe_points >= 3 && towers_set;
static const char save_message[] PROGMEM = "Save with M500 and/or copy to Configuration.h";
int8_t iterations = 0;
float test_precision,
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/calibrate/G34_M422.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ void GcodeSuite::G34() {
// Home Z after the alignment procedure
process_subcommands_now_P(PSTR("G28 Z"));

} while(0);
}while(0);

if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("<<< G34");
}
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/inc/Conditionals_LCD.h
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@
#endif

// Extensible UI serial touch screens. (See src/lcd/extensible_ui)
#if EITHER(MALYAN_LCD, DGUS_LCD)
#if ANY(MALYAN_LCD, DGUS_LCD, LULZBOT_TOUCH_UI)
#define IS_EXTUI
#define EXTENSIBLE_UI
#endif
Expand Down
3 changes: 3 additions & 0 deletions Marlin/src/inc/Conditionals_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,6 @@
#define LED_USER_PRESET_BRIGHTNESS 255
#endif
#endif

// Extensible UI pin mapping for RepRapDiscount
#define TOUCH_UI_ULTIPANEL ENABLED(LULZBOT_TOUCH_UI) && ANY(AO_EXP1_PINMAP, AO_EXP2_PINMAP, CR10_TFT_PINMAP)
1 change: 1 addition & 0 deletions Marlin/src/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -1892,6 +1892,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
+ ENABLED(OVERLORD_OLED) \
+ ENABLED(DGUS_LCD) \
+ ENABLED(MALYAN_LCD) \
+ ENABLED(LULZBOT_TOUCH_UI) \
+ ENABLED(FSMC_GRAPHICAL_TFT)
#error "Please select no more than one LCD controller option."
#endif
Expand Down
Loading

0 comments on commit 274934a

Please sign in to comment.