From eae543adf34268505f9321b7576495db20293c09 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 29 Jul 2019 18:45:01 -0500 Subject: [PATCH] Apply HAS_SPI_LCD as needed --- Marlin/src/gcode/bedlevel/G26.cpp | 8 ++++---- Marlin/src/lcd/fontutils.cpp | 2 +- Marlin/src/module/endstops.cpp | 4 ++-- Marlin/src/module/planner.cpp | 8 ++++---- Marlin/src/module/planner.h | 8 ++++---- Marlin/src/pins/ramps/pins_TT_OSCAR.h | 2 +- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Marlin/src/gcode/bedlevel/G26.cpp b/Marlin/src/gcode/bedlevel/G26.cpp index b95fe8d165..3b44a29301 100644 --- a/Marlin/src/gcode/bedlevel/G26.cpp +++ b/Marlin/src/gcode/bedlevel/G26.cpp @@ -385,7 +385,7 @@ inline bool turn_on_heaters() { #if HAS_HEATED_BED if (g26_bed_temp > 25) { - #if ENABLED(ULTRA_LCD) + #if HAS_SPI_LCD ui.set_status_P(PSTR("G26 Heating Bed."), 99); ui.quick_feedback(); #if HAS_LCD_MENU @@ -406,7 +406,7 @@ inline bool turn_on_heaters() { #endif // HAS_HEATED_BED // Start heating the active nozzle - #if ENABLED(ULTRA_LCD) + #if HAS_SPI_LCD ui.set_status_P(PSTR("G26 Heating Nozzle."), 99); ui.quick_feedback(); #endif @@ -420,7 +420,7 @@ inline bool turn_on_heaters() { ) ) return G26_ERR; - #if ENABLED(ULTRA_LCD) + #if HAS_SPI_LCD ui.reset_status(); ui.quick_feedback(); #endif @@ -472,7 +472,7 @@ inline bool prime_nozzle() { else #endif { - #if ENABLED(ULTRA_LCD) + #if HAS_SPI_LCD ui.set_status_P(PSTR("Fixed Length Prime."), 99); ui.quick_feedback(); #endif diff --git a/Marlin/src/lcd/fontutils.cpp b/Marlin/src/lcd/fontutils.cpp index 4e714d0804..fdccd082c3 100644 --- a/Marlin/src/lcd/fontutils.cpp +++ b/Marlin/src/lcd/fontutils.cpp @@ -9,7 +9,7 @@ #include "../inc/MarlinConfig.h" -#if ENABLED(ULTRA_LCD) +#if HAS_SPI_LCD #include "ultralcd.h" #include "../Marlin.h" #endif diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index abc93e9f1d..9aaab38dd2 100644 --- a/Marlin/src/module/endstops.cpp +++ b/Marlin/src/module/endstops.cpp @@ -330,7 +330,7 @@ void Endstops::resync() { void Endstops::event_handler() { static uint8_t prev_hit_state; // = 0 if (hit_state && hit_state != prev_hit_state) { - #if ENABLED(ULTRA_LCD) + #if HAS_SPI_LCD char chrX = ' ', chrY = ' ', chrZ = ' ', chrP = ' '; #define _SET_STOP_CHAR(A,C) (chr## A = C) #else @@ -361,7 +361,7 @@ void Endstops::event_handler() { #endif SERIAL_EOL(); - #if ENABLED(ULTRA_LCD) + #if HAS_SPI_LCD ui.status_printf_P(0, PSTR(MSG_LCD_ENDSTOPS " %c %c %c %c"), chrX, chrY, chrZ, chrP); #endif diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index a755cafca4..b8bc07069e 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -212,7 +212,7 @@ float Planner::previous_speed[NUM_AXIS], float Planner::position_cart[XYZE]; #endif -#if ENABLED(ULTRA_LCD) +#if HAS_SPI_LCD volatile uint32_t Planner::block_buffer_runtime_us = 0; #endif @@ -1469,7 +1469,7 @@ void Planner::quick_stop() { // forced to empty, there's no risk the ISR will touch this. delay_before_delivering = BLOCK_DELAY_FOR_1ST_MOVE; - #if ENABLED(ULTRA_LCD) + #if HAS_SPI_LCD // Clear the accumulated runtime clear_block_buffer_runtime(); #endif @@ -2024,14 +2024,14 @@ bool Planner::_populate_block(block_t * const block, bool split_move, // buffer is draining, add extra time. The amount of time added increases if the buffer is still emptied more. const uint32_t nst = segment_time_us + LROUND(2 * (settings.min_segment_time_us - segment_time_us) / moves_queued); inverse_secs = 1000000.0f / nst; - #if defined(XY_FREQUENCY_LIMIT) || ENABLED(ULTRA_LCD) + #if defined(XY_FREQUENCY_LIMIT) || HAS_SPI_LCD segment_time_us = nst; #endif } } #endif - #if ENABLED(ULTRA_LCD) + #if HAS_SPI_LCD // Protect the access to the position. const bool was_enabled = STEPPER_ISR_ENABLED(); if (was_enabled) DISABLE_STEPPER_DRIVER_INTERRUPT(); diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index e1766b566e..9df4820576 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -334,7 +334,7 @@ class Planner { static uint32_t axis_segment_time_us[2][3]; #endif - #if ENABLED(ULTRA_LCD) + #if HAS_SPI_LCD volatile static uint32_t block_buffer_runtime_us; //Theoretical block buffer runtime in µs #endif @@ -773,7 +773,7 @@ class Planner { // No trapezoid calculated? Don't execute yet. if (TEST(block->flag, BLOCK_BIT_RECALCULATE)) return nullptr; - #if ENABLED(ULTRA_LCD) + #if HAS_SPI_LCD block_buffer_runtime_us -= block->segment_time_us; // We can't be sure how long an active block will take, so don't count it. #endif @@ -789,7 +789,7 @@ class Planner { } // The queue became empty - #if ENABLED(ULTRA_LCD) + #if HAS_SPI_LCD clear_block_buffer_runtime(); // paranoia. Buffer is empty now - so reset accumulated time to zero. #endif @@ -806,7 +806,7 @@ class Planner { block_buffer_tail = next_block_index(block_buffer_tail); } - #if ENABLED(ULTRA_LCD) + #if HAS_SPI_LCD static uint16_t block_buffer_runtime() { #ifdef __AVR__ diff --git a/Marlin/src/pins/ramps/pins_TT_OSCAR.h b/Marlin/src/pins/ramps/pins_TT_OSCAR.h index da79f98e3a..edc326fe9d 100644 --- a/Marlin/src/pins/ramps/pins_TT_OSCAR.h +++ b/Marlin/src/pins/ramps/pins_TT_OSCAR.h @@ -268,7 +268,7 @@ // LCDs and Controllers // ////////////////////////// -#if ENABLED(ULTRA_LCD) +#if HAS_SPI_LCD // // LCD Display output pins