From ba8a53a40fa0adaa947b536639bab998cc872feb Mon Sep 17 00:00:00 2001 From: Bernhard Kubicek Date: Wed, 9 Nov 2011 20:30:41 +0100 Subject: [PATCH] Streaming.h is gone. It conflicted with PROGMEM. And saving memory is more important than nicer code, imho --- Marlin/Marlin.h | 1 - Marlin/Marlin.pde | 1 - Marlin/streaming.h | 84 ------------------------------------------ Marlin/temperature.cpp | 1 - 4 files changed, 87 deletions(-) delete mode 100644 Marlin/streaming.h diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 99cd8021b3..1e36b61e88 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -5,7 +5,6 @@ // Licence: GPL #include #include "fastio.h" -#include "streaming.h" #include //#define SERIAL_ECHO(x) Serial << "echo: " << x; diff --git a/Marlin/Marlin.pde b/Marlin/Marlin.pde index 7b67cfcf5b..dee095d84f 100644 --- a/Marlin/Marlin.pde +++ b/Marlin/Marlin.pde @@ -32,7 +32,6 @@ #include "pins.h" #include "Marlin.h" #include "ultralcd.h" -#include "streaming.h" #include "planner.h" #include "stepper.h" #include "temperature.h" diff --git a/Marlin/streaming.h b/Marlin/streaming.h deleted file mode 100644 index 1a6afe73d9..0000000000 --- a/Marlin/streaming.h +++ /dev/null @@ -1,84 +0,0 @@ -/* -Streaming.h - Arduino library for supporting the << streaming operator -Copyright (c) 2010 Mikal Hart. All rights reserved. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#ifndef ARDUINO_STREAMING -#define ARDUINO_STREAMING - -//#include - -#define STREAMING_LIBRARY_VERSION 4 - -// Generic template -template -inline Print &operator <<(Print &stream, T arg) -{ stream.print(arg); return stream; } - -struct _BASED -{ - long val; - int base; - _BASED(long v, int b): val(v), base(b) - {} -}; - -#define _HEX(a) _BASED(a, HEX) -#define _DEC(a) _BASED(a, DEC) -#define _OCT(a) _BASED(a, OCT) -#define _BIN(a) _BASED(a, BIN) -#define _BYTE(a) _BASED(a, BYTE) - -// Specialization for class _BASED -// Thanks to Arduino forum user Ben Combee who suggested this -// clever technique to allow for expressions like -// Serial << _HEX(a); - -inline Print &operator <<(Print &obj, const _BASED &arg) -{ obj.print(arg.val, arg.base); return obj; } - -#if ARDUINO >= 18 -// Specialization for class _FLOAT -// Thanks to Michael Margolis for suggesting a way -// to accommodate Arduino 0018's floating point precision -// feature like this: -// Serial << _FLOAT(gps_latitude, 6); // 6 digits of precision - -struct _FLOAT -{ - float val; - int digits; - _FLOAT(double v, int d): val(v), digits(d) - {} -}; - -inline Print &operator <<(Print &obj, const _FLOAT &arg) -{ obj.print(arg.val, arg.digits); return obj; } -#endif - -// Specialization for enum _EndLineCode -// Thanks to Arduino forum user Paul V. who suggested this -// clever technique to allow for expressions like -// Serial << "Hello!" << endl; - -enum _EndLineCode { endl }; - -inline Print &operator <<(Print &obj, _EndLineCode arg) -{ obj.println(); return obj; } - -#endif - diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 87d9ee5434..83c173b28c 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -34,7 +34,6 @@ #include "pins.h" #include "Marlin.h" #include "ultralcd.h" -#include "streaming.h" #include "temperature.h" #include "watchdog.h"