From 84de428d30102d837f2976707a8ff64cc85b6a41 Mon Sep 17 00:00:00 2001 From: Thomas Moore Date: Thu, 11 Jan 2018 21:43:26 -0600 Subject: [PATCH] [2.0.x] Fix compile errors (#9141) * Update persistent_store_impl.cpp * Remove define BYTE from serial functions since Arduino docs typically show 0 for the normal case. --- Marlin/src/HAL/HAL_AVR/MarlinSerial.h | 9 ++++----- Marlin/src/HAL/HAL_DUE/MarlinSerialUSB_Due.h | 9 ++++----- Marlin/src/HAL/HAL_DUE/MarlinSerial_Due.h | 9 ++++----- Marlin/src/HAL/HAL_LPC1768/HardwareSerial.h | 2 -- Marlin/src/HAL/HAL_LPC1768/serial.h | 1 - Marlin/src/module/configuration_store.h | 2 +- 6 files changed, 13 insertions(+), 19 deletions(-) diff --git a/Marlin/src/HAL/HAL_AVR/MarlinSerial.h b/Marlin/src/HAL/HAL_AVR/MarlinSerial.h index 5253b28b4..4bddd5f50 100644 --- a/Marlin/src/HAL/HAL_AVR/MarlinSerial.h +++ b/Marlin/src/HAL/HAL_AVR/MarlinSerial.h @@ -75,7 +75,6 @@ #define HEX 16 #define OCT 8 #define BIN 2 -#define BYTE 0 #ifndef USBCON // We're using a ring buffer (I think), in which rx_buffer_head is the index of the @@ -126,8 +125,8 @@ FORCE_INLINE static void print(const String& s) { for (int i = 0; i < (int)s.length(); i++) write(s[i]); } FORCE_INLINE static void print(const char* str) { write(str); } - static void print(char, int = BYTE); - static void print(unsigned char, int = BYTE); + static void print(char, int = 0); + static void print(unsigned char, int = 0); static void print(int, int = DEC); static void print(unsigned int, int = DEC); static void print(long, int = DEC); @@ -136,8 +135,8 @@ static void println(const String& s); static void println(const char[]); - static void println(char, int = BYTE); - static void println(unsigned char, int = BYTE); + static void println(char, int = 0); + static void println(unsigned char, int = 0); static void println(int, int = DEC); static void println(unsigned int, int = DEC); static void println(long, int = DEC); diff --git a/Marlin/src/HAL/HAL_DUE/MarlinSerialUSB_Due.h b/Marlin/src/HAL/HAL_DUE/MarlinSerialUSB_Due.h index 1a6c196d3..4d9299da3 100644 --- a/Marlin/src/HAL/HAL_DUE/MarlinSerialUSB_Due.h +++ b/Marlin/src/HAL/HAL_DUE/MarlinSerialUSB_Due.h @@ -38,7 +38,6 @@ #define HEX 16 #define OCT 8 #define BIN 2 -#define BYTE 0 class MarlinSerialUSB { @@ -65,8 +64,8 @@ public: static FORCE_INLINE void print(const String& s) { for (int i = 0; i < (int)s.length(); i++) write(s[i]); } static FORCE_INLINE void print(const char* str) { write(str); } - static void print(char, int = BYTE); - static void print(unsigned char, int = BYTE); + static void print(char, int = 0); + static void print(unsigned char, int = 0); static void print(int, int = DEC); static void print(unsigned int, int = DEC); static void print(long, int = DEC); @@ -75,8 +74,8 @@ public: static void println(const String& s); static void println(const char[]); - static void println(char, int = BYTE); - static void println(unsigned char, int = BYTE); + static void println(char, int = 0); + static void println(unsigned char, int = 0); static void println(int, int = DEC); static void println(unsigned int, int = DEC); static void println(long, int = DEC); diff --git a/Marlin/src/HAL/HAL_DUE/MarlinSerial_Due.h b/Marlin/src/HAL/HAL_DUE/MarlinSerial_Due.h index 1330b89b8..a28beaeb1 100644 --- a/Marlin/src/HAL/HAL_DUE/MarlinSerial_Due.h +++ b/Marlin/src/HAL/HAL_DUE/MarlinSerial_Due.h @@ -39,7 +39,6 @@ #define HEX 16 #define OCT 8 #define BIN 2 -#define BYTE 0 // Define constants and variables for buffering incoming serial data. We're // using a ring buffer (I think), in which rx_buffer_head is the index of the @@ -106,8 +105,8 @@ public: FORCE_INLINE static void print(const String& s) { for (int i = 0; i < (int)s.length(); i++) write(s[i]); } FORCE_INLINE static void print(const char* str) { write(str); } - static void print(char, int = BYTE); - static void print(unsigned char, int = BYTE); + static void print(char, int = 0); + static void print(unsigned char, int = 0); static void print(int, int = DEC); static void print(unsigned int, int = DEC); static void print(long, int = DEC); @@ -116,8 +115,8 @@ public: static void println(const String& s); static void println(const char[]); - static void println(char, int = BYTE); - static void println(unsigned char, int = BYTE); + static void println(char, int = 0); + static void println(unsigned char, int = 0); static void println(int, int = DEC); static void println(unsigned int, int = DEC); static void println(long, int = DEC); diff --git a/Marlin/src/HAL/HAL_LPC1768/HardwareSerial.h b/Marlin/src/HAL/HAL_LPC1768/HardwareSerial.h index a83f9dac3..305e5ccfd 100644 --- a/Marlin/src/HAL/HAL_LPC1768/HardwareSerial.h +++ b/Marlin/src/HAL/HAL_LPC1768/HardwareSerial.h @@ -77,8 +77,6 @@ public: #define HEX 16 #define OCT 8 #define BIN 2 - #define BYTE 0 - void print_bin(uint32_t value, uint8_t num_digits) { uint32_t mask = 1 << (num_digits -1); diff --git a/Marlin/src/HAL/HAL_LPC1768/serial.h b/Marlin/src/HAL/HAL_LPC1768/serial.h index 8f496d3f7..d07912145 100644 --- a/Marlin/src/HAL/HAL_LPC1768/serial.h +++ b/Marlin/src/HAL/HAL_LPC1768/serial.h @@ -129,7 +129,6 @@ public: #define HEX 16 #define OCT 8 #define BIN 2 - #define BYTE 0 void print_bin(uint32_t value, uint8_t num_digits) { uint32_t mask = 1 << (num_digits -1); diff --git a/Marlin/src/module/configuration_store.h b/Marlin/src/module/configuration_store.h index fdbf91749..572dded84 100644 --- a/Marlin/src/module/configuration_store.h +++ b/Marlin/src/module/configuration_store.h @@ -116,7 +116,7 @@ class MarlinSettings { ); static bool size_error(const uint16_t size #if ADD_PORT_ARG - const int8_t port=-1 + , const int8_t port=-1 #endif ); #endif