From 7308ef78090074374f6dd7961ab2dbc7f2cc42cf Mon Sep 17 00:00:00 2001 From: Bob-the-Kuhn Date: Tue, 20 Mar 2018 15:53:21 -0500 Subject: [PATCH] Add conditional, give DUE SPI a unique name, fix compiler warnings (#10168) --- Marlin/src/HAL/HAL_DUE/HAL_spi_Due.cpp | 2 +- Marlin/src/HAL/HAL_DUE/spi_pins.h | 2 +- Marlin/src/lcd/ultralcd_impl_DOGM.h | 5 +++-- Marlin/src/pins/pins_RAMPS.h | 4 ++++ Marlin/src/pins/pins_RAMPS_SMART.h | 4 ++-- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Marlin/src/HAL/HAL_DUE/HAL_spi_Due.cpp b/Marlin/src/HAL/HAL_DUE/HAL_spi_Due.cpp index 9b06b2456..3ceb7a6fe 100644 --- a/Marlin/src/HAL/HAL_DUE/HAL_spi_Due.cpp +++ b/Marlin/src/HAL/HAL_DUE/HAL_spi_Due.cpp @@ -52,7 +52,7 @@ // Public functions // -------------------------------------------------------------------------- -#if ENABLED(SOFTWARE_SPI) +#if ENABLED(DUE_SOFTWARE_SPI) // -------------------------------------------------------------------------- // software SPI diff --git a/Marlin/src/HAL/HAL_DUE/spi_pins.h b/Marlin/src/HAL/HAL_DUE/spi_pins.h index 51d7b283c..d0eb711df 100644 --- a/Marlin/src/HAL/HAL_DUE/spi_pins.h +++ b/Marlin/src/HAL/HAL_DUE/spi_pins.h @@ -47,7 +47,7 @@ #define MOSI_PIN 75 #else // defaults - #define SOFTWARE_SPI + #define DUE_SOFTWARE_SPI #define SCK_PIN 52 #define MISO_PIN 50 #define MOSI_PIN 51 diff --git a/Marlin/src/lcd/ultralcd_impl_DOGM.h b/Marlin/src/lcd/ultralcd_impl_DOGM.h index 84c937968..889334bf1 100644 --- a/Marlin/src/lcd/ultralcd_impl_DOGM.h +++ b/Marlin/src/lcd/ultralcd_impl_DOGM.h @@ -186,8 +186,9 @@ U8GLIB_LM6059_2X u8g(DOGLCD_CS, DOGLCD_A0); // 4 stripes #elif ENABLED(U8GLIB_ST7565_64128N) - // The MaKrPanel, Mini Viki, and Viki 2.0, ST7565 controller - #if DOGLCD_SCK == SCK_PIN && DOGLCD_MOSI == MOSI_PIN + // The MaKrPanel, Mini Viki, Viki 2.0 & AZSMZ 12864 ST7565 controller + #define SMART_RAMPS (MB(RAMPS_SMART_EFB) || MB(RAMPS_SMART_EEB) || MB(RAMPS_SMART_EFF) || MB(RAMPS_SMART_EEF) || MB(RAMPS_SMART_SF)) + #if DOGLCD_SCK == SCK_PIN && DOGLCD_MOSI == MOSI_PIN && !SMART_RAMPS U8GLIB_64128N_2X_HAL u8g(DOGLCD_CS, DOGLCD_A0); // using HW-SPI #else U8GLIB_64128N_2X_HAL u8g(DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0); // using SW-SPI diff --git a/Marlin/src/pins/pins_RAMPS.h b/Marlin/src/pins/pins_RAMPS.h index 28056fa59..d17d3e76a 100644 --- a/Marlin/src/pins/pins_RAMPS.h +++ b/Marlin/src/pins/pins_RAMPS.h @@ -547,6 +547,10 @@ #define ADC_KEYPAD_PIN 12 + #elif ENABLED(AZSMZ_12864) + + // Pins only defined for RAMPS_SMART currently + #else // Beeper on AUX-4 diff --git a/Marlin/src/pins/pins_RAMPS_SMART.h b/Marlin/src/pins/pins_RAMPS_SMART.h index 48c8dab23..5bc2aed6d 100644 --- a/Marlin/src/pins/pins_RAMPS_SMART.h +++ b/Marlin/src/pins/pins_RAMPS_SMART.h @@ -90,12 +90,12 @@ // // Support for AZSMZ 12864 LCD with SD Card 3D printer smart controller control panel #if ENABLED(AZSMZ_12864) - #define BEEPER_PIN 66 + #define BEEPER_PIN 66 // Smart RAMPS 1.42 pinout diagram on RepRap WIKI erroneously says this should be pin 65 #define DOGLCD_A0 59 #define DOGLCD_CS 44 #define BTN_EN1 58 #define BTN_EN2 40 - #define BTN_ENC 67 + #define BTN_ENC 67 // Smart RAMPS 1.42 pinout diagram on RepRap WIKI erroneously says this should be pin 66 #define SD_DETECT_PIN 49 // Pin 49 for display sd interface, 72 for easy adapter board #define KILL_PIN 42 #endif