├── _config.yml ├── libraries ├── StandardCplusplus │ ├── uartbuf │ ├── StandardCplusplus.h │ ├── .gitignore │ ├── Makefile │ ├── Jamfile │ ├── cassert │ ├── cerrno │ ├── limits.cpp │ ├── bitset.cpp │ ├── numeric.cpp │ ├── queue.cpp │ ├── stack.cpp │ ├── iterator.cpp │ ├── list.cpp │ ├── associative_base.cpp │ ├── iomanip.cpp │ ├── valarray.cpp │ ├── algorithm.cpp │ ├── utility.cpp │ ├── map.cpp │ ├── set.cpp │ ├── climits │ ├── complex.cpp │ ├── cfloat │ ├── locale.cpp │ ├── deque.cpp │ ├── del_opv.cpp │ ├── typeinfo.cpp │ ├── del_opnt.cpp │ ├── del_opvnt.cpp │ ├── clocale │ ├── new_opnt.cpp │ ├── new_opvnt.cpp │ ├── del_op.cpp │ ├── cctype │ ├── new_handler.cpp │ ├── csetjmp │ ├── system_configuration.h │ ├── iostream.cpp │ ├── new_opv.cpp │ ├── new_op.cpp │ ├── eh_globals.cpp │ ├── func_exception │ ├── exception.cpp │ ├── README.md │ ├── stdexcept.cpp │ ├── streambuf.cpp │ ├── cstdlib │ ├── basic_definitions │ ├── support.cpp │ ├── cstdio │ ├── char_traits.cpp │ ├── cwchar │ ├── locale │ ├── cstddef │ ├── cstring │ ├── func_exception.cpp │ ├── cstdarg │ ├── csignal │ ├── eh_alloc.cpp │ ├── new │ ├── type_traits │ ├── sstream.cpp │ ├── ctime │ ├── istream.cpp │ ├── stack │ ├── ostream.cpp │ ├── utility.h │ └── cwctype ├── Adafruit_NeoPixel │ ├── examples │ │ ├── simple │ │ │ ├── .esp8266.test.skip │ │ │ └── simple.ino │ │ ├── buttoncycler │ │ │ └── .esp8266.test.skip │ │ ├── strandtest │ │ │ └── .esp8266.test.skip │ │ └── RGBWstrandtest │ │ │ └── .esp8266.test.skip │ ├── library.properties │ ├── keywords.txt │ ├── README.md │ └── esp8266.c ├── DS3231 │ ├── License │ │ ├── License - CC BY-NC-SA 3.0 - Legal.pdf │ │ └── License - CC BY-NC-SA 3.0 - Summary.pdf │ ├── hardware │ │ ├── avr │ │ │ └── HW_AVR_defines.h │ │ ├── arm │ │ │ └── HW_ARM_defines.h │ │ └── pic32 │ │ │ └── HW_PIC32_defines.h │ └── keywords.txt ├── ArduinoJson │ ├── ArduinoJson.h │ └── include │ │ ├── ArduinoJson.h │ │ ├── ArduinoJson │ │ ├── JsonPair.hpp │ │ ├── Internals │ │ │ ├── JsonFloat.hpp │ │ │ ├── DummyPrint.hpp │ │ │ ├── JsonBufferAllocated.hpp │ │ │ ├── JsonInteger.hpp │ │ │ ├── ListNode.hpp │ │ │ ├── DynamicStringBuilder.hpp │ │ │ ├── StaticStringBuilder.hpp │ │ │ ├── StreamPrintAdapter.hpp │ │ │ ├── JsonVariantContent.hpp │ │ │ ├── ReferenceType.hpp │ │ │ ├── JsonVariantAs.hpp │ │ │ ├── Encoding.hpp │ │ │ ├── ListConstIterator.hpp │ │ │ ├── ListIterator.hpp │ │ │ ├── Comments.hpp │ │ │ ├── JsonVariantType.hpp │ │ │ ├── Parse.hpp │ │ │ ├── IndentedPrint.hpp │ │ │ ├── JsonParser.hpp │ │ │ ├── JsonPrintable.hpp │ │ │ ├── Prettyfier.hpp │ │ │ ├── List.hpp │ │ │ └── BlockJsonBuffer.hpp │ │ ├── Polyfills │ │ │ ├── attributes.hpp │ │ │ ├── normalize.hpp │ │ │ └── math.hpp │ │ ├── String.hpp │ │ ├── RawJson.hpp │ │ ├── TypeTraits │ │ │ ├── EnableIf.hpp │ │ │ ├── RemoveConst.hpp │ │ │ ├── IsFloatingPoint.hpp │ │ │ ├── RemoveReference.hpp │ │ │ ├── IsReference.hpp │ │ │ ├── IsSame.hpp │ │ │ ├── IsIntegral.hpp │ │ │ ├── IsSignedIntegral.hpp │ │ │ └── IsUnsignedIntegral.hpp │ │ ├── DynamicJsonBuffer.hpp │ │ ├── JsonObjectKey.hpp │ │ ├── Print.hpp │ │ ├── StaticJsonBuffer.hpp │ │ ├── JsonBuffer.ipp │ │ ├── JsonArray.ipp │ │ ├── JsonObject.ipp │ │ ├── Configuration.hpp │ │ └── JsonArraySubscript.hpp │ │ └── ArduinoJson.hpp ├── SD │ ├── library.properties │ ├── src │ │ ├── README.txt │ │ ├── utility │ │ │ └── SdFatUtil.h │ │ └── File.cpp │ ├── keywords.txt │ └── README.adoc ├── SPI │ ├── library.properties │ └── keywords.txt └── LiquidCrystal │ ├── library.properties │ ├── keywords.txt │ ├── README.adoc │ └── src │ └── LiquidCrystal.h ├── README.md ├── Docs └── images │ ├── Home.jpg │ ├── Crops.jpg │ ├── System.jpg │ ├── Timers.jpg │ ├── Channels.jpg │ ├── Crop_Name.jpg │ ├── Crop_New.jpg │ ├── Crop_Open.jpg │ ├── Crop_Delete.jpg │ ├── Crop_Reset.jpg │ ├── Irrigation.jpg │ ├── Channel_Pump.jpg │ ├── Crop_ECRange.jpg │ ├── Crop_PHRange.jpg │ ├── Crop_Regimens.jpg │ ├── format-window.jpg │ ├── hydro-hyphen.png │ ├── System_DateTime.jpg │ ├── Channel_DosingDelay.jpg │ ├── Timers_Recepticals.jpg │ ├── Channel_PumpCalibrate.jpg │ ├── Channel_RegimenConfig.jpg │ ├── Irrigation_DrainTime.jpg │ ├── System_ECCalibration.jpg │ ├── System_pHCalibration.jpg │ ├── Irrigation_FlowCalibrate.jpg │ ├── Irrigation_ReservoirVol.jpg │ ├── Irrigation_TopOffAmount.jpg │ ├── Irrigation_TopOffDelay.jpg │ ├── DRO-Matic_BreadboardSchematic.jpg │ └── Irrigation_TopOffConcentrate.jpg ├── .gitignore └── src ├── Menus.h ├── Screens.h ├── Core.h ├── DatesTime.h ├── Timers.h ├── Pumps.h ├── Regimens.h ├── Irrigation.h ├── Crops.h └── Menus.cpp /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-minimal -------------------------------------------------------------------------------- /libraries/StandardCplusplus/uartbuf: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /libraries/Adafruit_NeoPixel/examples/simple/.esp8266.test.skip: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/StandardCplusplus.h: -------------------------------------------------------------------------------- 1 | #undef abs 2 | -------------------------------------------------------------------------------- /libraries/Adafruit_NeoPixel/examples/buttoncycler/.esp8266.test.skip: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /libraries/Adafruit_NeoPixel/examples/strandtest/.esp8266.test.skip: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drolsen/DRO-Matic/HEAD/README.md -------------------------------------------------------------------------------- /libraries/Adafruit_NeoPixel/examples/RGBWstrandtest/.esp8266.test.skip: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Docs/images/Home.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drolsen/DRO-Matic/HEAD/Docs/images/Home.jpg -------------------------------------------------------------------------------- /Docs/images/Crops.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drolsen/DRO-Matic/HEAD/Docs/images/Crops.jpg -------------------------------------------------------------------------------- /Docs/images/System.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drolsen/DRO-Matic/HEAD/Docs/images/System.jpg -------------------------------------------------------------------------------- /Docs/images/Timers.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drolsen/DRO-Matic/HEAD/Docs/images/Timers.jpg -------------------------------------------------------------------------------- /libraries/StandardCplusplus/.gitignore: -------------------------------------------------------------------------------- 1 | 16000000/ 2 | .*.swp 3 | *.orig 4 | *.bak 5 | version.h 6 | -------------------------------------------------------------------------------- /Docs/images/Channels.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drolsen/DRO-Matic/HEAD/Docs/images/Channels.jpg -------------------------------------------------------------------------------- /Docs/images/Crop_Name.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drolsen/DRO-Matic/HEAD/Docs/images/Crop_Name.jpg -------------------------------------------------------------------------------- /Docs/images/Crop_New.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drolsen/DRO-Matic/HEAD/Docs/images/Crop_New.jpg -------------------------------------------------------------------------------- /Docs/images/Crop_Open.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drolsen/DRO-Matic/HEAD/Docs/images/Crop_Open.jpg -------------------------------------------------------------------------------- /Docs/images/Crop_Delete.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drolsen/DRO-Matic/HEAD/Docs/images/Crop_Delete.jpg -------------------------------------------------------------------------------- /Docs/images/Crop_Reset.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drolsen/DRO-Matic/HEAD/Docs/images/Crop_Reset.jpg -------------------------------------------------------------------------------- /Docs/images/Irrigation.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drolsen/DRO-Matic/HEAD/Docs/images/Irrigation.jpg -------------------------------------------------------------------------------- /Docs/images/Channel_Pump.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drolsen/DRO-Matic/HEAD/Docs/images/Channel_Pump.jpg -------------------------------------------------------------------------------- /Docs/images/Crop_ECRange.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drolsen/DRO-Matic/HEAD/Docs/images/Crop_ECRange.jpg -------------------------------------------------------------------------------- /Docs/images/Crop_PHRange.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drolsen/DRO-Matic/HEAD/Docs/images/Crop_PHRange.jpg -------------------------------------------------------------------------------- /Docs/images/Crop_Regimens.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drolsen/DRO-Matic/HEAD/Docs/images/Crop_Regimens.jpg -------------------------------------------------------------------------------- /Docs/images/format-window.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drolsen/DRO-Matic/HEAD/Docs/images/format-window.jpg -------------------------------------------------------------------------------- /Docs/images/hydro-hyphen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drolsen/DRO-Matic/HEAD/Docs/images/hydro-hyphen.png -------------------------------------------------------------------------------- /Docs/images/System_DateTime.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drolsen/DRO-Matic/HEAD/Docs/images/System_DateTime.jpg -------------------------------------------------------------------------------- /Docs/images/Channel_DosingDelay.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drolsen/DRO-Matic/HEAD/Docs/images/Channel_DosingDelay.jpg -------------------------------------------------------------------------------- /Docs/images/Timers_Recepticals.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drolsen/DRO-Matic/HEAD/Docs/images/Timers_Recepticals.jpg -------------------------------------------------------------------------------- /Docs/images/Channel_PumpCalibrate.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drolsen/DRO-Matic/HEAD/Docs/images/Channel_PumpCalibrate.jpg -------------------------------------------------------------------------------- /Docs/images/Channel_RegimenConfig.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drolsen/DRO-Matic/HEAD/Docs/images/Channel_RegimenConfig.jpg -------------------------------------------------------------------------------- /Docs/images/Irrigation_DrainTime.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drolsen/DRO-Matic/HEAD/Docs/images/Irrigation_DrainTime.jpg -------------------------------------------------------------------------------- /Docs/images/System_ECCalibration.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drolsen/DRO-Matic/HEAD/Docs/images/System_ECCalibration.jpg -------------------------------------------------------------------------------- /Docs/images/System_pHCalibration.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drolsen/DRO-Matic/HEAD/Docs/images/System_pHCalibration.jpg -------------------------------------------------------------------------------- /Docs/images/Irrigation_FlowCalibrate.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drolsen/DRO-Matic/HEAD/Docs/images/Irrigation_FlowCalibrate.jpg -------------------------------------------------------------------------------- /Docs/images/Irrigation_ReservoirVol.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drolsen/DRO-Matic/HEAD/Docs/images/Irrigation_ReservoirVol.jpg -------------------------------------------------------------------------------- /Docs/images/Irrigation_TopOffAmount.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drolsen/DRO-Matic/HEAD/Docs/images/Irrigation_TopOffAmount.jpg -------------------------------------------------------------------------------- /Docs/images/Irrigation_TopOffDelay.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drolsen/DRO-Matic/HEAD/Docs/images/Irrigation_TopOffDelay.jpg -------------------------------------------------------------------------------- /Docs/images/DRO-Matic_BreadboardSchematic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drolsen/DRO-Matic/HEAD/Docs/images/DRO-Matic_BreadboardSchematic.jpg -------------------------------------------------------------------------------- /Docs/images/Irrigation_TopOffConcentrate.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drolsen/DRO-Matic/HEAD/Docs/images/Irrigation_TopOffConcentrate.jpg -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.vs/ 2 | /__vm/ 3 | /Debug/ 4 | /Release/ 5 | *.TMP 6 | !.gitignore 7 | .gitattributes 8 | *.suo 9 | *.sln 10 | *.filters 11 | *.vcxproj -------------------------------------------------------------------------------- /libraries/DS3231/License/License - CC BY-NC-SA 3.0 - Legal.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drolsen/DRO-Matic/HEAD/libraries/DS3231/License/License - CC BY-NC-SA 3.0 - Legal.pdf -------------------------------------------------------------------------------- /libraries/DS3231/License/License - CC BY-NC-SA 3.0 - Summary.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drolsen/DRO-Matic/HEAD/libraries/DS3231/License/License - CC BY-NC-SA 3.0 - Summary.pdf -------------------------------------------------------------------------------- /libraries/DS3231/hardware/avr/HW_AVR_defines.h: -------------------------------------------------------------------------------- 1 | // *** Hardwarespecific defines *** 2 | #define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit)) 3 | 4 | #ifndef TWI_FREQ 5 | #define TWI_FREQ 400000L 6 | #endif 7 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/ArduinoJson.h: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #include "include/ArduinoJson.h" 9 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson.h: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #include "ArduinoJson.hpp" 9 | using namespace ArduinoJson; 10 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR=../ 2 | include $(TOPDIR)Rules.mak 3 | 4 | all: 5 | 6 | clean: 7 | 8 | distclean: 9 | 10 | HEADERS = $(filter-out .svn CVS Makefile,$(wildcard *)) 11 | install: 12 | $(INSTALL) -d $(PREFIX)$(UCLIBCXX_RUNTIME_INCLUDEDIR) 13 | $(INSTALL) -m 644 $(HEADERS) $(PREFIX)$(UCLIBCXX_RUNTIME_INCLUDEDIR) 14 | -------------------------------------------------------------------------------- /libraries/Adafruit_NeoPixel/library.properties: -------------------------------------------------------------------------------- 1 | name=Adafruit NeoPixel 2 | version=1.0.6 3 | author=Adafruit 4 | maintainer=Adafruit 5 | sentence=Arduino library for controlling single-wire-based LED pixels and strip. 6 | paragraph=Arduino library for controlling single-wire-based LED pixels and strip. 7 | category=Display 8 | url=https://github.com/adafruit/Adafruit_NeoPixel 9 | architectures=* 10 | -------------------------------------------------------------------------------- /libraries/DS3231/hardware/arm/HW_ARM_defines.h: -------------------------------------------------------------------------------- 1 | // *** Hardwarespecific defines *** 2 | #define SDA 20 3 | #define SCL 21 4 | #define SDA1 70 5 | #define SCL1 71 6 | 7 | #define TWI_SPEED TWI_SPEED_400k // Set default TWI Speed 8 | #define TWI_SPEED_100k 208 9 | #define TWI_SPEED_400k 101 10 | 11 | #define TWI_DIV TWI_DIV_400k // Set divider for TWI Speed (must match TWI_SPEED setting) 12 | #define TWI_DIV_100k 1 13 | #define TWI_DIV_400k 0 14 | -------------------------------------------------------------------------------- /libraries/SD/library.properties: -------------------------------------------------------------------------------- 1 | name=SD 2 | version=1.0.8 3 | author=Arduino, SparkFun 4 | maintainer=Arduino 5 | sentence=Enables reading and writing on SD cards. 6 | paragraph=Once an SD memory card is connected to the SPI interface of the Arduino or Genuino board you can create files and read/write on them. You can also move through directories on the SD card. 7 | category=Data Storage 8 | url=http://www.arduino.cc/en/Reference/SD 9 | architectures=* 10 | -------------------------------------------------------------------------------- /libraries/SD/src/README.txt: -------------------------------------------------------------------------------- 1 | 2 | ** SD - a slightly more friendly wrapper for sdfatlib ** 3 | 4 | This library aims to expose a subset of SD card functionality in the 5 | form of a higher level "wrapper" object. 6 | 7 | License: GNU General Public License V3 8 | (Because sdfatlib is licensed with this.) 9 | 10 | (C) Copyright 2010 SparkFun Electronics 11 | 12 | Now better than ever with optimization, multiple file support, directory handling, etc - ladyada! 13 | 14 | -------------------------------------------------------------------------------- /src/Menus.h: -------------------------------------------------------------------------------- 1 | /* 2 | * DROMatic.ino 3 | * DROMatic OS Menus 4 | * Devin R. Olsen - July 4th, 2017 5 | * devin@devinrolsen.com 6 | */ 7 | 8 | #ifndef _MENUS_h 9 | #define _MENUS_h 10 | #include "Globals.h" 11 | 12 | extern byte menuIndex; 13 | extern vector menus, menusHistory; 14 | 15 | extern String getMenuHistory(); 16 | extern void scrollAlpha(int dir); 17 | extern void scrollMenus(int dir); 18 | extern void getDirectoryMenus(File directory); 19 | 20 | #endif 21 | 22 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/JsonPair.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "JsonObjectKey.hpp" 11 | #include "JsonVariant.hpp" 12 | 13 | namespace ArduinoJson { 14 | 15 | // A key value pair for JsonObject. 16 | struct JsonPair { 17 | const char* key; 18 | JsonVariant value; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/Internals/JsonFloat.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "../Configuration.hpp" 11 | 12 | namespace ArduinoJson { 13 | namespace Internals { 14 | 15 | #if ARDUINOJSON_USE_DOUBLE 16 | typedef double JsonFloat; 17 | #else 18 | typedef float JsonFloat; 19 | #endif 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/Polyfills/attributes.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #ifdef _MSC_VER 11 | #define FORCE_INLINE __forceinline 12 | #define NO_INLINE __declspec(noinline) 13 | #else 14 | #define FORCE_INLINE __attribute__((always_inline)) 15 | #define NO_INLINE __attribute__((noinline)) 16 | #endif 17 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/String.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "Configuration.hpp" 11 | 12 | #if ARDUINOJSON_USE_ARDUINO_STRING 13 | 14 | #include 15 | 16 | #else 17 | 18 | #include 19 | 20 | namespace ArduinoJson { 21 | typedef std::string String; 22 | } 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/Internals/DummyPrint.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "../Print.hpp" 11 | 12 | namespace ArduinoJson { 13 | namespace Internals { 14 | 15 | // A dummy Print implementation used in JsonPrintable::measureLength() 16 | class DummyPrint : public Print { 17 | public: 18 | virtual size_t write(uint8_t) { return 1; } 19 | }; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /libraries/SPI/library.properties: -------------------------------------------------------------------------------- 1 | name=SPI 2 | version=1.0 3 | author=Arduino 4 | maintainer=Arduino 5 | sentence=Enables the communication with devices that use the Serial Peripheral Interface (SPI) Bus. 6 | paragraph=SPI is a synchronous serial data protocol used by microcontrollers for communicating with one or more peripheral devices quickly over short distances. It uses three lines common to all devices (MISO, MOSI and SCK) and one specific for each device. 7 | category=Communication 8 | url=http://www.arduino.cc/en/Reference/SPI 9 | architectures=avr 10 | 11 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/RawJson.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | namespace ArduinoJson { 11 | 12 | // A special type of data that can be used to insert pregenerated JSON portions. 13 | class RawJson { 14 | public: 15 | explicit RawJson(const char* str) : _str(str) {} 16 | operator const char*() const { return _str; } 17 | 18 | private: 19 | const char* _str; 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/TypeTraits/EnableIf.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | namespace ArduinoJson { 11 | namespace TypeTraits { 12 | 13 | // A meta-function that return the type T if Condition is true. 14 | template 15 | struct EnableIf {}; 16 | 17 | template 18 | struct EnableIf { 19 | typedef T type; 20 | }; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Screens.h: -------------------------------------------------------------------------------- 1 | /* 2 | * DROMatic.ino 3 | * DROMatic OS Core 4 | * Devin R. Olsen - July 4th, 2017 5 | * devin@devinrolsen.com 6 | */ 7 | // Screens.h 8 | 9 | #ifndef _SCREENS_h 10 | #define _SCREENS_h 11 | #include "Globals.h" 12 | 13 | extern String screenName; 14 | extern vector>> matrix; 15 | extern byte cursorX, cursorY, currentAlphaIndex, upArrow[8], downArrow[8]; 16 | 17 | extern void exitScreen(); 18 | extern void printHomeScreen(); 19 | extern void screenMatrix(); 20 | extern void printScrollArrows(); 21 | extern void printScreenNames(String menu); 22 | 23 | #endif 24 | 25 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/TypeTraits/RemoveConst.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | namespace ArduinoJson { 11 | namespace TypeTraits { 12 | 13 | // A meta-function that return the type T without the const modifier 14 | template 15 | struct RemoveConst { 16 | typedef T type; 17 | }; 18 | template 19 | struct RemoveConst { 20 | typedef T type; 21 | }; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/TypeTraits/IsFloatingPoint.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "IsSame.hpp" 11 | 12 | namespace ArduinoJson { 13 | namespace TypeTraits { 14 | 15 | // A meta-function that returns true if T is a floating point type 16 | template 17 | struct IsFloatingPoint { 18 | static const bool value = IsSame::value || IsSame::value; 19 | }; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/TypeTraits/RemoveReference.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | namespace ArduinoJson { 11 | namespace TypeTraits { 12 | 13 | // A meta-function that return the type T without the reference modifier. 14 | template 15 | struct RemoveReference { 16 | typedef T type; 17 | }; 18 | template 19 | struct RemoveReference { 20 | typedef T type; 21 | }; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/TypeTraits/IsReference.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | namespace ArduinoJson { 11 | namespace TypeTraits { 12 | 13 | // A meta-function that returns true if T is a reference 14 | template 15 | struct IsReference { 16 | static const bool value = false; 17 | }; 18 | 19 | template 20 | struct IsReference { 21 | static const bool value = true; 22 | }; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/TypeTraits/IsSame.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | namespace ArduinoJson { 11 | namespace TypeTraits { 12 | 13 | // A meta-function that returns true if types T and U are the same. 14 | template 15 | struct IsSame { 16 | static const bool value = false; 17 | }; 18 | 19 | template 20 | struct IsSame { 21 | static const bool value = true; 22 | }; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/Jamfile: -------------------------------------------------------------------------------- 1 | UCLIBCPP_DIR = $(HOME)/Source/uClibc++ ; 2 | 3 | rule FixCopy 4 | { 5 | Depends $(<) : $(>) ; 6 | Clean clean : $(<) ; 7 | Depends all : $(<) ; 8 | } 9 | 10 | actions FixCopy 11 | { 12 | sed -e "s///g" $(>) > $(<) 13 | } 14 | 15 | for file in [ GLOB $(UCLIBCPP_DIR)/include : [^.]* ] 16 | { 17 | local _o = $(file:D=$(PWD)) ; 18 | if ( $(file:B) = "utility" ) 19 | { 20 | _o = $(_o:S=.h) ; 21 | } 22 | FixCopy $(_o) : $(file) ; 23 | } 24 | 25 | for file in [ GLOB $(UCLIBCPP_DIR)/src : *.cpp ] 26 | { 27 | local _o = $(file:D=$(PWD)) ; 28 | FixCopy $(_o) : $(file) ; 29 | } 30 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/DynamicJsonBuffer.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "Internals/BlockJsonBuffer.hpp" 11 | 12 | namespace ArduinoJson { 13 | // Implements a JsonBuffer with dynamic memory allocation. 14 | // You are strongly encouraged to consider using StaticJsonBuffer which is much 15 | // more suitable for embedded systems. 16 | typedef Internals::BlockJsonBuffer 17 | DynamicJsonBuffer; 18 | } 19 | -------------------------------------------------------------------------------- /libraries/LiquidCrystal/library.properties: -------------------------------------------------------------------------------- 1 | name=LiquidCrystal 2 | version=1.0.5 3 | author=Arduino, Adafruit 4 | maintainer=Arduino 5 | sentence=Allows communication with alphanumerical liquid crystal displays (LCDs). 6 | paragraph=This library allows an Arduino/Genuino board to control LiquidCrystal displays (LCDs) based on the Hitachi HD44780 (or a compatible) chipset, which is found on most text-based LCDs. The library works with in either 4 or 8 bit mode (i.e. using 4 or 8 data lines in addition to the rs, enable, and, optionally, the rw control lines). 7 | category=Display 8 | url=http://www.arduino.cc/en/Reference/LiquidCrystal 9 | architectures=* 10 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/Internals/JsonBufferAllocated.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "../JsonBuffer.hpp" 11 | 12 | namespace ArduinoJson { 13 | namespace Internals { 14 | 15 | class JsonBufferAllocated { 16 | public: 17 | void *operator new(size_t n, JsonBuffer *jsonBuffer) throw() { 18 | if (!jsonBuffer) return NULL; 19 | return jsonBuffer->alloc(n); 20 | } 21 | 22 | void operator delete(void *, JsonBuffer *) throw() {} 23 | }; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/Internals/JsonInteger.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "../Configuration.hpp" 11 | 12 | namespace ArduinoJson { 13 | namespace Internals { 14 | 15 | #if ARDUINOJSON_USE_LONG_LONG 16 | typedef long long JsonInteger; 17 | typedef unsigned long long JsonUInt; 18 | #elif ARDUINOJSON_USE_INT64 19 | typedef __int64 JsonInteger; 20 | typedef unsigned _int64 JsonUInt; 21 | #else 22 | typedef long JsonInteger; 23 | typedef unsigned long JsonUInt; 24 | #endif 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/Internals/ListNode.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include // for NULL 11 | 12 | #include "JsonBufferAllocated.hpp" 13 | 14 | namespace ArduinoJson { 15 | namespace Internals { 16 | 17 | // A node for a singly-linked list. 18 | // Used by List and its iterators. 19 | template 20 | struct ListNode : public Internals::JsonBufferAllocated { 21 | ListNode() : next(NULL) {} 22 | 23 | ListNode *next; 24 | T content; 25 | }; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "ArduinoJson/DynamicJsonBuffer.hpp" 11 | #include "ArduinoJson/JsonArray.hpp" 12 | #include "ArduinoJson/JsonObject.hpp" 13 | #include "ArduinoJson/StaticJsonBuffer.hpp" 14 | 15 | #include "ArduinoJson/Internals/JsonParser.ipp" 16 | #include "ArduinoJson/JsonArray.ipp" 17 | #include "ArduinoJson/JsonBuffer.ipp" 18 | #include "ArduinoJson/JsonObject.ipp" 19 | #include "ArduinoJson/JsonVariant.ipp" 20 | 21 | using namespace ArduinoJson; 22 | -------------------------------------------------------------------------------- /libraries/DS3231/hardware/pic32/HW_PIC32_defines.h: -------------------------------------------------------------------------------- 1 | // *** Hardwarespecific defines *** 2 | 3 | #if !defined(_UP_MCU_) 4 | #if defined(__32MX320F128H__) 5 | #define SDA 18 // A4 (Remeber to set the jumper correctly) 6 | #define SCL 19 // A5 (Remeber to set the jumper correctly) 7 | #elif defined(__32MX340F512H__) 8 | #define SDA 18 // A4 (Remeber to set the jumper correctly) 9 | #define SCL 19 // A5 (Remeber to set the jumper correctly) 10 | #elif defined(__32MX795F512L__) 11 | #define SDA 20 // Digital 20 12 | #define SCL 21 // Digital 21 13 | #else 14 | #error "Unsupported PIC32 MCU!" 15 | #endif 16 | #endif 17 | 18 | #ifndef TWI_FREQ 19 | #define TWI_FREQ 400000L 20 | #endif 21 | 22 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/JsonObjectKey.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "String.hpp" 11 | 12 | namespace ArduinoJson { 13 | 14 | // Represents a key in a JsonObject 15 | class JsonObjectKey { 16 | public: 17 | JsonObjectKey(const char* key) : _value(key), _needs_copy(false) {} 18 | JsonObjectKey(const String& key) : _value(key.c_str()), _needs_copy(true) {} 19 | 20 | const char* c_str() const { return _value; } 21 | bool needs_copy() const { return _needs_copy; } 22 | 23 | private: 24 | const char* _value; 25 | bool _needs_copy; 26 | }; 27 | } 28 | -------------------------------------------------------------------------------- /libraries/Adafruit_NeoPixel/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map For Adafruit_NeoPixel 3 | ####################################### 4 | # Class 5 | ####################################### 6 | 7 | Adafruit_NeoPixel KEYWORD1 8 | 9 | ####################################### 10 | # Methods and Functions 11 | ####################################### 12 | 13 | setPixelColor KEYWORD2 14 | setPin KEYWORD2 15 | setBrightness KEYWORD2 16 | numPixels KEYWORD2 17 | getPixelColor KEYWORD2 18 | Color KEYWORD2 19 | 20 | ####################################### 21 | # Constants 22 | ####################################### 23 | 24 | NEO_GRB LITERAL1 25 | NEO_COLMASK LITERAL1 26 | NEO_KHZ800 LITERAL1 27 | NEO_SPDMASK LITERAL1 28 | NEO_RGB LITERAL1 29 | NEO_KHZ400 LITERAL1 30 | -------------------------------------------------------------------------------- /libraries/SD/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map SD 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | SD KEYWORD1 SD 10 | File KEYWORD1 SD 11 | SDFile KEYWORD1 SD 12 | 13 | ####################################### 14 | # Methods and Functions (KEYWORD2) 15 | ####################################### 16 | begin KEYWORD2 17 | exists KEYWORD2 18 | mkdir KEYWORD2 19 | remove KEYWORD2 20 | rmdir KEYWORD2 21 | open KEYWORD2 22 | close KEYWORD2 23 | seek KEYWORD2 24 | position KEYWORD2 25 | size KEYWORD2 26 | 27 | ####################################### 28 | # Constants (LITERAL1) 29 | ####################################### 30 | FILE_READ LITERAL1 31 | FILE_WRITE LITERAL1 32 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/Print.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #ifndef ARDUINO 11 | 12 | #include 13 | #include 14 | 15 | namespace ArduinoJson { 16 | // This class reproduces Arduino's Print class 17 | class Print { 18 | public: 19 | virtual ~Print() {} 20 | 21 | virtual size_t write(uint8_t) = 0; 22 | 23 | size_t print(const char* s) { 24 | size_t n = 0; 25 | while (*s) { 26 | n += write(*s++); 27 | } 28 | return n; 29 | } 30 | 31 | size_t println() { return write('\r') + write('\n'); } 32 | }; 33 | } 34 | 35 | #else 36 | 37 | #include 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/TypeTraits/IsIntegral.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "../Configuration.hpp" 11 | #include "IsSame.hpp" 12 | #include "IsSignedIntegral.hpp" 13 | #include "IsUnsignedIntegral.hpp" 14 | 15 | namespace ArduinoJson { 16 | namespace TypeTraits { 17 | 18 | // A meta-function that returns true if T is an integral type. 19 | template 20 | struct IsIntegral { 21 | static const bool value = TypeTraits::IsSignedIntegral::value || 22 | TypeTraits::IsUnsignedIntegral::value || 23 | TypeTraits::IsSame::value; 24 | }; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Core.h: -------------------------------------------------------------------------------- 1 | /* 2 | * DROMatic.ino 3 | * DROMatic OS Core 4 | * Devin R. Olsen - July 4th, 2017 5 | * devin@devinrolsen.com 6 | */ 7 | 8 | #ifndef _CORE_h 9 | #define _CORE_h 10 | 11 | #include "Globals.h" 12 | #include 13 | #include //Arduno Json (aka epic) 14 | 15 | 16 | extern JsonObject& getCoreData(JsonBuffer& b); 17 | extern void setCoreData(JsonObject& d); 18 | extern void coreInit(); 19 | extern void correctPlantPH(); 20 | extern void correctRsvrPH(); 21 | extern void correctPlantEC(); 22 | extern void correctRsvrEC(); 23 | extern float getPHProbeValue(byte channel); 24 | extern int getECProbeValue(byte channel); 25 | 26 | 27 | //Helper Functions 28 | extern void RelayToggle(int channel, bool gate); 29 | extern void makeNewFile(String path, JsonObject& data); 30 | extern int tmpIntsToInt(byte decimalPlaces); 31 | extern void resetTimestamps(); 32 | #endif 33 | 34 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/cassert: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2005 Garrett A. Kajmowicz 2 | 3 | This file is part of the uClibc++ Library. 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | */ 18 | 19 | #include 20 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/cerrno: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2005 Garrett A. Kajmowicz 2 | 3 | This file is part of the uClibc++ Library. 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | */ 18 | 19 | #include 20 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/Internals/DynamicStringBuilder.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "../Print.hpp" 11 | #include "../String.hpp" 12 | 13 | namespace ArduinoJson { 14 | namespace Internals { 15 | 16 | // A Print implementation that allows to write in a String 17 | class DynamicStringBuilder : public Print { 18 | public: 19 | DynamicStringBuilder(String &str) : _str(str) {} 20 | 21 | virtual size_t write(uint8_t c) { 22 | // Need to cast to char, otherwise String will print a number (issue #120) 23 | _str += static_cast(c); 24 | return 1; 25 | } 26 | 27 | private: 28 | DynamicStringBuilder &operator=(const DynamicStringBuilder &); 29 | 30 | String &_str; 31 | }; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/DatesTime.h: -------------------------------------------------------------------------------- 1 | /* 2 | * DROMatic.ino 3 | * DROMatic OS DateTime 4 | * Devin R. Olsen - July 4th, 2017 5 | * devin@devinrolsen.com 6 | */ 7 | 8 | #ifndef _DATESTIME_h 9 | #define _DATESTIME_h 10 | #include "Globals.h" 11 | 12 | extern byte currentMinute, previousMinute, days[12]; 13 | extern unsigned long menuMillis, homeMillis, flowMillis, ecMillis, phRsvrMillis, phPlantMillis; //stores last time 14 | 15 | //Read & Write from SD 16 | extern void captureDateTime(); 17 | extern void captureSessionDateTime(); 18 | 19 | //Prints 20 | extern void printDateTime(int dir = 0); 21 | 22 | //Saves 23 | extern void saveDateTime(); 24 | 25 | //Helpers 26 | extern void captureDateTimeDisplays(int month = tmpInts[1], int day = tmpInts[2], int hour = tmpInts[4], int min = tmpInts[5]); 27 | extern int calculateDayOfYear(int day, int month, int year); 28 | extern byte calcDayOfWeek(unsigned int y, byte m, byte d); 29 | 30 | #endif 31 | 32 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/Internals/StaticStringBuilder.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "../Print.hpp" 11 | 12 | namespace ArduinoJson { 13 | namespace Internals { 14 | 15 | // A Print implementation that allows to write in a char[] 16 | class StaticStringBuilder : public Print { 17 | public: 18 | StaticStringBuilder(char *buf, size_t size) 19 | : buffer(buf), capacity(size - 1), length(0) { 20 | buffer[0] = '\0'; 21 | } 22 | 23 | virtual size_t write(uint8_t c) { 24 | if (length >= capacity) return 0; 25 | 26 | buffer[length++] = c; 27 | buffer[length] = '\0'; 28 | return 1; 29 | } 30 | 31 | private: 32 | char *buffer; 33 | size_t capacity; 34 | size_t length; 35 | }; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/Internals/StreamPrintAdapter.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "../Configuration.hpp" 11 | 12 | #if ARDUINOJSON_ENABLE_STD_STREAM 13 | 14 | #include "../Print.hpp" 15 | 16 | #include 17 | 18 | namespace ArduinoJson { 19 | namespace Internals { 20 | 21 | class StreamPrintAdapter : public Print { 22 | public: 23 | explicit StreamPrintAdapter(std::ostream& os) : _os(os) {} 24 | 25 | virtual size_t write(uint8_t c) { 26 | _os << static_cast(c); 27 | return 1; 28 | } 29 | 30 | private: 31 | // cannot be assigned 32 | StreamPrintAdapter& operator=(const StreamPrintAdapter&); 33 | 34 | std::ostream& _os; 35 | }; 36 | } 37 | } 38 | 39 | #endif // ARDUINOJSON_ENABLE_STD_STREAM 40 | -------------------------------------------------------------------------------- /libraries/Adafruit_NeoPixel/README.md: -------------------------------------------------------------------------------- 1 | # Adafruit NeoPixel Library [![Build Status](https://travis-ci.org/adafruit/Adafruit_NeoPixel.svg?branch=master)](https://travis-ci.org/adafruit/Adafruit_NeoPixel) 2 | 3 | Arduino library for controlling single-wire-based LED pixels and strip such as the [Adafruit 60 LED/meter Digital LED strip][strip], the [Adafruit FLORA RGB Smart Pixel][flora], the [Adafruit Breadboard-friendly RGB Smart Pixel][pixel], the [Adafruit NeoPixel Stick][stick], and the [Adafruit NeoPixel Shield][shield]. 4 | 5 | After downloading, rename folder to 'Adafruit_NeoPixel' and install in Arduino Libraries folder. Restart Arduino IDE, then open File->Sketchbook->Library->Adafruit_NeoPixel->strandtest sketch. 6 | 7 | [flora]: http://adafruit.com/products/1060 8 | [strip]: http://adafruit.com/products/1138 9 | [pixel]: http://adafruit.com/products/1312 10 | [stick]: http://adafruit.com/products/1426 11 | [shield]: http://adafruit.com/products/1430 12 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/Internals/JsonVariantContent.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "JsonFloat.hpp" 11 | #include "JsonInteger.hpp" 12 | 13 | namespace ArduinoJson { 14 | 15 | // Forward declarations 16 | class JsonArray; 17 | class JsonObject; 18 | 19 | namespace Internals { 20 | // A union that defines the actual content of a JsonVariant. 21 | // The enum JsonVariantType determines which member is in use. 22 | union JsonVariantContent { 23 | JsonFloat asFloat; // used for double and float 24 | JsonUInt asInteger; // used for bool, char, short, int and longs 25 | const char* asString; // asString can be null 26 | JsonArray* asArray; // asArray cannot be null 27 | JsonObject* asObject; // asObject cannot be null 28 | }; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/limits.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2006 Garrett A. Kajmowicz 2 | This file is part of the uClibc++ Library. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | */ 19 | 20 | #include 21 | 22 | namespace std{ 23 | 24 | 25 | } 26 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/bitset.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2004 Garrett A. Kajmowicz 2 | This file is part of the uClibc++ Library. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | */ 19 | 20 | #include 21 | 22 | namespace std{ 23 | 24 | 25 | 26 | } 27 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/numeric.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2004 Garrett A. Kajmowicz 2 | 3 | This file is part of the uClibc++ Library. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include 21 | 22 | namespace std{ 23 | 24 | 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/queue.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2004 Garrett A. Kajmowicz 2 | This file is part of the uClibc++ Library. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | */ 18 | 19 | #include 20 | 21 | 22 | namespace std{ 23 | 24 | 25 | 26 | 27 | } 28 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/stack.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2004 Garrett A. Kajmowicz 2 | This file is part of the uClibc++ Library. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | */ 18 | 19 | #include 20 | 21 | 22 | namespace std{ 23 | 24 | 25 | 26 | 27 | } 28 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/iterator.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2004 Garrett A. Kajmowicz 2 | 3 | This file is part of the uClibc++ Library. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include 21 | 22 | namespace std{ 23 | 24 | 25 | 26 | } 27 | 28 | 29 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/list.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2004 Garrett A. Kajmowicz 2 | 3 | This file is part of the uClibc++ Library. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include 21 | 22 | namespace std{ 23 | 24 | 25 | 26 | 27 | } 28 | 29 | 30 | -------------------------------------------------------------------------------- /libraries/SPI/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map SPI 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | SPI KEYWORD1 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | begin KEYWORD2 15 | end KEYWORD2 16 | transfer KEYWORD2 17 | setBitOrder KEYWORD2 18 | setDataMode KEYWORD2 19 | setClockDivider KEYWORD2 20 | 21 | 22 | ####################################### 23 | # Constants (LITERAL1) 24 | ####################################### 25 | SPI_CLOCK_DIV4 LITERAL1 26 | SPI_CLOCK_DIV16 LITERAL1 27 | SPI_CLOCK_DIV64 LITERAL1 28 | SPI_CLOCK_DIV128 LITERAL1 29 | SPI_CLOCK_DIV2 LITERAL1 30 | SPI_CLOCK_DIV8 LITERAL1 31 | SPI_CLOCK_DIV32 LITERAL1 32 | SPI_CLOCK_DIV64 LITERAL1 33 | SPI_MODE0 LITERAL1 34 | SPI_MODE1 LITERAL1 35 | SPI_MODE2 LITERAL1 36 | SPI_MODE3 LITERAL1 -------------------------------------------------------------------------------- /libraries/StandardCplusplus/associative_base.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2007 Garrett A. Kajmowicz 2 | This file is part of the uClibc++ Library. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | */ 19 | 20 | #include 21 | 22 | namespace std{ 23 | 24 | 25 | 26 | } 27 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/iomanip.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2005 Garrett A. Kajmowicz 2 | 3 | This file is part of the uClibc++ Library. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include 21 | 22 | namespace std{ 23 | 24 | 25 | 26 | 27 | } 28 | 29 | 30 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/valarray.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2004 Garrett A. Kajmowicz 2 | 3 | This file is part of the uClibc++ Library. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include 21 | 22 | namespace std{ 23 | 24 | 25 | 26 | 27 | } 28 | 29 | 30 | -------------------------------------------------------------------------------- /libraries/SD/README.adoc: -------------------------------------------------------------------------------- 1 | = SD Library for Arduino = 2 | 3 | The SD library allows for reading from and writing to SD cards. 4 | 5 | For more information about this library please visit us at 6 | http://www.arduino.cc/en/Reference/SD 7 | 8 | == License == 9 | 10 | Copyright (C) 2009 by William Greiman 11 | Copyright (c) 2010 SparkFun Electronics 12 | 13 | This program is free software: you can redistribute it and/or modify 14 | it under the terms of the GNU General Public License as published by 15 | the Free Software Foundation, either version 3 of the License, or 16 | (at your option) any later version. 17 | 18 | This program is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | GNU General Public License for more details. 22 | 23 | You should have received a copy of the GNU General Public License 24 | along with this program. If not, see . 25 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/algorithm.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2004 Garrett A. Kajmowicz 2 | This file is part of the uClibc++ Library. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | */ 19 | 20 | 21 | #include 22 | 23 | 24 | namespace std{ 25 | 26 | 27 | 28 | } 29 | 30 | 31 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/utility.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2004 Garrett A. Kajmowicz 2 | This file is part of the uClibc++ Library. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | */ 19 | 20 | 21 | #include 22 | 23 | 24 | namespace std{ 25 | 26 | 27 | 28 | } 29 | 30 | 31 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/map.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2004 Garrett A. Kajmowicz 2 | This file is part of the uClibc++ Library. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | */ 19 | 20 | #include 21 | 22 | namespace std{ 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | } 34 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/set.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2004 Garrett A. Kajmowicz 2 | This file is part of the uClibc++ Library. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | */ 19 | 20 | #include 21 | 22 | namespace std{ 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | } 34 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/Internals/ReferenceType.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | namespace ArduinoJson { 11 | namespace Internals { 12 | 13 | // A type that is meant to be used by reference only (JsonArray and JsonObject) 14 | class ReferenceType { 15 | public: 16 | bool operator==(const ReferenceType& other) const { 17 | // two JsonArray are equal if they are the same instance 18 | // (we don't compare the content) 19 | return this == &other; 20 | } 21 | 22 | bool operator!=(const ReferenceType& other) const { return this != &other; } 23 | 24 | protected: 25 | ReferenceType() {} 26 | 27 | private: 28 | // copy constructor is private 29 | ReferenceType(const ReferenceType&); 30 | 31 | // copy operator is private 32 | ReferenceType& operator=(const ReferenceType&); 33 | }; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /libraries/LiquidCrystal/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map For LiquidCrystal 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | LiquidCrystal KEYWORD1 LiquidCrystal 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | 15 | begin KEYWORD2 16 | clear KEYWORD2 17 | home KEYWORD2 18 | print KEYWORD2 19 | setCursor KEYWORD2 20 | cursor KEYWORD2 21 | noCursor KEYWORD2 22 | blink KEYWORD2 23 | noBlink KEYWORD2 24 | display KEYWORD2 25 | noDisplay KEYWORD2 26 | autoscroll KEYWORD2 27 | noAutoscroll KEYWORD2 28 | leftToRight KEYWORD2 29 | rightToLeft KEYWORD2 30 | scrollDisplayLeft KEYWORD2 31 | scrollDisplayRight KEYWORD2 32 | createChar KEYWORD2 33 | setRowOffsets KEYWORD2 34 | 35 | ####################################### 36 | # Constants (LITERAL1) 37 | ####################################### 38 | 39 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/climits: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2004 Garrett A. Kajmowicz 2 | 3 | This file is part of the uClibc++ Library. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef __STD_HEADER_CLIMITS 21 | #define __STD_HEADER_CLIMITS 1 22 | 23 | 24 | #include 25 | 26 | 27 | #endif 28 | 29 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/complex.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2005 Garrett A. Kajmowicz 2 | This file is part of the uClibc++ Library. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | */ 18 | 19 | #include 20 | 21 | 22 | namespace std{ 23 | 24 | 25 | template class _UCXXEXPORT complex; 26 | 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/Timers.h: -------------------------------------------------------------------------------- 1 | /* 2 | * DROMatic.ino 3 | * DROMatic OS Timers 4 | * Devin R. Olsen - July 4th, 2017 5 | * devin@devinrolsen.com 6 | */ 7 | 8 | #ifndef _TIMERS_h 9 | #define _TIMERS_h 10 | #include "Globals.h" 11 | #include //Arduno Json (aka epic) 12 | 13 | extern byte currentTimerIndex, currentTimerSessionIndex, currentTimerSessionDayIndex; 14 | 15 | //Read & Write from SD 16 | extern JsonObject& getTimerData(JsonBuffer& b); 17 | extern void setTimerData(JsonObject& d); 18 | extern JsonObject& getTimerSessionData(JsonBuffer& b, int timerIndex = currentTimerIndex, int weekIndex = currentTimerSessionIndex); 19 | extern void setTimerSessionData(JsonObject& d, int timerIndex = currentTimerIndex, int weekIndex = currentTimerSessionIndex); 20 | extern void checkTimers(); 21 | //Print 22 | extern void printTimerWeeks(int dir); 23 | extern void printTimerStartEnd(int dir); 24 | 25 | //Saves 26 | extern void saveStartEnd(); 27 | 28 | //Helpers 29 | extern JsonObject& newTimerSessionData(); 30 | 31 | #endif 32 | 33 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/cfloat: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2004 Garrett A. Kajmowicz 2 | 3 | This file is part of the uClibc++ Library. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include 21 | 22 | #ifndef __STD_HEADER_CFLOAT 23 | #define __STD_HEADER_CFLOAT 1 24 | 25 | 26 | #include 27 | 28 | 29 | #endif 30 | 31 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/Internals/JsonVariantAs.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | namespace ArduinoJson { 11 | namespace Internals { 12 | 13 | // A metafunction that returns the type of the value returned by 14 | // JsonVariant::as() 15 | template 16 | struct JsonVariantAs { 17 | typedef T type; 18 | }; 19 | 20 | template <> 21 | struct JsonVariantAs { 22 | typedef const char* type; 23 | }; 24 | 25 | template <> 26 | struct JsonVariantAs { 27 | typedef JsonArray& type; 28 | }; 29 | 30 | template <> 31 | struct JsonVariantAs { 32 | typedef const JsonArray& type; 33 | }; 34 | 35 | template <> 36 | struct JsonVariantAs { 37 | typedef JsonObject& type; 38 | }; 39 | 40 | template <> 41 | struct JsonVariantAs { 42 | typedef const JsonObject& type; 43 | }; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/locale.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2004 Garrett A. Kajmowicz 2 | 3 | This file is part of the uClibc++ Library. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | namespace std{ 27 | 28 | } 29 | 30 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/deque.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2004 Garrett A. Kajmowicz 2 | This file is part of the uClibc++ Library. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | */ 19 | 20 | #include 21 | 22 | 23 | namespace std{ 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | } 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/Polyfills/normalize.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | namespace ArduinoJson { 11 | namespace Polyfills { 12 | 13 | #ifdef ARDUINO 14 | 15 | // on embedded platform, favor code size over speed 16 | 17 | template 18 | short normalize(T& value) { 19 | short powersOf10 = 0; 20 | while (value && value < 1) { 21 | powersOf10--; 22 | value *= 10; 23 | } 24 | while (value > 10) { 25 | powersOf10++; 26 | value /= 10; 27 | } 28 | return powersOf10; 29 | } 30 | 31 | #else 32 | 33 | // on non-embedded platform, favor speed over code size 34 | 35 | template 36 | short normalize(T& value) { 37 | if (value == 0.0) return 0; 38 | 39 | short powersOf10 = static_cast(floor(log10(value))); 40 | value /= pow(T(10), powersOf10); 41 | 42 | return powersOf10; 43 | } 44 | 45 | #endif 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /libraries/DS3231/keywords.txt: -------------------------------------------------------------------------------- 1 | DS3231 KEYWORD1 2 | Time KEYWORD1 3 | 4 | begin KEYWORD2 5 | getTime KEYWORD2 6 | setTime KEYWORD2 7 | setDate KEYWORD2 8 | setDOW KEYWORD2 9 | getTimeStr KEYWORD2 10 | getDateStr KEYWORD2 11 | getDOWStr KEYWORD2 12 | getMonthStr KEYWORD2 13 | getUnixTime KEYWORD2 14 | enable32KHz KEYWORD2 15 | setOutput KEYWORD2 16 | setSQWRate KEYWORD2 17 | getTemp KEYWORD2 18 | 19 | hour KEYWORD2 20 | min KEYWORD2 21 | sec KEYWORD2 22 | date KEYWORD2 23 | mon KEYWORD2 24 | year KEYWORD2 25 | dow KEYWORD2 26 | 27 | FORMAT_SHORT LITERAL1 28 | FORMAT_LONG LITERAL1 29 | 30 | FORMAT_LITTLEENDIAN LITERAL1 31 | FORMAT_BIGENDIAN LITERAL1 32 | FORMAT_MIDDLEENDIAN LITERAL1 33 | 34 | MONDAY LITERAL1 35 | TUESDAY LITERAL1 36 | WEDNESDAY LITERAL1 37 | THURSDAY LITERAL1 38 | FRIDAY LITERAL1 39 | SATURDAY LITERAL1 40 | SUNDAY LITERAL1 41 | 42 | SQW_RATE_1 LITERAL1 43 | SQW_RATE_1K LITERAL1 44 | SQW_RATE_4K LITERAL1 45 | SQW_RATE_8K LITERAL1 46 | 47 | OUTPUT_SQW LITERAL1 48 | OUTPUT_INT LITERAL1 49 | 50 | SDA LITERAL1 51 | SCL LITERAL1 52 | SDA1 LITERAL1 53 | SCL1 LITERAL1 54 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/Internals/Encoding.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "../Print.hpp" 11 | 12 | namespace ArduinoJson { 13 | namespace Internals { 14 | 15 | class Encoding { 16 | public: 17 | // Optimized for code size on a 8-bit AVR 18 | static char escapeChar(char c) { 19 | const char *p = escapeTable(false); 20 | while (p[0] && p[1] != c) { 21 | p += 2; 22 | } 23 | return p[0]; 24 | } 25 | 26 | // Optimized for code size on a 8-bit AVR 27 | static char unescapeChar(char c) { 28 | const char *p = escapeTable(true); 29 | for (;;) { 30 | if (p[0] == '\0') return c; 31 | if (p[0] == c) return p[1]; 32 | p += 2; 33 | } 34 | } 35 | 36 | private: 37 | static const char *escapeTable(bool excludeIdenticals) { 38 | return &"\"\"\\\\b\bf\fn\nr\rt\t"[excludeIdenticals ? 4 : 0]; 39 | } 40 | }; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/Pumps.h: -------------------------------------------------------------------------------- 1 | /* 2 | * DROMatic.ino 3 | * DROMatic OS Pumps 4 | * Devin R. Olsen - July 4th, 2017 5 | * devin@devinrolsen.com 6 | */ 7 | 8 | #ifndef _PUMPS_h 9 | #define _PUMPS_h 10 | #include "Globals.h" 11 | #include //Arduno Json (aka epic) 12 | extern byte currentPumpIndex; 13 | 14 | //Read & Write from SD 15 | extern JsonObject& getPumpsData(JsonBuffer& b); 16 | extern void setPumpsData(JsonObject& d); 17 | extern JsonObject& getPumpData(JsonBuffer& b, byte pumpIndex = currentPumpIndex); 18 | extern void setPumpData(JsonObject& d, byte pumpIndex = currentPumpIndex, bool returnHome = true); 19 | 20 | //Prints 21 | extern void printPumpCalibration(int dir = 0); 22 | extern void printPumpDelay(int dir = 0); 23 | 24 | //Saves 25 | extern void savePumpCalibration(); 26 | extern void savePumpDelay(); 27 | 28 | //Helpers 29 | extern void pumpCreate(String path, byte pumpIndex, int totalRegimens, JsonObject& sessionData); 30 | extern void primePump(int dir); 31 | extern void pumpSpin(float setAmount, int pumpNumber); 32 | 33 | 34 | 35 | 36 | 37 | 38 | #endif 39 | 40 | -------------------------------------------------------------------------------- /src/Regimens.h: -------------------------------------------------------------------------------- 1 | /* 2 | * DROMatic.ino 3 | * DROMatic OS Regimens 4 | * Devin R. Olsen - July 4th, 2017 5 | * devin@devinrolsen.com 6 | */ 7 | 8 | #ifndef _SESSIONS_h 9 | #define _SESSIONS_h 10 | #include "Globals.h" 11 | #include "Pumps.h" 12 | #include //Arduno Json (aka epic) 13 | 14 | extern byte currentRegimenIndex; 15 | 16 | //Read & Write from SD 17 | extern JsonObject& getRegimenData(JsonBuffer& b, byte pumpIndex = currentPumpIndex, byte sessionIndex = currentRegimenIndex); 18 | extern void setRegimenData(JsonObject& d, byte pumpIndex = currentPumpIndex, byte sessionIndex = currentRegimenIndex, bool returnHome = true); 19 | 20 | //Prints 21 | extern void printRegimenNumber(int dir); 22 | extern void printRegimenAmount(int dir = 0); 23 | 24 | //Saves 25 | extern void saveRegimenAmount(); 26 | 27 | //Helpers 28 | extern void addRegimens(int currentSize, int addAmount); 29 | extern void trimRegimens(int currentSize, int trimAmount); 30 | extern void moveToNextRegimen(); 31 | 32 | //Dosing functionality 33 | extern void checkRegimenDosing(); 34 | 35 | #endif 36 | 37 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/del_opv.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2004 Garrett A. Kajmowicz 2 | 3 | This file is part of the uClibc++ Library. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | // Arduino now defines this. 25 | //_UCXXEXPORT void operator delete[](void * ptr) throw(){ 26 | // free(ptr); 27 | //} 28 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/typeinfo.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2004 Garrett A. Kajmowicz 2 | 3 | This file is part of the uClibc++ Library. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include 21 | 22 | namespace std{ 23 | 24 | _UCXXEXPORT bad_cast::~bad_cast() throw(){ 25 | 26 | } 27 | 28 | _UCXXEXPORT bad_typeid::~bad_typeid() throw(){ 29 | 30 | } 31 | 32 | } 33 | 34 | 35 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/del_opnt.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2004 Garrett A. Kajmowicz 2 | 3 | This file is part of the uClibc++ Library. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | #ifndef NO_NOTHROW 25 | _UCXXEXPORT void operator delete(void* ptr, const std::nothrow_t& ) throw() { 26 | free(ptr); 27 | } 28 | #endif 29 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/Internals/ListConstIterator.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "ListNode.hpp" 11 | 12 | namespace ArduinoJson { 13 | namespace Internals { 14 | 15 | // A read-only forward itertor for List 16 | template 17 | class ListConstIterator { 18 | public: 19 | explicit ListConstIterator(const ListNode *node = NULL) : _node(node) {} 20 | 21 | const T &operator*() const { return _node->content; } 22 | const T *operator->() { return &_node->content; } 23 | 24 | bool operator==(const ListConstIterator &other) const { 25 | return _node == other._node; 26 | } 27 | 28 | bool operator!=(const ListConstIterator &other) const { 29 | return _node != other._node; 30 | } 31 | 32 | ListConstIterator &operator++() { 33 | if (_node) _node = _node->next; 34 | return *this; 35 | } 36 | 37 | private: 38 | const ListNode *_node; 39 | }; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/del_opvnt.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2004 Garrett A. Kajmowicz 2 | 3 | This file is part of the uClibc++ Library. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | #ifndef NO_NOTHROW 25 | _UCXXEXPORT void operator delete[](void* ptr, const std::nothrow_t& ) throw(){ 26 | free(ptr); 27 | } 28 | #endif 29 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/clocale: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2005 Garrett A. Kajmowicz 2 | This file is part of the uClibc++ Library. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | */ 18 | 19 | #ifndef __STD_HEADER_CLOCALE 20 | #define __STD_HEADER_CLOCALE 1 21 | 22 | #include 23 | 24 | namespace std { 25 | using ::lconv; 26 | using ::setlocale; 27 | using ::localeconv; 28 | } 29 | 30 | #endif // __STD_HEADER_CLOCALE 31 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/new_opnt.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2004 Garrett A. Kajmowicz 2 | 3 | This file is part of the uClibc++ Library. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | #ifndef NO_NOTHROW 25 | _UCXXEXPORT void* operator new(std::size_t numBytes, const std::nothrow_t& ) throw(){ 26 | return malloc(numBytes); 27 | } 28 | #endif 29 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/new_opvnt.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2004 Garrett A. Kajmowicz 2 | 3 | This file is part of the uClibc++ Library. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | #ifndef NO_NOTHROW 25 | _UCXXEXPORT void* operator new[](std::size_t numBytes, const std::nothrow_t& ) throw(){ 26 | return malloc(numBytes); 27 | } 28 | #endif 29 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/TypeTraits/IsSignedIntegral.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "../Configuration.hpp" 11 | #include "IsSame.hpp" 12 | 13 | namespace ArduinoJson { 14 | namespace TypeTraits { 15 | 16 | // A meta-function that returns true if T is an integral type. 17 | template 18 | struct IsSignedIntegral { 19 | static const bool value = TypeTraits::IsSame::value || 20 | TypeTraits::IsSame::value || 21 | TypeTraits::IsSame::value || 22 | TypeTraits::IsSame::value || 23 | #if ARDUINOJSON_USE_LONG_LONG 24 | TypeTraits::IsSame::value || 25 | #endif 26 | 27 | #if ARDUINOJSON_USE_INT64 28 | TypeTraits::IsSame::value || 29 | #endif 30 | false; 31 | }; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/TypeTraits/IsUnsignedIntegral.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "../Configuration.hpp" 11 | #include "IsSame.hpp" 12 | 13 | namespace ArduinoJson { 14 | namespace TypeTraits { 15 | 16 | // A meta-function that returns true if T is an integral type. 17 | template 18 | struct IsUnsignedIntegral { 19 | static const bool value = TypeTraits::IsSame::value || 20 | TypeTraits::IsSame::value || 21 | TypeTraits::IsSame::value || 22 | TypeTraits::IsSame::value || 23 | #if ARDUINOJSON_USE_LONG_LONG 24 | TypeTraits::IsSame::value || 25 | #endif 26 | 27 | #if ARDUINOJSON_USE_INT64 28 | TypeTraits::IsSame::value || 29 | #endif 30 | false; 31 | }; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/del_op.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2004 Garrett A. Kajmowicz 2 | 3 | This file is part of the uClibc++ Library. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | // Arduino 1.0 contains an implementation for this. 21 | #if ! defined(ARDUINO) || ( ARDUINO < 100 ) 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | _UCXXEXPORT void operator delete(void* ptr) throw(){ 28 | free(ptr); 29 | } 30 | #endif 31 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/Internals/ListIterator.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "ListNode.hpp" 11 | #include "ListConstIterator.hpp" 12 | 13 | namespace ArduinoJson { 14 | namespace Internals { 15 | 16 | // A read-write forward iterator for List 17 | template 18 | class ListIterator { 19 | public: 20 | explicit ListIterator(ListNode *node = NULL) : _node(node) {} 21 | 22 | T &operator*() const { return _node->content; } 23 | T *operator->() { return &_node->content; } 24 | 25 | bool operator==(const ListIterator &other) const { 26 | return _node == other._node; 27 | } 28 | 29 | bool operator!=(const ListIterator &other) const { 30 | return _node != other._node; 31 | } 32 | 33 | ListIterator &operator++() { 34 | if (_node) _node = _node->next; 35 | return *this; 36 | } 37 | 38 | operator ListConstIterator() const { return ListConstIterator(_node); } 39 | 40 | private: 41 | ListNode *_node; 42 | }; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/Irrigation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * DROMatic.ino 3 | * DROMatic OS Irrigation 4 | * Devin R. Olsen - July 4th, 2017 5 | * devin@devinrolsen.com 6 | */ 7 | 8 | #ifndef _IRRIGATION_h 9 | #define _IRRIGATION_h 10 | #include //Arduno Json (aka epic) 11 | 12 | extern JsonObject& getIrrigationData(JsonBuffer& b); 13 | extern void setIrrigationData(JsonObject& d); 14 | 15 | //Prints 16 | extern void printReservoirVolume(); 17 | extern void printTopOffConcentrate(int dir = 0); 18 | extern void printTopOffAmount(int dir = 0); 19 | extern void printTopOffDelay(int dir = 0); 20 | extern void printDrainTime(int dir = 0); 21 | extern void printFlowCalibration(int dir = 0); 22 | extern void printFullFlushing(); 23 | 24 | //Saves 25 | extern void saveReservoirVolume(); 26 | extern void saveTopOffConcentrate(); 27 | extern void saveTopOffAmount(); 28 | extern void saveTopOffDelay(); 29 | extern void saveFlowCalibration(); 30 | extern void saveDrainTime(); 31 | 32 | //Helpers 33 | extern void feedPlants(int min = 0, int sec = 0); 34 | extern void drainPlants(int min = 0, int sec = 0); 35 | extern void checkFlowRates(); 36 | extern void countRsvrFill(); 37 | extern void countRsvrDrain(); 38 | 39 | #endif 40 | 41 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/cctype: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2006 Garrett A. Kajmowicz 2 | 3 | This file is part of the uClibc++ Library. 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | */ 18 | 19 | #include 20 | 21 | namespace std{ 22 | 23 | using ::isalnum; 24 | using ::isalpha; 25 | using ::iscntrl; 26 | using ::isdigit; 27 | using ::isgraph; 28 | using ::islower; 29 | using ::isprint; 30 | using ::ispunct; 31 | using ::isspace; 32 | using ::isupper; 33 | using ::isxdigit; 34 | using ::tolower; 35 | using ::toupper; 36 | 37 | } 38 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/new_handler.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2005 Garrett A. Kajmowicz 2 | 3 | This file is part of the uClibc++ Library. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include 21 | 22 | const std::nothrow_t std::nothrow = { }; 23 | 24 | //Name selected to be compatable with g++ code 25 | std::new_handler __new_handler; 26 | 27 | _UCXXEXPORT std::new_handler std::set_new_handler(std::new_handler new_p) throw(){ 28 | std::new_handler retval = __new_handler; 29 | __new_handler = new_p; 30 | return retval; 31 | } 32 | -------------------------------------------------------------------------------- /libraries/LiquidCrystal/README.adoc: -------------------------------------------------------------------------------- 1 | = Liquid Crystal Library for Arduino = 2 | 3 | This library allows an Arduino board to control LiquidCrystal displays (LCDs) based on the Hitachi HD44780 (or a compatible) chipset, which is found on most text-based LCDs. 4 | 5 | For more information about this library please visit us at 6 | http://www.arduino.cc/en/Reference/LiquidCrystal 7 | 8 | == License == 9 | 10 | Copyright (C) 2006-2008 Hans-Christoph Steiner. All rights reserved. 11 | Copyright (c) 2010 Arduino LLC. All right reserved. 12 | 13 | This library is free software; you can redistribute it and/or 14 | modify it under the terms of the GNU Lesser General Public 15 | License as published by the Free Software Foundation; either 16 | version 2.1 of the License, or (at your option) any later version. 17 | 18 | This library is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 21 | Lesser General Public License for more details. 22 | 23 | You should have received a copy of the GNU Lesser General Public 24 | License along with this library; if not, write to the Free Software 25 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 26 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/csetjmp: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2004 Garrett A. Kajmowicz 2 | 3 | This file is part of the uClibc++ Library. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include 21 | 22 | #ifndef __STD_HEADER_CSETJMP 23 | #define __STD_HEADER_CSETJMP 1 24 | 25 | 26 | //From GCC Header files 27 | #undef longjmp 28 | 29 | // Adhere to section 17.4.1.2 clause 5 of ISO 14882:1998 30 | #ifndef setjmp 31 | #define setjmp(env) setjmp (env) 32 | #endif 33 | 34 | //Mine again 35 | 36 | 37 | namespace std{ 38 | using ::longjmp; 39 | using ::jmp_buf; 40 | } 41 | 42 | 43 | #endif 44 | 45 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/system_configuration.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Automatically generated C config: don't edit 3 | */ 4 | /* 5 | * Version Number 6 | */ 7 | #define __UCLIBCXX_MAJOR__ 0 8 | #define __UCLIBCXX_MINOR__ 2 9 | #define __UCLIBCXX_SUBLEVEL__ 3 10 | 11 | /* 12 | * Target Features and Options 13 | */ 14 | #define __UCLIBCXX_HAS_FLOATS__ 15 | #undef __UCLIBCXX_HAS_TLS__ 16 | #define __WARNINGS__ "-Wall" 17 | #define __BUILD_EXTRA_LIBRARIES__ "" 18 | #define __HAVE_DOT_CONFIG__ 1 19 | 20 | /* 21 | * String and I/O Stream Support 22 | */ 23 | #undef __UCLIBCXX_HAS_WCHAR__ 24 | #define __UCLIBCXX_IOSTREAM_BUFSIZE__ 32 25 | #undef __UCLIBCXX_HAS_LFS__ 26 | #undef __UCLIBCXX_SUPPORT_CDIR__ 27 | #define __UCLIBCXX_SUPPORT_COUT__ 28 | #define __UCLIBCXX_SUPPORT_CERR__ 29 | /* 30 | * STL and Code Expansion 31 | */ 32 | //#define __UCLIBCXX_STL_BUFFER_SIZE__ 32 33 | #define __UCLIBCXX_STL_BUFFER_SIZE__ 8 34 | #undef __UCLIBCXX_CODE_EXPANSION__ 35 | 36 | /* 37 | * Library Installation Options 38 | */ 39 | #define __UCLIBCXX_RUNTIME_PREFIX__ "/usr/uClibc++" 40 | #define __UCLIBCXX_RUNTIME_INCLUDE_SUBDIR__ "/include" 41 | #define __UCLIBCXX_RUNTIME_LIB_SUBDIR__ "/lib" 42 | #define __UCLIBCXX_RUNTIME_BIN_SUBDIR__ "/bin" 43 | #undef __UCLIBCXX_EXCEPTION_SUPPORT__ 44 | #define __BUILD_STATIC_LIB__ 1 45 | #define __BUILD_ONLY_STATIC_LIB__ 1 46 | #undef __DODEBUG__ 47 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/iostream.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2004 Garrett A. Kajmowicz 2 | 3 | This file is part of the uClibc++ Library. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #define __UCLIBCXX_COMPILE_IOSTREAM__ 1 21 | 22 | #include 23 | 24 | namespace std{ 25 | 26 | #ifdef __UCLIBCXX_EXPAND_OSTREAM_CHAR__ 27 | #ifdef __UCLIBCXX_EXPAND_ISTREAM_CHAR__ 28 | 29 | template _UCXXEXPORT basic_iostream >:: 30 | basic_iostream(basic_streambuf >* sb); 31 | template _UCXXEXPORT basic_iostream >::~basic_iostream(); 32 | 33 | #endif 34 | #endif 35 | 36 | } 37 | 38 | 39 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/new_opv.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2004 Garrett A. Kajmowicz 2 | 3 | This file is part of the uClibc++ Library. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | 25 | // Arduino now defines this 26 | #if 0 27 | _UCXXEXPORT void* operator new[](std::size_t numBytes) throw(std::bad_alloc){ 28 | //C++ stardard 5.3.4.8 requires that a valid pointer be returned for 29 | //a call to new(0). Thus: 30 | if(numBytes == 0){ 31 | numBytes = 1; 32 | } 33 | void * p = malloc(numBytes); 34 | if(p == 0){ 35 | std::__throw_bad_alloc(); 36 | } 37 | return p; 38 | } 39 | #endif 40 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/Internals/Comments.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | namespace ArduinoJson { 11 | namespace Internals { 12 | inline const char *skipCStyleComment(const char *ptr) { 13 | ptr += 2; 14 | for (;;) { 15 | if (ptr[0] == '\0') return ptr; 16 | if (ptr[0] == '*' && ptr[1] == '/') return ptr + 2; 17 | ptr++; 18 | } 19 | } 20 | 21 | inline const char *skipCppStyleComment(const char *ptr) { 22 | ptr += 2; 23 | for (;;) { 24 | if (ptr[0] == '\0' || ptr[0] == '\n') return ptr; 25 | ptr++; 26 | } 27 | } 28 | 29 | inline const char *skipSpacesAndComments(const char *ptr) { 30 | for (;;) { 31 | switch (ptr[0]) { 32 | case ' ': 33 | case '\t': 34 | case '\r': 35 | case '\n': 36 | ptr++; 37 | continue; 38 | case '/': 39 | switch (ptr[1]) { 40 | case '*': 41 | ptr = skipCStyleComment(ptr); 42 | break; 43 | case '/': 44 | ptr = skipCppStyleComment(ptr); 45 | break; 46 | default: 47 | return ptr; 48 | } 49 | break; 50 | default: 51 | return ptr; 52 | } 53 | } 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/new_op.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2004 Garrett A. Kajmowicz 2 | 3 | This file is part of the uClibc++ Library. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | // Arduino 1.0 contains an implementation for this. 21 | #if ARDUINO < 100 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | _UCXXEXPORT void* operator new(std::size_t numBytes) throw(std::bad_alloc){ 28 | //C++ stardard 5.3.4.8 requires that a valid pointer be returned for 29 | //a call to new(0). Thus: 30 | if(numBytes == 0){ 31 | numBytes = 1; 32 | } 33 | void * p = malloc(numBytes); 34 | if(p == 0){ 35 | std::__throw_bad_alloc(); 36 | } 37 | return p; 38 | } 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/eh_globals.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2006 Garrett A. Kajmowicz 2 | 3 | This file is part of the uClibc++ Library. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation, version 2.1 8 | of the License. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | //This is a system-specific header which does all of the error-handling management 25 | #include 26 | 27 | //The following functionality is derived from reading of the GNU libstdc++ code and making it...simple 28 | 29 | 30 | namespace __cxxabiv1{ 31 | 32 | static __UCLIBCXX_TLS __cxa_eh_globals eh_globals; 33 | 34 | extern "C" __cxa_eh_globals* __cxa_get_globals() throw(){ 35 | return &eh_globals; 36 | } 37 | 38 | extern "C" __cxa_eh_globals* __cxa_get_globals_fast() throw(){ 39 | return &eh_globals; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/func_exception: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2004 Garrett A. Kajmowicz 2 | 3 | This file is part of the uClibc++ Library. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | 24 | #ifndef HEADER_IMPLEMENTATION_FUNC_EXCEPTION 25 | #define HEADER_IMPLEMENTATION_FUNC_EXCEPTION 26 | 27 | #pragma GCC visibility push(default) 28 | 29 | namespace std{ 30 | 31 | _UCXXEXPORT void __throw_bad_alloc(); 32 | _UCXXEXPORT void __throw_out_of_range(const char * message = 0); 33 | _UCXXEXPORT void __throw_overflow_error(const char * message = 0); 34 | _UCXXEXPORT void __throw_length_error(const char * message = 0); 35 | _UCXXEXPORT void __throw_invalid_argument(const char * message = 0); 36 | } 37 | 38 | #pragma GCC visibility pop 39 | 40 | #endif 41 | 42 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/Internals/JsonVariantType.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | namespace ArduinoJson { 11 | class JsonArray; 12 | class JsonObject; 13 | 14 | namespace Internals { 15 | 16 | // Enumerated type to know the current type of a JsonVariant. 17 | // The value determines which member of JsonVariantContent is used. 18 | enum JsonVariantType { 19 | JSON_UNDEFINED, // JsonVariant has not been initialized 20 | JSON_UNPARSED, // JsonVariant contains an unparsed string 21 | JSON_STRING, // JsonVariant stores a const char* 22 | JSON_BOOLEAN, // JsonVariant stores a bool 23 | JSON_POSITIVE_INTEGER, // JsonVariant stores an unsigned long 24 | JSON_NEGATIVE_INTEGER, // JsonVariant stores an unsigned long that must be 25 | // negated 26 | JSON_ARRAY, // JsonVariant stores a pointer to a JsonArray 27 | JSON_OBJECT, // JsonVariant stores a pointer to a JsonObject 28 | 29 | // The following values are reserved for float values 30 | // Multiple values are used for double, depending on the number of decimal 31 | // digits that must be printed in the JSON output. 32 | // This little trick allow to save one extra member in JsonVariant 33 | JSON_FLOAT_0_DECIMALS 34 | // JSON_FLOAT_1_DECIMAL 35 | // JSON_FLOAT_2_DECIMALS 36 | // ... 37 | }; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/Crops.h: -------------------------------------------------------------------------------- 1 | /* 2 | * DROMatic.ino 3 | * DROMatic OS Crops 4 | * Devin R. Olsen - July 4th, 2017 5 | * devin@devinrolsen.com 6 | */ 7 | 8 | #ifndef _CROPS_h 9 | #define _CROPS_h 10 | #include "Globals.h" 11 | #include //Arduno Json (aka epic) 12 | 13 | extern String cropName; 14 | 15 | extern JsonObject& getCropData(JsonBuffer& b); 16 | 17 | extern void setCropData(JsonObject& d, bool returnHome = true); 18 | 19 | extern JsonObject& getECData(JsonBuffer& b, byte ecRangeIndex); 20 | 21 | extern void setECData(JsonObject& d, byte ecRangeIndex); 22 | 23 | extern void cropChange(); 24 | 25 | extern void cropCreate(); 26 | 27 | extern void cropRename(int dir); 28 | 29 | extern void cropReset(); 30 | 31 | extern void cropBuild(); 32 | 33 | extern void cropLoad(); 34 | 35 | //Saves 36 | extern void saveECRange(); 37 | extern void savePHRange(); 38 | extern void saveStatus(); 39 | extern void savePHDelay(); 40 | extern void savePHAmount(); 41 | extern void setPHWaterProbeCalibration(byte channel, int value, char type); 42 | extern void setECWaterProbeCalibration(byte channel, int value, char type); 43 | 44 | //Prints 45 | extern void printStatus(int dir = 0); 46 | extern void printPHAmount(int dir = 0); 47 | extern void printPHDelay(int dir = 0); 48 | extern void printPHRange(double dir); 49 | extern void printECRange(int dir); 50 | extern void printECCalibrations(String type, int dir = 0); 51 | extern void printPHCalibrations(String type, byte value); 52 | extern void printOpen(int dir = 0); 53 | extern void printReset(); 54 | 55 | #endif 56 | 57 | -------------------------------------------------------------------------------- /src/Menus.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * DROMatic.ino 3 | * DROMatic OS Menus 4 | * Devin R. Olsen - July 4th, 2017 5 | * devin@devinrolsen.com 6 | */ 7 | 8 | #include "Menus.h" 9 | #include "Core.h" 10 | #include "Screens.h" 11 | #include "DatesTime.h" 12 | 13 | byte menuIndex; 14 | vector menus, menusHistory; 15 | 16 | String getMenuHistory(){ 17 | byte i, size; 18 | String join; 19 | size = menusHistory.size(); 20 | for (i = 0; i < size; i++){ 21 | join = join + "/" + menusHistory.at(i); 22 | } 23 | return join; 24 | } 25 | 26 | void scrollAlpha(int dir){ 27 | currentAlphaIndex = currentAlphaIndex + dir; 28 | if (currentAlphaIndex > 36){ 29 | currentAlphaIndex = 0; 30 | } 31 | else if (currentAlphaIndex < 0){ 32 | currentAlphaIndex = 36; 33 | } 34 | char alphaBuffer[2]; 35 | lcd.print(strcpy_P(alphaBuffer, (char*)pgm_read_word(&(alphabet[currentAlphaIndex])))); 36 | lcd.setCursor(cursorX, cursorY); 37 | delay(50); 38 | } 39 | 40 | void scrollMenus(int dir){ 41 | menuIndex = menuIndex + dir; 42 | int currentSize = menus.size() - 1; 43 | if (menuIndex < 0){ 44 | menuIndex = currentSize; 45 | } 46 | else if (menuIndex > currentSize){ 47 | menuIndex = 0; 48 | } 49 | lcd.clear(); 50 | printScreenNames(menus[menuIndex]); 51 | printScrollArrows(); 52 | } 53 | 54 | void getDirectoryMenus(File directory) { 55 | menus.clear(); 56 | while (true) { 57 | tmpFile = directory.openNextFile(); 58 | if (!tmpFile) { // no more files 59 | break; 60 | } 61 | if (tmpFile.isDirectory()){ 62 | menus.push_back(tmpFile.name()); 63 | } 64 | tmpFile.close(); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/Internals/Parse.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include 11 | 12 | namespace ArduinoJson { 13 | namespace Internals { 14 | template 15 | TFloat parse(const char *); 16 | 17 | template <> 18 | inline float parse(const char *s) { 19 | return static_cast(strtod(s, NULL)); 20 | } 21 | 22 | template <> 23 | inline double parse(const char *s) { 24 | return strtod(s, NULL); 25 | } 26 | 27 | template <> 28 | inline long parse(const char *s) { 29 | return strtol(s, NULL, 10); 30 | } 31 | 32 | template <> 33 | inline unsigned long parse(const char *s) { 34 | return strtoul(s, NULL, 10); 35 | } 36 | 37 | template <> 38 | inline int parse(const char *s) { 39 | return atoi(s); 40 | } 41 | 42 | #if ARDUINOJSON_USE_LONG_LONG 43 | template <> 44 | inline long long parse(const char *s) { 45 | return strtoll(s, NULL, 10); 46 | } 47 | 48 | template <> 49 | inline unsigned long long parse(const char *s) { 50 | return strtoull(s, NULL, 10); 51 | } 52 | #endif 53 | 54 | #if ARDUINOJSON_USE_INT64 55 | template <> 56 | inline __int64 parse<__int64>(const char *s) { 57 | return _strtoi64(s, NULL, 10); 58 | } 59 | 60 | template <> 61 | inline unsigned __int64 parse(const char *s) { 62 | return _strtoui64(s, NULL, 10); 63 | } 64 | #endif 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/StaticJsonBuffer.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "JsonBuffer.hpp" 11 | 12 | #if defined(__clang__) 13 | #pragma clang diagnostic push 14 | #pragma clang diagnostic ignored "-Wnon-virtual-dtor" 15 | #elif defined(__GNUC__) 16 | #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) 17 | #pragma GCC diagnostic push 18 | #endif 19 | #pragma GCC diagnostic ignored "-Wnon-virtual-dtor" 20 | #endif 21 | 22 | namespace ArduinoJson { 23 | 24 | // Implements a JsonBuffer with fixed memory allocation. 25 | // The template paramenter CAPACITY specifies the capacity of the buffer in 26 | // bytes. 27 | template 28 | class StaticJsonBuffer : public JsonBuffer { 29 | public: 30 | explicit StaticJsonBuffer() : _size(0) {} 31 | 32 | size_t capacity() const { 33 | return CAPACITY; 34 | } 35 | size_t size() const { 36 | return _size; 37 | } 38 | 39 | virtual void* alloc(size_t bytes) { 40 | if (_size + bytes > CAPACITY) return NULL; 41 | void* p = &_buffer[_size]; 42 | _size += round_size_up(bytes); 43 | return p; 44 | } 45 | 46 | private: 47 | uint8_t _buffer[CAPACITY]; 48 | size_t _size; 49 | }; 50 | } 51 | 52 | #if defined(__clang__) 53 | #pragma clang diagnostic pop 54 | #elif defined(__GNUC__) 55 | #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) 56 | #pragma GCC diagnostic pop 57 | #endif 58 | #endif 59 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/exception.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2004 Garrett A. Kajmowicz 2 | 3 | This file is part of the uClibc++ Library. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | */ 20 | 21 | #include 22 | 23 | //We can't do this yet because gcc is too stupid to be able to handle 24 | //different implementations of exception class. 25 | 26 | #undef __UCLIBCXX_EXCEPTION_SUPPORT__ 27 | 28 | #ifdef __UCLIBCXX_EXCEPTION_SUPPORT__ 29 | 30 | namespace std{ 31 | _UCXXEXPORT static char * __std_exception_what_value = "exception"; 32 | 33 | //We are providing our own versions to be sneaky 34 | 35 | 36 | _UCXXEXPORT exception::~exception() throw(){ 37 | //Empty function 38 | } 39 | 40 | _UCXXEXPORT const char* exception::what() const throw(){ 41 | return __std_exception_what_value; 42 | } 43 | 44 | _UCXXEXPORT bad_exception::~bad_exception() throw(){ 45 | 46 | } 47 | 48 | 49 | } 50 | 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/JsonBuffer.ipp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "Internals/JsonParser.hpp" 11 | 12 | inline ArduinoJson::JsonArray &ArduinoJson::JsonBuffer::createArray() { 13 | JsonArray *ptr = new (this) JsonArray(this); 14 | return ptr ? *ptr : JsonArray::invalid(); 15 | } 16 | 17 | inline ArduinoJson::JsonObject &ArduinoJson::JsonBuffer::createObject() { 18 | JsonObject *ptr = new (this) JsonObject(this); 19 | return ptr ? *ptr : JsonObject::invalid(); 20 | } 21 | 22 | inline ArduinoJson::JsonArray &ArduinoJson::JsonBuffer::parseArray( 23 | char *json, uint8_t nestingLimit) { 24 | Internals::JsonParser parser(this, json, nestingLimit); 25 | return parser.parseArray(); 26 | } 27 | 28 | inline ArduinoJson::JsonObject &ArduinoJson::JsonBuffer::parseObject( 29 | char *json, uint8_t nestingLimit) { 30 | Internals::JsonParser parser(this, json, nestingLimit); 31 | return parser.parseObject(); 32 | } 33 | 34 | inline ArduinoJson::JsonVariant ArduinoJson::JsonBuffer::parse( 35 | char *json, uint8_t nestingLimit) { 36 | Internals::JsonParser parser(this, json, nestingLimit); 37 | return parser.parseVariant(); 38 | } 39 | 40 | inline char *ArduinoJson::JsonBuffer::strdup(const char *source, 41 | size_t length) { 42 | size_t size = length + 1; 43 | char *dest = static_cast(alloc(size)); 44 | if (dest != NULL) memcpy(dest, source, size); 45 | return dest; 46 | } 47 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/Internals/IndentedPrint.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "../Print.hpp" 11 | 12 | namespace ArduinoJson { 13 | namespace Internals { 14 | 15 | // Decorator on top of Print to allow indented output. 16 | // This class is used by JsonPrintable::prettyPrintTo() but can also be used 17 | // for your own purpose, like logging. 18 | class IndentedPrint : public Print { 19 | public: 20 | explicit IndentedPrint(Print &p) : sink(&p) { 21 | level = 0; 22 | tabSize = 2; 23 | isNewLine = true; 24 | } 25 | 26 | virtual size_t write(uint8_t c) { 27 | size_t n = 0; 28 | if (isNewLine) n += writeTabs(); 29 | n += sink->write(c); 30 | isNewLine = c == '\n'; 31 | return n; 32 | } 33 | 34 | // Adds one level of indentation 35 | void indent() { 36 | if (level < MAX_LEVEL) level++; 37 | } 38 | 39 | // Removes one level of indentation 40 | void unindent() { 41 | if (level > 0) level--; 42 | } 43 | 44 | // Set the number of space printed for each level of indentation 45 | void setTabSize(uint8_t n) { 46 | if (n < MAX_TAB_SIZE) tabSize = n & MAX_TAB_SIZE; 47 | } 48 | 49 | private: 50 | Print *sink; 51 | uint8_t level : 4; 52 | uint8_t tabSize : 3; 53 | bool isNewLine : 1; 54 | 55 | size_t writeTabs() { 56 | size_t n = 0; 57 | for (int i = 0; i < level * tabSize; i++) n += sink->write(' '); 58 | return n; 59 | } 60 | 61 | static const int MAX_LEVEL = 15; // because it's only 4 bits 62 | static const int MAX_TAB_SIZE = 7; // because it's only 3 bits 63 | }; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/JsonArray.ipp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "JsonArray.hpp" 11 | #include "JsonObject.hpp" 12 | #include "JsonArraySubscript.hpp" 13 | 14 | namespace ArduinoJson { 15 | 16 | template <> 17 | inline bool JsonArray::setNodeValue(node_type *node, String &value) { 18 | const char *copy = _buffer->strdup(value); 19 | if (!copy) return false; 20 | node->content = copy; 21 | return true; 22 | } 23 | 24 | template <> 25 | inline JsonArray &JsonVariant::defaultValue() { 26 | return JsonArray::invalid(); 27 | } 28 | 29 | template <> 30 | inline JsonArray &JsonVariant::defaultValue() { 31 | return JsonArray::invalid(); 32 | } 33 | 34 | template <> 35 | inline const JsonArray &JsonVariant::defaultValue() { 36 | return JsonArray::invalid(); 37 | } 38 | 39 | template <> 40 | inline const JsonArray &JsonVariant::defaultValue() { 41 | return JsonArray::invalid(); 42 | } 43 | 44 | inline JsonArray &JsonVariant::asArray() const { 45 | if (_type == Internals::JSON_ARRAY) return *_content.asArray; 46 | return JsonArray::invalid(); 47 | } 48 | 49 | inline JsonArray &JsonArray::createNestedArray() { 50 | if (!_buffer) return JsonArray::invalid(); 51 | JsonArray &array = _buffer->createArray(); 52 | add(array); 53 | return array; 54 | } 55 | 56 | inline JsonArray &JsonObject::createNestedArray(JsonObjectKey key) { 57 | if (!_buffer) return JsonArray::invalid(); 58 | JsonArray &array = _buffer->createArray(); 59 | setNodeAt(key, array); 60 | return array; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /libraries/Adafruit_NeoPixel/examples/simple/simple.ino: -------------------------------------------------------------------------------- 1 | // NeoPixel Ring simple sketch (c) 2013 Shae Erisson 2 | // released under the GPLv3 license to match the rest of the AdaFruit NeoPixel library 3 | 4 | #include 5 | #ifdef __AVR__ 6 | #include 7 | #endif 8 | 9 | // Which pin on the Arduino is connected to the NeoPixels? 10 | // On a Trinket or Gemma we suggest changing this to 1 11 | #define PIN 6 12 | 13 | // How many NeoPixels are attached to the Arduino? 14 | #define NUMPIXELS 16 15 | 16 | // When we setup the NeoPixel library, we tell it how many pixels, and which pin to use to send signals. 17 | // Note that for older NeoPixel strips you might need to change the third parameter--see the strandtest 18 | // example for more information on possible values. 19 | Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800); 20 | 21 | int delayval = 500; // delay for half a second 22 | 23 | void setup() { 24 | // This is for Trinket 5V 16MHz, you can remove these three lines if you are not using a Trinket 25 | #if defined (__AVR_ATtiny85__) 26 | if (F_CPU == 16000000) clock_prescale_set(clock_div_1); 27 | #endif 28 | // End of trinket special code 29 | 30 | pixels.begin(); // This initializes the NeoPixel library. 31 | } 32 | 33 | void loop() { 34 | 35 | // For a set of NeoPixels the first NeoPixel is 0, second is 1, all the way up to the count of pixels minus one. 36 | 37 | for(int i=0;i Examples > StandardCplusplus > string\_vector 29 | 30 | Upload that, set your serial monitor to 57600 baud, and check the output. 31 | 32 | ## How do I learn more? 33 | 34 | The web is your friend. [cplusplus.com](http://cplusplus.com/reference/) is my personal favorite reference. 35 | 36 | ## Which versions does it work with? 37 | 38 | Arduino 1.0 and beyond. 39 | 40 | ## What is the license? 41 | 42 | uClibc++ is LGPL, so this port is also. Andy's file is actually 43 | CC-BY-SA, however he indicated he'd be releasing it using the 3-clause 44 | modified BSD license, so it will be fully compatible with uClibc++. 45 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/stdexcept.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2004 Garrett A. Kajmowicz 2 | 3 | This file is part of the uClibc++ Library. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | #ifdef __UCLIBCXX_EXCEPTION_SUPPORT__ 24 | 25 | namespace std{ 26 | 27 | _UCXXEXPORT logic_error::logic_error() throw() : mstring(){ 28 | 29 | } 30 | 31 | _UCXXEXPORT logic_error::logic_error(const string& what_arg) : mstring(what_arg){ 32 | 33 | } 34 | 35 | _UCXXEXPORT const char * logic_error::what() const throw(){ 36 | return mstring.c_str(); 37 | } 38 | 39 | 40 | _UCXXEXPORT out_of_range::out_of_range() : logic_error(){ 41 | 42 | } 43 | 44 | _UCXXEXPORT out_of_range::out_of_range(const string & what_arg) : logic_error(what_arg) { 45 | 46 | } 47 | 48 | _UCXXEXPORT runtime_error::runtime_error() : mstring(){ 49 | 50 | } 51 | 52 | _UCXXEXPORT runtime_error::runtime_error(const string& what_arg) : mstring(what_arg){ 53 | 54 | } 55 | 56 | _UCXXEXPORT const char * runtime_error::what() const throw(){ 57 | return mstring.c_str(); 58 | } 59 | 60 | } 61 | 62 | #endif 63 | 64 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/streambuf.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2004 Garrett A. Kajmowicz 2 | 3 | This file is part of the uClibc++ Library. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #define __UCLIBCXX_COMPILE_STREAMBUF__ 1 21 | 22 | #include 23 | 24 | namespace std{ 25 | 26 | #ifdef __UCLIBCXX_EXPAND_STREAMBUF_CHAR__ 27 | 28 | #ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ 29 | 30 | template _UCXXEXPORT streambuf::basic_streambuf(); 31 | template _UCXXEXPORT streambuf::~basic_streambuf(); 32 | 33 | #endif 34 | 35 | template _UCXXEXPORT locale streambuf::pubimbue(const locale &loc); 36 | template _UCXXEXPORT streamsize streambuf::in_avail(); 37 | template _UCXXEXPORT streambuf::int_type streambuf::sbumpc(); 38 | template _UCXXEXPORT streambuf::int_type streambuf::snextc(); 39 | template _UCXXEXPORT streambuf::int_type streambuf::sgetc(); 40 | template _UCXXEXPORT streambuf::int_type streambuf::sputbackc(char_type c); 41 | template _UCXXEXPORT streambuf::int_type streambuf::sungetc(); 42 | template _UCXXEXPORT streambuf::int_type streambuf::sputc(char_type c); 43 | 44 | #endif 45 | 46 | 47 | } 48 | 49 | 50 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/cstdlib: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2005 Garrett A. Kajmowicz 2 | 3 | This file is part of the uClibc++ Library. 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | */ 18 | 19 | #include 20 | #include 21 | 22 | #ifndef __HEADER_CSTDLIB 23 | #define __HEADER_CSTDLIB 1 24 | 25 | 26 | namespace std{ 27 | #if ! defined(__AVR__) 28 | using ::atexit; 29 | using ::getenv; 30 | using ::system; 31 | #endif // ! defined(__AVR__) 32 | using ::abort; 33 | using ::abs; 34 | using ::atol; 35 | using ::atof; 36 | using ::atoi; 37 | using ::bsearch; 38 | using ::calloc; 39 | using ::div; 40 | using ::exit; 41 | using ::free; 42 | using ::labs; 43 | using ::ldiv; 44 | using ::malloc; 45 | using ::qsort; 46 | using ::rand; 47 | using ::realloc; 48 | using ::srand; 49 | using ::strtod; 50 | using ::strtol; 51 | using ::strtoul; 52 | #ifdef __UCLIBCXX_HAS_WCHAR__ 53 | using ::mblen; 54 | using ::mbstowcs; 55 | using ::mbtowc; 56 | using ::wctomb; 57 | using ::wcstombs; 58 | #endif 59 | 60 | inline long abs(long i){ 61 | return labs(i); 62 | } 63 | 64 | inline ldiv_t div(long i, long j){ 65 | return ldiv(i, j); 66 | } 67 | 68 | } 69 | 70 | 71 | 72 | #endif 73 | 74 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/basic_definitions: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2004 Garrett A. Kajmowicz 2 | This file is part of the uClibc++ Library. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | 8 | This library is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | Lesser General Public License for more details. 12 | 13 | You should have received a copy of the GNU Lesser General Public 14 | License along with this library; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | */ 17 | 18 | #ifndef __BASIC_DEFINITIONS 19 | #define __BASIC_DEFINITIONS 1 20 | 21 | #include 22 | 23 | #pragma GCC visibility push(default) 24 | 25 | //The following is used to support GCC symbol visibility patch 26 | 27 | #ifdef GCC_HASCLASSVISIBILITY 28 | #define _UCXXEXPORT __attribute__ ((visibility("default"))) 29 | #define _UCXXLOCAL __attribute__ ((visibility("hidden"))) 30 | #else 31 | #define _UCXXEXPORT 32 | #define _UCXXLOCAL 33 | 34 | #endif 35 | 36 | #ifdef __GCC__ 37 | #define __UCLIBCXX_NORETURN __attribute__ ((__noreturn__)) 38 | #else 39 | #define __UCLIBCXX_NORETURN 40 | #endif 41 | 42 | #ifdef __UCLIBCXX_HAS_TLS__ 43 | #define __UCLIBCXX_TLS __thread 44 | #else 45 | #define __UCLIBCXX_TLS 46 | #endif 47 | 48 | 49 | 50 | //Testing purposes 51 | #define __STRING_MAX_UNITS 65535 52 | 53 | namespace std{ 54 | typedef signed long int streamsize; 55 | } 56 | 57 | #pragma GCC visibility pop 58 | 59 | #endif 60 | 61 | 62 | #ifdef __DODEBUG__ 63 | #define UCLIBCXX_DEBUG 1 64 | #else 65 | #define UCLIBCXX_DEBUG 0 66 | #endif 67 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/support.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2004 Garrett A. Kajmowicz 2 | 3 | This file is part of the uClibc++ Library. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include 21 | 22 | #if 0 23 | extern "C" void *__cxa_allocate_exception(size_t thrown_size){ 24 | void * retval; 25 | 26 | /*The amount of data needed is the size of the object *PLUS* 27 | the size of the header. The header is of struct __cxa_exception 28 | The address needs to be adjusted because the pointer we return 29 | should not point to the start of the memory, but to the point 30 | where the object being thrown actually starts*/ 31 | 32 | retval = malloc(thrown_size + sizeof(__cxa_exception)); 33 | 34 | // Check to see that we actuall allocated memory 35 | if(retval == 0){ 36 | std::terminate(); 37 | } 38 | 39 | //Need to do a typecast to char* otherwize we are doing math with 40 | //a void* which makes the compiler cranky (Like me) 41 | return ((char *)retval + sizeof(__cxa_exception)); 42 | } 43 | 44 | extern "C" void __cxa_free_exception(void *thrown_exception){ 45 | 46 | 47 | 48 | } 49 | 50 | extern "C" void __cxa_throw (void *thrown_exception, std::type_info *tinfo,void (*dest) (void *) ){ 51 | 52 | 53 | } 54 | #endif // 0 55 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/JsonObject.ipp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "JsonArray.hpp" 11 | #include "JsonObject.hpp" 12 | #include "JsonObjectSubscript.hpp" 13 | 14 | namespace ArduinoJson { 15 | 16 | template <> 17 | inline bool JsonObject::setNodeValue(node_type *node, String &value) { 18 | node->content.value = _buffer->strdup(value); 19 | return node->content.value; 20 | } 21 | 22 | template <> 23 | inline bool JsonObject::setNodeValue(node_type *node, const String &value) { 24 | node->content.value = _buffer->strdup(value); 25 | return node->content.value; 26 | } 27 | 28 | template <> 29 | inline const JsonObject &JsonVariant::defaultValue() { 30 | return JsonObject::invalid(); 31 | } 32 | 33 | template <> 34 | inline const JsonObject &JsonVariant::defaultValue() { 35 | return JsonObject::invalid(); 36 | } 37 | 38 | template <> 39 | inline JsonObject &JsonVariant::defaultValue() { 40 | return JsonObject::invalid(); 41 | } 42 | 43 | template <> 44 | inline JsonObject &JsonVariant::defaultValue() { 45 | return JsonObject::invalid(); 46 | } 47 | 48 | inline JsonObject &JsonVariant::asObject() const { 49 | if (_type == Internals::JSON_OBJECT) return *_content.asObject; 50 | return JsonObject::invalid(); 51 | } 52 | 53 | inline JsonObject &JsonObject::createNestedObject(JsonObjectKey key) { 54 | if (!_buffer) return JsonObject::invalid(); 55 | JsonObject &array = _buffer->createObject(); 56 | setNodeAt(key, array); 57 | return array; 58 | } 59 | 60 | inline JsonObject &JsonArray::createNestedObject() { 61 | if (!_buffer) return JsonObject::invalid(); 62 | JsonObject &object = _buffer->createObject(); 63 | add(object); 64 | return object; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/Internals/JsonParser.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "../JsonBuffer.hpp" 11 | #include "../JsonVariant.hpp" 12 | 13 | namespace ArduinoJson { 14 | namespace Internals { 15 | 16 | // Parse JSON string to create JsonArrays and JsonObjects 17 | // This internal class is not indended to be used directly. 18 | // Instead, use JsonBuffer.parseArray() or .parseObject() 19 | class JsonParser { 20 | public: 21 | JsonParser(JsonBuffer *buffer, char *json, uint8_t nestingLimit) 22 | : _buffer(buffer), 23 | _readPtr(json ? json : ""), 24 | _writePtr(json), 25 | _nestingLimit(nestingLimit) {} 26 | 27 | JsonArray &parseArray(); 28 | JsonObject &parseObject(); 29 | 30 | JsonVariant parseVariant() { 31 | JsonVariant result; 32 | parseAnythingTo(&result); 33 | return result; 34 | } 35 | 36 | private: 37 | bool skip(char charToSkip); 38 | 39 | const char *parseString(); 40 | bool parseAnythingTo(JsonVariant *destination); 41 | FORCE_INLINE bool parseAnythingToUnsafe(JsonVariant *destination); 42 | 43 | inline bool parseArrayTo(JsonVariant *destination); 44 | inline bool parseObjectTo(JsonVariant *destination); 45 | inline bool parseStringTo(JsonVariant *destination); 46 | 47 | static inline bool isInRange(char c, char min, char max) { 48 | return min <= c && c <= max; 49 | } 50 | 51 | static inline bool isLetterOrNumber(char c) { 52 | return isInRange(c, '0', '9') || isInRange(c, 'a', 'z') || 53 | isInRange(c, 'A', 'Z') || c == '-' || c == '.'; 54 | } 55 | 56 | static inline bool isQuote(char c) { 57 | return c == '\'' || c == '\"'; 58 | } 59 | 60 | JsonBuffer *_buffer; 61 | const char *_readPtr; 62 | char *_writePtr; 63 | uint8_t _nestingLimit; 64 | }; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/cstdio: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2006 Garrett A. Kajmowicz 2 | 3 | This file is part of the uClibc++ Library. 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation version 2.1 7 | 8 | This library is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | Lesser General Public License for more details. 12 | 13 | You should have received a copy of the GNU Lesser General Public 14 | License along with this library; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | */ 17 | 18 | #include 19 | #include 20 | 21 | #ifndef __HEADER_CSTDIO 22 | #define __HEADER_CSTDIO 1 23 | 24 | 25 | namespace std{ 26 | #if ! defined(__AVR__) 27 | using ::FILE; 28 | using ::fpos_t; 29 | using ::fgetpos; 30 | using ::fopen; 31 | using ::freopen; 32 | using ::fseek; 33 | using ::fsetpos; 34 | using ::ftell; 35 | using ::perror; 36 | using ::rename; 37 | using ::rewind; 38 | using ::setbuf; 39 | using ::setvbuf; 40 | using ::tmpfile; 41 | using ::tmpnam; 42 | using ::remove; 43 | #endif // ! defined(__AVR__) 44 | 45 | using ::clearerr; 46 | using ::fclose; 47 | using ::feof; 48 | using ::ferror; 49 | using ::fflush; 50 | using ::fgetc; 51 | using ::fgets; 52 | using ::fprintf; 53 | using ::fputc; 54 | using ::fputs; 55 | using ::fread; 56 | using ::fscanf; 57 | using ::fwrite; 58 | using ::getc; 59 | using ::getchar; 60 | using ::gets; 61 | using ::printf; 62 | using ::putc; 63 | using ::putchar; 64 | using ::puts; 65 | using ::scanf; 66 | using ::sprintf; 67 | using ::sscanf; 68 | using ::ungetc; 69 | using ::vfprintf; 70 | using ::vprintf; 71 | using ::vsprintf; 72 | } 73 | 74 | 75 | 76 | #endif 77 | 78 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/char_traits.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2004 Garrett A. Kajmowicz 2 | 3 | This file is part of the uClibc++ Library. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | */ 20 | 21 | #define __UCLIBCXX_COMPILE_CHAR_TRAITS__ 1 22 | 23 | 24 | #include 25 | #include 26 | 27 | namespace std{ 28 | 29 | _UCXXEXPORT const char_traits::char_type* char_traits::find(const char_type* s, int n, const char_type& a){ 30 | for(int i=0; i < n; i++){ 31 | if(eq(s[i], a)){ 32 | return (s+i); 33 | } 34 | } 35 | return 0; 36 | } 37 | 38 | _UCXXEXPORT bool char_traits::eq(const char_type& c1, const char_type& c2){ 39 | if(strncmp(&c1, &c2, 1) == 0){ 40 | return true; 41 | } 42 | return false; 43 | } 44 | 45 | _UCXXEXPORT char_traits::char_type char_traits::to_char_type(const int_type & i){ 46 | if(i > 0 && i <= 255){ 47 | return (char)(unsigned char)i; 48 | } 49 | 50 | //Out of range 51 | return 0; 52 | } 53 | 54 | 55 | 56 | #ifdef __UCLIBCXX_HAS_WCHAR__ 57 | 58 | _UCXXEXPORT const char_traits::char_type* char_traits::find(const char_type* s, int n, const char_type& a){ 59 | for(int i=0; i < n; i++){ 60 | if(eq(s[i], a)){ 61 | return (s+i); 62 | } 63 | } 64 | return 0; 65 | } 66 | 67 | #endif 68 | 69 | } 70 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/cwchar: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2006 Garrett A. Kajmowicz 2 | 3 | This file is part of the uClibc++ Library. 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation version 2.1 7 | 8 | This library is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | Lesser General Public License for more details. 12 | 13 | You should have received a copy of the GNU Lesser General Public 14 | License along with this library; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | */ 17 | 18 | #include 19 | #include 20 | 21 | #ifndef __HEADER_CWCHAR 22 | #define __HEADER_CWCHAR 1 23 | 24 | 25 | namespace std{ 26 | using ::mbstate_t; 27 | using ::wint_t; 28 | 29 | using ::btowc; 30 | using ::fgetwc; 31 | using ::fgetws; 32 | using ::fputwc; 33 | using ::fputws; 34 | using ::fwide; 35 | using ::fwprintf; 36 | using ::fwscanf; 37 | using ::getwc; 38 | using ::getwchar; 39 | using ::mbrlen; 40 | using ::mbrtowc; 41 | using ::mbsinit; 42 | using ::mbsrtowcs; 43 | using ::putwc; 44 | using ::putwchar; 45 | using ::swprintf; 46 | using ::swscanf; 47 | using ::ungetwc; 48 | using ::vfwprintf; 49 | using ::vswprintf; 50 | using ::vwprintf; 51 | using ::wcrtomb; 52 | using ::wcscat; 53 | using ::wcschr; 54 | using ::wcscmp; 55 | using ::wcscoll; 56 | using ::wcscpy; 57 | using ::wcscspn; 58 | using ::wcsftime; 59 | using ::wcslen; 60 | using ::wcsncat; 61 | using ::wcsncmp; 62 | using ::wcsncpy; 63 | using ::wcspbrk; 64 | using ::wcsrchr; 65 | using ::wcsrtombs; 66 | using ::wcsspn; 67 | using ::wcsstr; 68 | using ::wcstod; 69 | using ::wcstok; 70 | using ::wcstol; 71 | using ::wcstoul; 72 | using ::wcsxfrm; 73 | using ::wctob; 74 | using ::wmemchr; 75 | using ::wmemcmp; 76 | using ::wmemcpy; 77 | using ::wmemmove; 78 | using ::wmemset; 79 | using ::wprintf; 80 | using ::wscanf; 81 | } 82 | 83 | 84 | 85 | #endif 86 | 87 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/locale: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2004 Garrett A. Kajmowicz 2 | 3 | This file is part of the uClibc++ Library. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | #ifndef __HEADER_STD_LOCALE 25 | #define __HEADER_STD_LOCALE 1 26 | 27 | #pragma GCC visibility push(default) 28 | 29 | namespace std{ 30 | class _UCXXEXPORT locale { 31 | public: 32 | // types: 33 | class facet; 34 | class id; 35 | typedef unsigned char category; 36 | 37 | static const category 38 | none = 0, 39 | collate = 0x01, ctype = 0x02, 40 | monetary = 0x04, numeric = 0x08, 41 | time = 0x10, messages = 0x20, 42 | all = collate | ctype | monetary | numeric | time | messages; 43 | 44 | // construct/copy/destroy: 45 | locale() throw(){ 46 | return; 47 | } 48 | locale(const locale& other) throw(){ 49 | (void)other; 50 | return; 51 | } 52 | locale(const char *) throw(){ 53 | return; 54 | } 55 | ~locale() throw(){ 56 | return; 57 | } 58 | 59 | const locale& operator=(const locale&) throw(){ 60 | return *this; 61 | } 62 | std::string name() const { return "C"; } 63 | }; 64 | 65 | class _UCXXEXPORT locale::facet { 66 | friend class locale; 67 | explicit facet(size_t = 0){ 68 | return; 69 | } 70 | virtual ~facet(){ 71 | return; 72 | } 73 | }; 74 | 75 | class _UCXXEXPORT locale::id { 76 | id(){ } 77 | }; 78 | 79 | } 80 | 81 | #pragma GCC visibility pop 82 | 83 | #endif 84 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/cstddef: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- forwarding header. 2 | 3 | // Copyright (C) 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc. 4 | // 5 | // This file is part of the GNU ISO C++ Library. This library is free 6 | // software; you can redistribute it and/or modify it under the 7 | // terms of the GNU General Public License as published by the 8 | // Free Software Foundation; either version 2, or (at your option) 9 | // any later version. 10 | 11 | // This library is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | 16 | // You should have received a copy of the GNU General Public License along 17 | // with this library; see the file COPYING. If not, write to the Free 18 | // Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, 19 | // USA. 20 | 21 | // As a special exception, you may use this file as part of a free software 22 | // library without restriction. Specifically, if other files instantiate 23 | // templates or use macros or inline functions from this file, or you compile 24 | // this file and link it with other files to produce an executable, this 25 | // file does not by itself cause the resulting executable to be covered by 26 | // the GNU General Public License. This exception does not however 27 | // invalidate any other reasons why the executable file might be covered by 28 | // the GNU General Public License. 29 | 30 | // 31 | // ISO C++ 14882: 18.1 Types 32 | // 33 | 34 | /** @file cstddef 35 | * This is a Standard C++ Library file. You should @c #include this file 36 | * in your programs, rather than any of the "*.h" implementation files. 37 | * 38 | * This is the C++ version of the Standard C Library header @c stddef.h, 39 | * and its contents are (mostly) the same as that header, but are all 40 | * contained in the namespace @c std. 41 | */ 42 | 43 | #ifndef _CPP_CSTDDEF 44 | #define _CPP_CSTDDEF 1 45 | 46 | #ifdef __GCC__ 47 | #pragma GCC system_header 48 | #endif 49 | 50 | #include 51 | 52 | namespace std 53 | { 54 | using ::ptrdiff_t; 55 | using ::size_t; 56 | } 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/cstring: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2005 Garrett A. Kajmowicz 2 | 3 | This file is part of the uClibc++ Library. 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | */ 18 | 19 | #include 20 | #include 21 | 22 | #ifndef __HEADER_CSTRING 23 | #define __HEADER_CSTRING 1 24 | 25 | 26 | namespace std{ 27 | #if ! defined(__AVR__) 28 | using ::strcoll; 29 | using ::strerror; 30 | using ::strxfrm; 31 | #endif // ! defined(__AVR__) 32 | 33 | using ::memchr; 34 | using ::memcmp; 35 | using ::memcpy; 36 | using ::memmove; 37 | using ::memset; 38 | using ::strcat; 39 | using ::strchr; 40 | using ::strcmp; 41 | using ::strcpy; 42 | using ::strcspn; 43 | using ::strlen; 44 | using ::strncat; 45 | using ::strncmp; 46 | using ::strncpy; 47 | using ::strpbrk; 48 | using ::strrchr; 49 | using ::strspn; 50 | using ::strstr; 51 | using ::strtok; 52 | 53 | #ifndef __CORRECT_ISO_CPP_STRING_H_PROTO 54 | //Extra definitions required in c++ spec 55 | 56 | inline void* memchr(void* s, int c, size_t n){ 57 | return memchr(const_cast(s), c, n); 58 | } 59 | 60 | inline char* strchr(char* s, int c){ 61 | return strchr(const_cast(s), c); 62 | } 63 | 64 | inline char* strpbrk(char* s1, const char* s2){ 65 | return strpbrk(const_cast(s1), s2); 66 | } 67 | 68 | inline char* strrchr(char* s, int c){ 69 | return strrchr(const_cast(s), c); 70 | } 71 | 72 | inline char* strstr(char* s1, const char* s2){ 73 | return strstr(const_cast(s1), s2); 74 | } 75 | #endif 76 | } 77 | 78 | #endif 79 | 80 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/func_exception.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2004 Garrett A. Kajmowicz 2 | 3 | This file is part of the uClibc++ Library. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | namespace std{ 26 | 27 | #ifdef __UCLIBCXX_EXCEPTION_SUPPORT__ 28 | 29 | _UCXXEXPORT void __throw_bad_alloc(){ 30 | throw bad_alloc(); 31 | } 32 | 33 | _UCXXEXPORT void __throw_out_of_range( const char * message){ 34 | if(message == 0){ 35 | throw out_of_range(); 36 | } 37 | throw out_of_range(message); 38 | } 39 | 40 | _UCXXEXPORT void __throw_overflow_error( const char * message){ 41 | if(message == 0){ 42 | throw overflow_error(); 43 | } 44 | throw overflow_error(message); 45 | } 46 | 47 | _UCXXEXPORT void __throw_length_error(const char * message){ 48 | if(message == 0){ 49 | throw length_error(); 50 | } 51 | throw length_error(message); 52 | } 53 | 54 | _UCXXEXPORT void __throw_invalid_argument(const char * message){ 55 | if(message == 0){ 56 | throw invalid_argument(); 57 | } 58 | throw invalid_argument(message); 59 | } 60 | 61 | #else 62 | 63 | _UCXXEXPORT void __throw_bad_alloc(){ 64 | abort(); 65 | } 66 | 67 | _UCXXEXPORT void __throw_out_of_range( const char * ){ 68 | abort(); 69 | } 70 | 71 | _UCXXEXPORT void __throw_overflow_error( const char * ){ 72 | abort(); 73 | } 74 | 75 | _UCXXEXPORT void __throw_length_error(const char * ){ 76 | abort(); 77 | } 78 | 79 | _UCXXEXPORT void __throw_invalid_argument(const char *){ 80 | abort(); 81 | } 82 | 83 | #endif 84 | 85 | 86 | 87 | } 88 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/cstdarg: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- forwarding header. 2 | 3 | // Copyright (C) 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc. 4 | // 5 | // This file is part of the GNU ISO C++ Library. This library is free 6 | // software; you can redistribute it and/or modify it under the 7 | // terms of the GNU General Public License as published by the 8 | // Free Software Foundation; either version 2, or (at your option) 9 | // any later version. 10 | 11 | // This library is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | 16 | // You should have received a copy of the GNU General Public License along 17 | // with this library; see the file COPYING. If not, write to the Free 18 | // Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, 19 | // USA. 20 | 21 | // As a special exception, you may use this file as part of a free software 22 | // library without restriction. Specifically, if other files instantiate 23 | // templates or use macros or inline functions from this file, or you compile 24 | // this file and link it with other files to produce an executable, this 25 | // file does not by itself cause the resulting executable to be covered by 26 | // the GNU General Public License. This exception does not however 27 | // invalidate any other reasons why the executable file might be covered by 28 | // the GNU General Public License. 29 | 30 | // 31 | // ISO C++ 14882: 20.4.6 C library 32 | // 33 | 34 | /** @file cstdarg 35 | * This is a Standard C++ Library file. You should @c #include this file 36 | * in your programs, rather than any of the "*.h" implementation files. 37 | * 38 | * This is the C++ version of the Standard C Library header @c stdarg.h, 39 | * and its contents are (mostly) the same as that header, but are all 40 | * contained in the namespace @c std. 41 | */ 42 | 43 | #ifndef _CPP_CSTDARG 44 | #define _CPP_CSTDARG 1 45 | 46 | #pragma GCC system_header 47 | 48 | #include 49 | 50 | // Adhere to section 17.4.1.2 clause 5 of ISO 14882:1998 51 | #ifndef va_end 52 | #define va_end(ap) va_end (ap) 53 | #endif 54 | 55 | namespace std 56 | { 57 | using ::va_list; 58 | } 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/csignal: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- forwarding header. 2 | 3 | // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 4 | // Free Software Foundation, Inc. 5 | // 6 | // This file is part of the GNU ISO C++ Library. This library is free 7 | // software; you can redistribute it and/or modify it under the 8 | // terms of the GNU General Public License as published by the 9 | // Free Software Foundation; either version 2, or (at your option) 10 | // any later version. 11 | 12 | // This library is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | // GNU General Public License for more details. 16 | 17 | // You should have received a copy of the GNU General Public License along 18 | // with this library; see the file COPYING. If not, write to the Free 19 | // Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, 20 | // USA. 21 | 22 | // As a special exception, you may use this file as part of a free software 23 | // library without restriction. Specifically, if other files instantiate 24 | // templates or use macros or inline functions from this file, or you compile 25 | // this file and link it with other files to produce an executable, this 26 | // file does not by itself cause the resulting executable to be covered by 27 | // the GNU General Public License. This exception does not however 28 | // invalidate any other reasons why the executable file might be covered by 29 | // the GNU General Public License. 30 | 31 | // 32 | // ISO C++ 14882: 20.4.6 C library 33 | // 34 | 35 | /** @file csignal 36 | * This is a Standard C++ Library file. You should @c #include this file 37 | * in your programs, rather than any of the "*.h" implementation files. 38 | * 39 | * This is the C++ version of the Standard C Library header @c signal.h, 40 | * and its contents are (mostly) the same as that header, but are all 41 | * contained in the namespace @c std. 42 | */ 43 | 44 | #ifndef _CPP_CSIGNAL 45 | #define _CPP_CSIGNAL 1 46 | 47 | #pragma GCC system_header 48 | 49 | #include 50 | 51 | // Get rid of those macros defined in in lieu of real functions. 52 | #undef raise 53 | 54 | namespace std 55 | { 56 | using ::sig_atomic_t; 57 | using ::signal; 58 | using ::raise; 59 | } 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/eh_alloc.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2006 Garrett A. Kajmowicz 2 | 3 | This file is part of the uClibc++ Library. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation, version 2.1 8 | of the License. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | //This is a system-specific header which does all of the error-handling management 25 | #include 26 | 27 | namespace __cxxabiv1{ 28 | 29 | extern "C" void * __cxa_allocate_exception(std::size_t thrown_size) throw(){ 30 | void *retval; 31 | //The sizeof crap is required by Itanium ABI because we need to provide space for 32 | //accounting information which is implementaion (gcc) specified 33 | retval = malloc (thrown_size + sizeof(__cxa_exception)); 34 | if (0 == retval){ 35 | std::terminate(); 36 | } 37 | memset (retval, 0, sizeof(__cxa_exception)); 38 | return (void *)((unsigned char *)retval + sizeof(__cxa_exception)); 39 | } 40 | 41 | extern "C" void __cxa_free_exception(void *vptr) throw(){ 42 | free( (char *)(vptr) - sizeof(__cxa_exception) ); 43 | } 44 | 45 | 46 | extern "C" __cxa_dependent_exception * __cxa_allocate_dependent_exception() throw(){ 47 | __cxa_dependent_exception *retval; 48 | //The sizeof crap is required by Itanium ABI because we need to provide space for 49 | //accounting information which is implementaion (gcc) specified 50 | retval = static_cast<__cxa_dependent_exception*>(malloc (sizeof(__cxa_dependent_exception))); 51 | if (0 == retval){ 52 | std::terminate(); 53 | } 54 | memset (retval, 0, sizeof(__cxa_dependent_exception)); 55 | return retval; 56 | } 57 | 58 | extern "C" void __cxa_free_dependent_exception(__cxa_dependent_exception *vptr) throw(){ 59 | free( (char *)(vptr) ); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/new: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2004 Garrett A. Kajmowicz 2 | 3 | This file is part of the uClibc++ Library. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | #ifndef __STD_NEW_OPERATOR 25 | #define __STD_NEW_OPERATOR 1 26 | 27 | #pragma GCC visibility push(default) 28 | 29 | namespace std{ 30 | class _UCXXEXPORT bad_alloc : public exception {}; 31 | 32 | struct _UCXXEXPORT nothrow_t {}; 33 | extern const nothrow_t nothrow; 34 | 35 | typedef void (*new_handler)(); 36 | _UCXXEXPORT new_handler set_new_handler(new_handler new_p) throw(); 37 | } 38 | 39 | 40 | _UCXXEXPORT void* operator new(std::size_t numBytes) throw(std::bad_alloc); 41 | _UCXXEXPORT void operator delete(void* ptr) throw(); 42 | 43 | _UCXXEXPORT void* operator new[](std::size_t numBytes) throw(std::bad_alloc); 44 | _UCXXEXPORT void operator delete[](void * ptr) throw(); 45 | 46 | #ifndef NO_NOTHROW 47 | _UCXXEXPORT void* operator new(std::size_t numBytes, const std::nothrow_t& ) throw(); 48 | _UCXXEXPORT void operator delete(void* ptr, const std::nothrow_t& ) throw(); 49 | 50 | _UCXXEXPORT void* operator new[](std::size_t numBytes, const std::nothrow_t& ) throw(); 51 | _UCXXEXPORT void operator delete[](void* ptr, const std::nothrow_t& ) throw(); 52 | #endif 53 | 54 | /* Placement operators */ 55 | inline void* operator new(std::size_t, void* ptr) throw() {return ptr; } 56 | inline void operator delete(void* , void *) throw() { } 57 | 58 | inline void* operator new[](std::size_t, void *p) throw() { return p; } 59 | inline void operator delete[](void* , void *) throw() {} 60 | 61 | #pragma GCC visibility pop 62 | 63 | #endif 64 | 65 | -------------------------------------------------------------------------------- /libraries/Adafruit_NeoPixel/esp8266.c: -------------------------------------------------------------------------------- 1 | // This is a mash-up of the Due show() code + insights from Michael Miller's 2 | // ESP8266 work for the NeoPixelBus library: github.com/Makuna/NeoPixelBus 3 | // Needs to be a separate .c file to enforce ICACHE_RAM_ATTR execution. 4 | 5 | #ifdef ESP8266 6 | 7 | #include 8 | #include 9 | 10 | static uint32_t _getCycleCount(void) __attribute__((always_inline)); 11 | static inline uint32_t _getCycleCount(void) { 12 | uint32_t ccount; 13 | __asm__ __volatile__("rsr %0,ccount":"=a" (ccount)); 14 | return ccount; 15 | } 16 | 17 | void ICACHE_RAM_ATTR espShow( 18 | uint8_t pin, uint8_t *pixels, uint32_t numBytes, boolean is800KHz) { 19 | 20 | #define CYCLES_800_T0H (F_CPU / 2500000) // 0.4us 21 | #define CYCLES_800_T1H (F_CPU / 1250000) // 0.8us 22 | #define CYCLES_800 (F_CPU / 800000) // 1.25us per bit 23 | #define CYCLES_400_T0H (F_CPU / 2000000) // 0.5uS 24 | #define CYCLES_400_T1H (F_CPU / 833333) // 1.2us 25 | #define CYCLES_400 (F_CPU / 400000) // 2.5us per bit 26 | 27 | uint8_t *p, *end, pix, mask; 28 | uint32_t t, time0, time1, period, c, startTime, pinMask; 29 | 30 | pinMask = _BV(pin); 31 | p = pixels; 32 | end = p + numBytes; 33 | pix = *p++; 34 | mask = 0x80; 35 | startTime = 0; 36 | 37 | #ifdef NEO_KHZ400 38 | if(is800KHz) { 39 | #endif 40 | time0 = CYCLES_800_T0H; 41 | time1 = CYCLES_800_T1H; 42 | period = CYCLES_800; 43 | #ifdef NEO_KHZ400 44 | } else { // 400 KHz bitstream 45 | time0 = CYCLES_400_T0H; 46 | time1 = CYCLES_400_T1H; 47 | period = CYCLES_400; 48 | } 49 | #endif 50 | 51 | for(t = time0;; t = time0) { 52 | if(pix & mask) t = time1; // Bit high duration 53 | while(((c = _getCycleCount()) - startTime) < period); // Wait for bit start 54 | GPIO_REG_WRITE(GPIO_OUT_W1TS_ADDRESS, pinMask); // Set high 55 | startTime = c; // Save start time 56 | while(((c = _getCycleCount()) - startTime) < t); // Wait high duration 57 | GPIO_REG_WRITE(GPIO_OUT_W1TC_ADDRESS, pinMask); // Set low 58 | if(!(mask >>= 1)) { // Next bit/byte 59 | if(p >= end) break; 60 | pix = *p++; 61 | mask = 0x80; 62 | } 63 | } 64 | while((_getCycleCount() - startTime) < period); // Wait for last bit 65 | } 66 | 67 | #endif // ESP8266 68 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/type_traits: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2005 Garrett A. Kajmowicz 2 | 3 | This file is part of the uClibc++ Library. 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | */ 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | #ifndef __HEADER_TYPE_TRAITS 26 | #define __HEADER_TYPE_TRAITS 1 27 | 28 | #pragma GCC visibility push(default) 29 | 30 | namespace std{ 31 | 32 | struct _UCXXEXPORT __true_type{}; 33 | struct _UCXXEXPORT __false_type{}; 34 | 35 | template class _UCXXEXPORT __is_integer{ 36 | public: 37 | typedef __false_type value; 38 | }; 39 | 40 | template <> class _UCXXEXPORT __is_integer { 41 | public: 42 | typedef __true_type value; 43 | }; 44 | 45 | template <> class _UCXXEXPORT __is_integer { 46 | public: 47 | typedef __true_type value; 48 | }; 49 | 50 | template <> class _UCXXEXPORT __is_integer { 51 | public: 52 | typedef __true_type value; 53 | }; 54 | 55 | template <> class _UCXXEXPORT __is_integer { 56 | public: 57 | typedef __true_type value; 58 | }; 59 | 60 | template <> class _UCXXEXPORT __is_integer { 61 | public: 62 | typedef __true_type value; 63 | }; 64 | 65 | template <> class _UCXXEXPORT __is_integer { 66 | public: 67 | typedef __true_type value; 68 | }; 69 | 70 | template <> class _UCXXEXPORT __is_integer { 71 | public: 72 | typedef __true_type value; 73 | }; 74 | 75 | template <> class _UCXXEXPORT __is_integer { 76 | public: 77 | typedef __true_type value; 78 | }; 79 | 80 | template <> class _UCXXEXPORT __is_integer { 81 | public: 82 | typedef __true_type value; 83 | }; 84 | 85 | 86 | 87 | } 88 | 89 | #pragma GCC visibility pop 90 | 91 | #endif 92 | 93 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/sstream.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2004 Garrett A. Kajmowicz 2 | 3 | This file is part of the uClibc++ Library. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #define __UCLIBCXX_COMPILE_SSTREAM__ 1 21 | 22 | #include 23 | 24 | namespace std{ 25 | 26 | #ifdef __UCLIBCXX_EXPAND_SSTREAM_CHAR__ 27 | 28 | typedef char_traits tr_ch; 29 | typedef basic_stringbuf > char_stringbuf; 30 | 31 | #ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ 32 | 33 | template _UCXXEXPORT char_stringbuf::basic_stringbuf(ios_base::openmode which); 34 | template _UCXXEXPORT char_stringbuf::~basic_stringbuf(); 35 | 36 | #endif //__UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ 37 | 38 | template _UCXXEXPORT basic_string, allocator > char_stringbuf::str() const; 39 | template _UCXXEXPORT char_stringbuf::int_type char_stringbuf::pbackfail(char_stringbuf::int_type c); 40 | template _UCXXEXPORT char_stringbuf::int_type char_stringbuf::overflow(char_stringbuf::int_type c); 41 | template _UCXXEXPORT char_stringbuf::pos_type 42 | char_stringbuf::seekoff(char_stringbuf::off_type, ios_base::seekdir, ios_base::openmode); 43 | template _UCXXEXPORT char_stringbuf::int_type char_stringbuf::underflow (); 44 | template _UCXXEXPORT streamsize char_stringbuf::xsputn(const char* s, streamsize n); 45 | 46 | #ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ 47 | 48 | template _UCXXEXPORT basic_stringstream >::basic_stringstream(ios_base::openmode which); 49 | template _UCXXEXPORT basic_istringstream >::~basic_istringstream(); 50 | template _UCXXEXPORT basic_ostringstream >::~basic_ostringstream(); 51 | template _UCXXEXPORT basic_stringstream >::~basic_stringstream(); 52 | 53 | #endif //__UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ 54 | 55 | #endif 56 | 57 | } 58 | 59 | 60 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/Configuration.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #ifdef ARDUINO // assume this is an embedded platform 11 | 12 | // store using float instead of double to reduce the memory usage (issue #134) 13 | #ifndef ARDUINOJSON_USE_DOUBLE 14 | #define ARDUINOJSON_USE_DOUBLE 0 15 | #endif 16 | 17 | // store using a long because it usually match the size of a float. 18 | #ifndef ARDUINOJSON_USE_LONG_LONG 19 | #define ARDUINOJSON_USE_LONG_LONG 0 20 | #endif 21 | #ifndef ARDUINOJSON_USE_INT64 22 | #define ARDUINOJSON_USE_INT64 0 23 | #endif 24 | 25 | // arduino has its own implementation of String to replace std::string 26 | #ifndef ARDUINOJSON_USE_ARDUINO_STRING 27 | #define ARDUINOJSON_USE_ARDUINO_STRING 1 28 | #endif 29 | 30 | // arduino doesn't support STL stream 31 | #ifndef ARDUINOJSON_ENABLE_STD_STREAM 32 | #define ARDUINOJSON_ENABLE_STD_STREAM 0 33 | #endif 34 | 35 | #ifndef ARDUINOJSON_ENABLE_ALIGNMENT 36 | #ifdef ARDUINO_ARCH_AVR 37 | // alignment isn't needed for 8-bit AVR 38 | #define ARDUINOJSON_ENABLE_ALIGNMENT 0 39 | #else 40 | // but must processor needs pointer to be align on word size 41 | #define ARDUINOJSON_ENABLE_ALIGNMENT 1 42 | #endif 43 | #endif 44 | 45 | #else // assume this is a computer 46 | 47 | // on a computer we have plenty of memory so we can use doubles 48 | #ifndef ARDUINOJSON_USE_DOUBLE 49 | #define ARDUINOJSON_USE_DOUBLE 1 50 | #endif 51 | 52 | // use long long when available 53 | #ifndef ARDUINOJSON_USE_LONG_LONG 54 | #if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1800) 55 | #define ARDUINOJSON_USE_LONG_LONG 1 56 | #else 57 | #define ARDUINOJSON_USE_LONG_LONG 0 58 | #endif 59 | #endif 60 | 61 | // use _int64 on old versions of Visual Studio 62 | #ifndef ARDUINOJSON_USE_INT64 63 | #if defined(_MSC_VER) && _MSC_VER <= 1700 64 | #define ARDUINOJSON_USE_INT64 1 65 | #else 66 | #define ARDUINOJSON_USE_INT64 0 67 | #endif 68 | #endif 69 | 70 | // on a computer, we can use std::string 71 | #ifndef ARDUINOJSON_USE_ARDUINO_STRING 72 | #define ARDUINOJSON_USE_ARDUINO_STRING 0 73 | #endif 74 | 75 | // on a computer, we can assume that the STL is there 76 | #ifndef ARDUINOJSON_ENABLE_STD_STREAM 77 | #define ARDUINOJSON_ENABLE_STD_STREAM 1 78 | #endif 79 | 80 | #ifndef ARDUINOJSON_ENABLE_ALIGNMENT 81 | // even if not required, most cpu's are faster with aligned pointers 82 | #define ARDUINOJSON_ENABLE_ALIGNMENT 1 83 | #endif 84 | 85 | #endif 86 | 87 | #if ARDUINOJSON_USE_LONG_LONG && ARDUINOJSON_USE_INT64 88 | #error ARDUINOJSON_USE_LONG_LONG and ARDUINOJSON_USE_INT64 cannot be set together 89 | #endif 90 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/ctime: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- forwarding header. 2 | 3 | // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 4 | // Free Software Foundation, Inc. 5 | // 6 | // This file is part of the GNU ISO C++ Library. This library is free 7 | // software; you can redistribute it and/or modify it under the 8 | // terms of the GNU General Public License as published by the 9 | // Free Software Foundation; either version 2, or (at your option) 10 | // any later version. 11 | 12 | // This library is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | // GNU General Public License for more details. 16 | 17 | // You should have received a copy of the GNU General Public License along 18 | // with this library; see the file COPYING. If not, write to the Free 19 | // Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, 20 | // USA. 21 | 22 | // As a special exception, you may use this file as part of a free software 23 | // library without restriction. Specifically, if other files instantiate 24 | // templates or use macros or inline functions from this file, or you compile 25 | // this file and link it with other files to produce an executable, this 26 | // file does not by itself cause the resulting executable to be covered by 27 | // the GNU General Public License. This exception does not however 28 | // invalidate any other reasons why the executable file might be covered by 29 | // the GNU General Public License. 30 | 31 | // 32 | // ISO C++ 14882: 20.5 Date and time 33 | // 34 | 35 | /** @file ctime 36 | * This is a Standard C++ Library file. You should @c #include this file 37 | * in your programs, rather than any of the "*.h" implementation files. 38 | * 39 | * This is the C++ version of the Standard C Library header @c time.h, 40 | * and its contents are (mostly) the same as that header, but are all 41 | * contained in the namespace @c std. 42 | */ 43 | 44 | #ifndef _CPP_CTIME 45 | #define _CPP_CTIME 1 46 | 47 | #pragma GCC system_header 48 | 49 | #include 50 | 51 | #include 52 | 53 | // Get rid of those macros defined in in lieu of real functions. 54 | #undef clock 55 | #undef difftime 56 | #undef mktime 57 | #undef time 58 | #undef asctime 59 | #undef ctime 60 | #undef gmtime 61 | #undef localtime 62 | #undef strftime 63 | 64 | namespace std 65 | { 66 | using ::clock_t; 67 | using ::time_t; 68 | using ::tm; 69 | 70 | using ::clock; 71 | using ::difftime; 72 | using ::mktime; 73 | using ::time; 74 | using ::asctime; 75 | using ::ctime; 76 | using ::gmtime; 77 | using ::localtime; 78 | using ::strftime; 79 | } 80 | 81 | #endif 82 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/istream.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2004 Garrett A. Kajmowicz 2 | 3 | This file is part of the uClibc++ Library. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | */ 20 | 21 | #define __UCLIBCXX_COMPILE_ISTREAM__ 1 22 | 23 | #include 24 | 25 | 26 | namespace std{ 27 | 28 | #ifdef __UCLIBCXX_EXPAND_ISTREAM_CHAR__ 29 | 30 | template <> _UCXXEXPORT string _readToken >(istream & stream) 31 | { 32 | string temp; 33 | char_traits::int_type c; 34 | while(true){ 35 | c = stream.rdbuf()->sgetc(); 36 | if(c != char_traits::eof() && isspace(c) == false){ 37 | stream.rdbuf()->sbumpc(); 38 | temp.append(1, char_traits::to_char_type(c)); 39 | }else{ 40 | break; 41 | } 42 | } 43 | if (temp.size() == 0) 44 | stream.setstate(ios_base::eofbit|ios_base::failbit); 45 | 46 | return temp; 47 | } 48 | 49 | template _UCXXEXPORT istream::int_type istream::get(); 50 | template _UCXXEXPORT istream & istream::get(char &c); 51 | 52 | template _UCXXEXPORT istream & istream::operator>>(bool &n); 53 | template _UCXXEXPORT istream & istream::operator>>(short &n); 54 | template _UCXXEXPORT istream & istream::operator>>(unsigned short &n); 55 | template _UCXXEXPORT istream & istream::operator>>(int &n); 56 | template _UCXXEXPORT istream & istream::operator>>(unsigned int &n); 57 | template _UCXXEXPORT istream & istream::operator>>(long unsigned &n); 58 | template _UCXXEXPORT istream & istream::operator>>(long int &n); 59 | template _UCXXEXPORT istream & istream::operator>>(void *& p); 60 | template _UCXXEXPORT istream & operator>>(istream & is, char & c); 61 | 62 | 63 | #ifdef __UCLIBCXX_HAS_FLOATS__ 64 | template _UCXXEXPORT istream & istream::operator>>(float &f); 65 | template _UCXXEXPORT istream & istream::operator>>(double &f); 66 | template _UCXXEXPORT istream & istream::operator>>(long double &f); 67 | #endif 68 | 69 | template _UCXXEXPORT void __skipws(basic_istream >& is); 70 | 71 | #endif 72 | 73 | 74 | } 75 | 76 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/Internals/JsonPrintable.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "../Configuration.hpp" 11 | #include "DummyPrint.hpp" 12 | #include "IndentedPrint.hpp" 13 | #include "JsonWriter.hpp" 14 | #include "Prettyfier.hpp" 15 | #include "StaticStringBuilder.hpp" 16 | #include "DynamicStringBuilder.hpp" 17 | 18 | #if ARDUINOJSON_ENABLE_STD_STREAM 19 | #include "StreamPrintAdapter.hpp" 20 | #endif 21 | 22 | namespace ArduinoJson { 23 | namespace Internals { 24 | 25 | // Implements all the overloads of printTo() and prettyPrintTo() 26 | // Caution: this class use a template parameter to avoid virtual methods. 27 | // This is a bit curious but allows to reduce the size of JsonVariant, JsonArray 28 | // and JsonObject. 29 | template 30 | class JsonPrintable { 31 | public: 32 | size_t printTo(Print &print) const { 33 | JsonWriter writer(print); 34 | downcast().writeTo(writer); 35 | return writer.bytesWritten(); 36 | } 37 | 38 | #if ARDUINOJSON_ENABLE_STD_STREAM 39 | std::ostream &printTo(std::ostream &os) const { 40 | StreamPrintAdapter adapter(os); 41 | printTo(adapter); 42 | return os; 43 | } 44 | #endif 45 | 46 | size_t printTo(char *buffer, size_t bufferSize) const { 47 | StaticStringBuilder sb(buffer, bufferSize); 48 | return printTo(sb); 49 | } 50 | 51 | size_t printTo(String &str) const { 52 | DynamicStringBuilder sb(str); 53 | return printTo(sb); 54 | } 55 | 56 | size_t prettyPrintTo(IndentedPrint &print) const { 57 | Prettyfier p(print); 58 | return printTo(p); 59 | } 60 | 61 | size_t prettyPrintTo(char *buffer, size_t bufferSize) const { 62 | StaticStringBuilder sb(buffer, bufferSize); 63 | return prettyPrintTo(sb); 64 | } 65 | 66 | size_t prettyPrintTo(Print &print) const { 67 | IndentedPrint indentedPrint = IndentedPrint(print); 68 | return prettyPrintTo(indentedPrint); 69 | } 70 | 71 | size_t prettyPrintTo(String &str) const { 72 | DynamicStringBuilder sb(str); 73 | return prettyPrintTo(sb); 74 | } 75 | 76 | size_t measureLength() const { 77 | DummyPrint dp; 78 | return printTo(dp); 79 | } 80 | 81 | size_t measurePrettyLength() const { 82 | DummyPrint dp; 83 | return prettyPrintTo(dp); 84 | } 85 | 86 | private: 87 | const T &downcast() const { return *static_cast(this); } 88 | }; 89 | 90 | #if ARDUINOJSON_ENABLE_STD_STREAM 91 | template 92 | inline std::ostream &operator<<(std::ostream &os, const JsonPrintable &v) { 93 | return v.printTo(os); 94 | } 95 | #endif 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/JsonArraySubscript.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "Configuration.hpp" 11 | #include "JsonVariantBase.hpp" 12 | 13 | #ifdef _MSC_VER 14 | #pragma warning(push) 15 | #pragma warning(disable : 4522) 16 | #endif 17 | 18 | namespace ArduinoJson { 19 | class JsonArraySubscript : public JsonVariantBase { 20 | public: 21 | FORCE_INLINE JsonArraySubscript(JsonArray& array, size_t index) 22 | : _array(array), _index(index) {} 23 | 24 | JsonArraySubscript& operator=(const JsonArraySubscript& src) { 25 | _array.set(_index, src); 26 | return *this; 27 | } 28 | 29 | template 30 | typename TypeTraits::EnableIf::value, 31 | JsonArraySubscript>::type& 32 | operator=(const T& src) { 33 | _array.set(_index, const_cast(src)); 34 | return *this; 35 | } 36 | 37 | template 38 | typename TypeTraits::EnableIf::value, 39 | JsonArraySubscript>::type& 40 | operator=(T src) { 41 | _array.set(_index, src); 42 | return *this; 43 | } 44 | 45 | FORCE_INLINE bool success() const { 46 | return _index < _array.size(); 47 | } 48 | 49 | FORCE_INLINE operator JsonVariant() const { 50 | return _array.get(_index); 51 | } 52 | 53 | template 54 | FORCE_INLINE typename Internals::JsonVariantAs::type as() const { 55 | return _array.get(_index); 56 | } 57 | 58 | template 59 | FORCE_INLINE bool is() const { 60 | return _array.is(_index); 61 | } 62 | 63 | void writeTo(Internals::JsonWriter& writer) const { 64 | _array.get(_index).writeTo(writer); 65 | } 66 | 67 | template 68 | void set(TValue value) { 69 | _array.set(_index, value); 70 | } 71 | 72 | private: 73 | JsonArray& _array; 74 | const size_t _index; 75 | }; 76 | 77 | #if ARDUINOJSON_ENABLE_STD_STREAM 78 | inline std::ostream& operator<<(std::ostream& os, 79 | const JsonArraySubscript& source) { 80 | return source.printTo(os); 81 | } 82 | #endif 83 | 84 | inline JsonArraySubscript JsonArray::operator[](size_t index) { 85 | return JsonArraySubscript(*this, index); 86 | } 87 | 88 | template 89 | inline const JsonArraySubscript JsonVariantBase::operator[]( 90 | int index) const { 91 | return asArray()[index]; 92 | } 93 | 94 | } // namespace ArduinoJson 95 | 96 | #ifdef _MSC_VER 97 | #pragma warning(pop) 98 | #endif 99 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/Polyfills/math.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | // If Visual Studo <= 2012 11 | #if defined(_MSC_VER) && _MSC_VER <= 1700 12 | 13 | #include 14 | 15 | namespace ArduinoJson { 16 | namespace Polyfills { 17 | template 18 | bool isNaN(T x) { 19 | return _isnan(x) != 0; 20 | } 21 | 22 | template 23 | bool isInfinity(T x) { 24 | return !_finite(x); 25 | } 26 | } 27 | } 28 | 29 | #else 30 | 31 | #include 32 | 33 | // GCC warning: "conversion to 'float' from 'double' may alter its value" 34 | #ifdef __GNUC__ 35 | #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) 36 | #pragma GCC diagnostic push 37 | #endif 38 | #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9) 39 | #pragma GCC diagnostic ignored "-Wfloat-conversion" 40 | #else 41 | #pragma GCC diagnostic ignored "-Wconversion" 42 | #endif 43 | #endif 44 | 45 | // Workaround for libs that #undef isnan or isinf 46 | // https://github.com/bblanchon/ArduinoJson/issues/284 47 | #if !defined(isnan) || !defined(isinf) 48 | namespace std {} 49 | #endif 50 | 51 | namespace ArduinoJson { 52 | namespace Polyfills { 53 | 54 | template 55 | bool isNaN(T x) { 56 | // Workaround for libs that #undef isnan 57 | // https://github.com/bblanchon/ArduinoJson/issues/284 58 | #ifndef isnan 59 | using namespace std; 60 | #endif 61 | 62 | return isnan(x); 63 | } 64 | 65 | #if defined(_GLIBCXX_HAVE_ISNANL) && _GLIBCXX_HAVE_ISNANL 66 | template <> 67 | inline bool isNaN(double x) { 68 | return isnanl(x); 69 | } 70 | #endif 71 | 72 | #if defined(_GLIBCXX_HAVE_ISNANF) && _GLIBCXX_HAVE_ISNANF 73 | template <> 74 | inline bool isNaN(float x) { 75 | return isnanf(x); 76 | } 77 | #endif 78 | 79 | template 80 | bool isInfinity(T x) { 81 | // Workaround for libs that #undef isinf 82 | // https://github.com/bblanchon/ArduinoJson/issues/284 83 | #ifndef isinf 84 | using namespace std; 85 | #endif 86 | 87 | return isinf(x); 88 | } 89 | 90 | #if defined(_GLIBCXX_HAVE_ISINFL) && _GLIBCXX_HAVE_ISINFL 91 | template <> 92 | inline bool isInfinity(double x) { 93 | return isinfl(x); 94 | } 95 | #endif 96 | 97 | #if defined(_GLIBCXX_HAVE_ISINFF) && _GLIBCXX_HAVE_ISINFF 98 | template <> 99 | inline bool isInfinity(float x) { 100 | return isinff(x); 101 | } 102 | #endif 103 | 104 | #if defined(__GNUC__) 105 | #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) 106 | #pragma GCC diagnostic pop 107 | #endif 108 | #endif 109 | } 110 | } 111 | #endif 112 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/Internals/Prettyfier.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "IndentedPrint.hpp" 11 | 12 | namespace ArduinoJson { 13 | namespace Internals { 14 | 15 | // Converts a compact JSON string into an indented one. 16 | class Prettyfier : public Print { 17 | public: 18 | explicit Prettyfier(IndentedPrint& p) : _sink(p) { 19 | _previousChar = 0; 20 | _inString = false; 21 | } 22 | 23 | virtual size_t write(uint8_t c) { 24 | size_t n = _inString ? handleStringChar(c) : handleMarkupChar(c); 25 | _previousChar = c; 26 | return n; 27 | } 28 | 29 | private: 30 | Prettyfier& operator=(const Prettyfier&); // cannot be assigned 31 | 32 | bool inEmptyBlock() { 33 | return _previousChar == '{' || _previousChar == '['; 34 | } 35 | 36 | size_t handleStringChar(uint8_t c) { 37 | bool isQuote = c == '"' && _previousChar != '\\'; 38 | 39 | if (isQuote) _inString = false; 40 | 41 | return _sink.write(c); 42 | } 43 | 44 | size_t handleMarkupChar(uint8_t c) { 45 | switch (c) { 46 | case '{': 47 | case '[': 48 | return writeBlockOpen(c); 49 | 50 | case '}': 51 | case ']': 52 | return writeBlockClose(c); 53 | 54 | case ':': 55 | return writeColon(); 56 | 57 | case ',': 58 | return writeComma(); 59 | 60 | case '"': 61 | return writeQuoteOpen(); 62 | 63 | default: 64 | return writeNormalChar(c); 65 | } 66 | } 67 | 68 | size_t writeBlockClose(uint8_t c) { 69 | return unindentIfNeeded() + _sink.write(c); 70 | } 71 | 72 | size_t writeBlockOpen(uint8_t c) { 73 | return indentIfNeeded() + _sink.write(c); 74 | } 75 | 76 | size_t writeColon() { 77 | return _sink.write(':') + _sink.write(' '); 78 | } 79 | 80 | size_t writeComma() { 81 | return _sink.write(',') + _sink.println(); 82 | } 83 | 84 | size_t writeQuoteOpen() { 85 | _inString = true; 86 | return indentIfNeeded() + _sink.write('"'); 87 | } 88 | 89 | size_t writeNormalChar(uint8_t c) { 90 | return indentIfNeeded() + _sink.write(c); 91 | } 92 | 93 | size_t indentIfNeeded() { 94 | if (!inEmptyBlock()) return 0; 95 | 96 | _sink.indent(); 97 | return _sink.println(); 98 | } 99 | 100 | size_t unindentIfNeeded() { 101 | if (inEmptyBlock()) return 0; 102 | 103 | _sink.unindent(); 104 | return _sink.println(); 105 | } 106 | 107 | uint8_t _previousChar; 108 | IndentedPrint& _sink; 109 | bool _inString; 110 | }; 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/stack: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2004 Garrett A. Kajmowicz 2 | This file is part of the uClibc++ Library. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | 8 | This library is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | Lesser General Public License for more details. 12 | 13 | You should have received a copy of the GNU Lesser General Public 14 | License along with this library; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | */ 17 | 18 | #include 19 | #include 20 | 21 | #ifndef __HEADER_STD_STACK 22 | #define __HEADER_STD_STACK 1 23 | 24 | #pragma GCC visibility push(default) 25 | 26 | namespace std{ 27 | 28 | template > class _UCXXEXPORT stack{ 29 | protected: 30 | Container c; 31 | 32 | public: 33 | typedef typename Container::value_type value_type; 34 | typedef typename Container::size_type size_type; 35 | typedef Container container_type; 36 | 37 | explicit stack(const Container& a = Container()) : c(a) { }; 38 | bool empty() const { return c.empty(); } 39 | size_type size() const { return c.size(); } 40 | value_type& top() { return c.back(); } 41 | const value_type& top() const { return c.back(); } 42 | void push(const value_type& x) { c.push_back(x); } 43 | void pop() { c.pop_back(); } 44 | 45 | bool operator==(const stack &x) const{ 46 | return x.c == c; 47 | } 48 | 49 | }; 50 | 51 | 52 | template _UCXXEXPORT bool 53 | operator< (const stack& x, const stack& y) 54 | { 55 | return (x.c < y.c); 56 | } 57 | template _UCXXEXPORT bool 58 | operator!=(const stack& x, const stack& y) 59 | { 60 | return (x.c != y.c); 61 | } 62 | template _UCXXEXPORT bool 63 | operator> (const stack& x, const stack& y) 64 | { 65 | return (x.c > y.c); 66 | } 67 | template _UCXXEXPORT bool 68 | operator>=(const stack& x, const stack& y) 69 | { 70 | return (x.c >= y.c); 71 | } 72 | template _UCXXEXPORT bool 73 | operator<=(const stack& x, const stack& y) 74 | { 75 | return (x.c <= y.c); 76 | } 77 | 78 | } 79 | 80 | #pragma GCC visibility pop 81 | 82 | #endif 83 | 84 | 85 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/ostream.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2004 Garrett A. Kajmowicz 2 | 3 | This file is part of the uClibc++ Library. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #define __UCLIBCXX_COMPILE_OSTREAM__ 1 21 | 22 | #include 23 | 24 | namespace std{ 25 | 26 | 27 | #ifdef __UCLIBCXX_EXPAND_OSTREAM_CHAR__ 28 | 29 | #ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ 30 | template _UCXXEXPORT ostream::~basic_ostream(); 31 | #endif //__UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ 32 | 33 | template _UCXXEXPORT ostream & ostream::flush(); 34 | 35 | template _UCXXEXPORT ostream & ostream::operator<<(bool n); 36 | template _UCXXEXPORT ostream & ostream::operator<<(short int n); 37 | template _UCXXEXPORT ostream & ostream::operator<<(unsigned short int n); 38 | template _UCXXEXPORT ostream & ostream::operator<<(int n); 39 | template _UCXXEXPORT ostream & ostream::operator<<(unsigned int n); 40 | template _UCXXEXPORT ostream & ostream::operator<<(long n); 41 | template _UCXXEXPORT ostream & ostream::operator<<(unsigned long n); 42 | template _UCXXEXPORT ostream & ostream::operator<<(float f); 43 | template _UCXXEXPORT ostream & ostream::operator<<(double f); 44 | template _UCXXEXPORT ostream & ostream::operator<<(long double f); 45 | template _UCXXEXPORT ostream & ostream::operator<<(void* p); 46 | template _UCXXEXPORT ostream & ostream::operator<<(basic_streambuf >* sb); 47 | 48 | #ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ 49 | 50 | template _UCXXEXPORT ostream::sentry::sentry(ostream & os); 51 | template _UCXXEXPORT ostream::sentry::~sentry(); 52 | 53 | #endif //__UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ 54 | 55 | template _UCXXEXPORT ostream & endl(ostream & os); 56 | template _UCXXEXPORT ostream & flush(ostream & os); 57 | template _UCXXEXPORT ostream & operator<<(ostream & out, char c); 58 | template _UCXXEXPORT ostream & operator<<(ostream & out, const char* c); 59 | template _UCXXEXPORT ostream & operator<<(ostream & out, unsigned char c); 60 | template _UCXXEXPORT ostream & operator<<(ostream & out, const unsigned char* c); 61 | 62 | #endif 63 | 64 | 65 | } 66 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/Internals/List.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "../JsonBuffer.hpp" 11 | #include "ListConstIterator.hpp" 12 | #include "ListIterator.hpp" 13 | 14 | namespace ArduinoJson { 15 | namespace Internals { 16 | 17 | // A singly linked list of T. 18 | // The linked list is composed of ListNode. 19 | // It is derived by JsonArray and JsonObject 20 | template 21 | class List { 22 | public: 23 | typedef T value_type; 24 | typedef ListNode node_type; 25 | typedef ListIterator iterator; 26 | typedef ListConstIterator const_iterator; 27 | 28 | // Creates an empty List attached to a JsonBuffer. 29 | // The JsonBuffer allows to allocate new nodes. 30 | // When buffer is NULL, the List is not able to grow and success() returns 31 | // false. This is used to identify bad memory allocations and parsing 32 | // failures. 33 | explicit List(JsonBuffer *buffer) : _buffer(buffer), _firstNode(NULL) {} 34 | 35 | // Returns true if the object is valid 36 | // Would return false in the following situation: 37 | // - the memory allocation failed (StaticJsonBuffer was too small) 38 | // - the JSON parsing failed 39 | bool success() const { 40 | return _buffer != NULL; 41 | } 42 | 43 | // Returns the numbers of elements in the list. 44 | // For a JsonObject, it would return the number of key-value pairs 45 | size_t size() const { 46 | size_t nodeCount = 0; 47 | for (node_type *node = _firstNode; node; node = node->next) nodeCount++; 48 | return nodeCount; 49 | } 50 | 51 | iterator begin() { 52 | return iterator(_firstNode); 53 | } 54 | iterator end() { 55 | return iterator(NULL); 56 | } 57 | 58 | const_iterator begin() const { 59 | return const_iterator(_firstNode); 60 | } 61 | const_iterator end() const { 62 | return const_iterator(NULL); 63 | } 64 | 65 | protected: 66 | node_type *addNewNode() { 67 | node_type *newNode = new (_buffer) node_type(); 68 | 69 | if (_firstNode) { 70 | node_type *lastNode = _firstNode; 71 | while (lastNode->next) lastNode = lastNode->next; 72 | lastNode->next = newNode; 73 | } else { 74 | _firstNode = newNode; 75 | } 76 | 77 | return newNode; 78 | } 79 | 80 | void removeNode(node_type *nodeToRemove) { 81 | if (!nodeToRemove) return; 82 | if (nodeToRemove == _firstNode) { 83 | _firstNode = nodeToRemove->next; 84 | } else { 85 | for (node_type *node = _firstNode; node; node = node->next) 86 | if (node->next == nodeToRemove) node->next = nodeToRemove->next; 87 | } 88 | } 89 | 90 | JsonBuffer *_buffer; 91 | node_type *_firstNode; 92 | }; 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /libraries/SD/src/utility/SdFatUtil.h: -------------------------------------------------------------------------------- 1 | /* Arduino SdFat Library 2 | * Copyright (C) 2008 by William Greiman 3 | * 4 | * This file is part of the Arduino SdFat Library 5 | * 6 | * This Library is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This Library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | 16 | * You should have received a copy of the GNU General Public License 17 | * along with the Arduino SdFat Library. If not, see 18 | * . 19 | */ 20 | #ifndef SdFatUtil_h 21 | #define SdFatUtil_h 22 | /** 23 | * \file 24 | * Useful utility functions. 25 | */ 26 | #include 27 | #ifdef __AVR__ 28 | #include 29 | /** Store and print a string in flash memory.*/ 30 | #define PgmPrint(x) SerialPrint_P(PSTR(x)) 31 | /** Store and print a string in flash memory followed by a CR/LF.*/ 32 | #define PgmPrintln(x) SerialPrintln_P(PSTR(x)) 33 | /** Defined so doxygen works for function definitions. */ 34 | #endif 35 | #define NOINLINE __attribute__((noinline,unused)) 36 | #define UNUSEDOK __attribute__((unused)) 37 | //------------------------------------------------------------------------------ 38 | /** Return the number of bytes currently free in RAM. */ 39 | static UNUSEDOK int FreeRam(void) { 40 | extern int __bss_end; 41 | extern int* __brkval; 42 | int free_memory; 43 | if (reinterpret_cast(__brkval) == 0) { 44 | // if no heap use from end of bss section 45 | free_memory = reinterpret_cast(&free_memory) 46 | - reinterpret_cast(&__bss_end); 47 | } else { 48 | // use from top of stack to heap 49 | free_memory = reinterpret_cast(&free_memory) 50 | - reinterpret_cast(__brkval); 51 | } 52 | return free_memory; 53 | } 54 | #ifdef __AVR__ 55 | //------------------------------------------------------------------------------ 56 | /** 57 | * %Print a string in flash memory to the serial port. 58 | * 59 | * \param[in] str Pointer to string stored in flash memory. 60 | */ 61 | static NOINLINE void SerialPrint_P(PGM_P str) { 62 | for (uint8_t c; (c = pgm_read_byte(str)); str++) Serial.write(c); 63 | } 64 | //------------------------------------------------------------------------------ 65 | /** 66 | * %Print a string in flash memory followed by a CR/LF. 67 | * 68 | * \param[in] str Pointer to string stored in flash memory. 69 | */ 70 | static NOINLINE void SerialPrintln_P(PGM_P str) { 71 | SerialPrint_P(str); 72 | Serial.println(); 73 | } 74 | #endif // __AVR__ 75 | #endif // #define SdFatUtil_h 76 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/utility.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2004 Garrett A. Kajmowicz 2 | This file is part of the uClibc++ Library. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | */ 19 | 20 | 21 | #include 22 | 23 | 24 | #ifndef __STD_HEADER_UTILITY 25 | #define __STD_HEADER_UTILITY 1 26 | 27 | #pragma GCC visibility push(default) 28 | 29 | namespace std{ 30 | 31 | namespace rel_ops { 32 | template inline bool operator!=(const T& x, const T& y){ 33 | return !(x == y); 34 | } 35 | 36 | template inline bool operator> (const T& x, const T& y){ 37 | return ( y < x); 38 | } 39 | 40 | template inline bool operator<=(const T& x, const T& y){ 41 | return !( y < x ); 42 | } 43 | 44 | template inline bool operator>=(const T& x, const T& y){ 45 | return !(x < y); 46 | } 47 | } 48 | 49 | template struct _UCXXEXPORT pair { 50 | typedef T1 first_type; 51 | typedef T2 second_type; 52 | 53 | T1 first; 54 | T2 second; 55 | pair() : first(), second() { } 56 | pair(const T1& x, const T2& y) : first(x), second(y) { } 57 | template pair(const pair &p) : first(p.first), second(p.second) { } 58 | }; 59 | 60 | template bool operator==(const pair& x, const pair& y){ 61 | using namespace rel_ops; 62 | return (x.first == y.first && x.second==y.second); 63 | } 64 | template bool operator< (const pair& x, const pair& y){ 65 | return x.first < y.first || (!(y.first < x.first) && x.second < y.second); 66 | } 67 | template bool operator!=(const pair& x, const pair& y){ 68 | return !(x == y); 69 | } 70 | template bool operator> (const pair& x, const pair& y){ 71 | return y < x; 72 | } 73 | template bool operator>=(const pair& x, const pair& y){ 74 | return !(x < y); 75 | } 76 | template bool operator<=(const pair& x, const pair& y){ 77 | return !(y < x); 78 | } 79 | template pair make_pair(const T1& x, const T2& y){ 80 | return pair(x, y); 81 | } 82 | 83 | 84 | } 85 | 86 | #pragma GCC visibility pop 87 | 88 | #endif //__STD_HEADER_UTILITY 89 | -------------------------------------------------------------------------------- /libraries/ArduinoJson/include/ArduinoJson/Internals/BlockJsonBuffer.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Benoit Blanchon 2014-2016 2 | // MIT License 3 | // 4 | // Arduino JSON library 5 | // https://github.com/bblanchon/ArduinoJson 6 | // If you like this project, please add a star! 7 | 8 | #pragma once 9 | 10 | #include "../JsonBuffer.hpp" 11 | 12 | #include 13 | 14 | #if defined(__clang__) 15 | #pragma clang diagnostic push 16 | #pragma clang diagnostic ignored "-Wnon-virtual-dtor" 17 | #elif defined(__GNUC__) 18 | #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) 19 | #pragma GCC diagnostic push 20 | #endif 21 | #pragma GCC diagnostic ignored "-Wnon-virtual-dtor" 22 | #endif 23 | 24 | namespace ArduinoJson { 25 | namespace Internals { 26 | class DefaultAllocator { 27 | public: 28 | void* allocate(size_t size) { 29 | return malloc(size); 30 | } 31 | void deallocate(void* pointer) { 32 | free(pointer); 33 | } 34 | }; 35 | 36 | template 37 | class BlockJsonBuffer : public JsonBuffer { 38 | struct Block; 39 | struct EmptyBlock { 40 | Block* next; 41 | size_t capacity; 42 | size_t size; 43 | }; 44 | struct Block : EmptyBlock { 45 | uint8_t data[1]; 46 | }; 47 | 48 | public: 49 | BlockJsonBuffer(size_t initialSize = 256) 50 | : _head(NULL), _nextBlockSize(initialSize) {} 51 | 52 | ~BlockJsonBuffer() { 53 | Block* currentBlock = _head; 54 | 55 | while (currentBlock != NULL) { 56 | Block* nextBlock = currentBlock->next; 57 | _allocator.deallocate(currentBlock); 58 | currentBlock = nextBlock; 59 | } 60 | } 61 | 62 | size_t size() const { 63 | size_t total = 0; 64 | for (const Block* b = _head; b; b = b->next) total += b->size; 65 | return total; 66 | } 67 | 68 | virtual void* alloc(size_t bytes) { 69 | return canAllocInHead(bytes) ? allocInHead(bytes) : allocInNewBlock(bytes); 70 | } 71 | 72 | private: 73 | bool canAllocInHead(size_t bytes) const { 74 | return _head != NULL && _head->size + bytes <= _head->capacity; 75 | } 76 | 77 | void* allocInHead(size_t bytes) { 78 | void* p = _head->data + _head->size; 79 | _head->size += round_size_up(bytes); 80 | return p; 81 | } 82 | 83 | void* allocInNewBlock(size_t bytes) { 84 | size_t capacity = _nextBlockSize; 85 | if (bytes > capacity) capacity = bytes; 86 | if (!addNewBlock(capacity)) return NULL; 87 | _nextBlockSize *= 2; 88 | return allocInHead(bytes); 89 | } 90 | 91 | bool addNewBlock(size_t capacity) { 92 | size_t bytes = sizeof(EmptyBlock) + capacity; 93 | Block* block = static_cast(_allocator.allocate(bytes)); 94 | if (block == NULL) return false; 95 | block->capacity = capacity; 96 | block->size = 0; 97 | block->next = _head; 98 | _head = block; 99 | return true; 100 | } 101 | 102 | TAllocator _allocator; 103 | Block* _head; 104 | size_t _nextBlockSize; 105 | }; 106 | } 107 | } 108 | 109 | #if defined(__clang__) 110 | #pragma clang diagnostic pop 111 | #elif defined(__GNUC__) 112 | #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) 113 | #pragma GCC diagnostic pop 114 | #endif 115 | #endif 116 | -------------------------------------------------------------------------------- /libraries/LiquidCrystal/src/LiquidCrystal.h: -------------------------------------------------------------------------------- 1 | #ifndef LiquidCrystal_h 2 | #define LiquidCrystal_h 3 | 4 | #include 5 | #include "Print.h" 6 | 7 | // commands 8 | #define LCD_CLEARDISPLAY 0x01 9 | #define LCD_RETURNHOME 0x02 10 | #define LCD_ENTRYMODESET 0x04 11 | #define LCD_DISPLAYCONTROL 0x08 12 | #define LCD_CURSORSHIFT 0x10 13 | #define LCD_FUNCTIONSET 0x20 14 | #define LCD_SETCGRAMADDR 0x40 15 | #define LCD_SETDDRAMADDR 0x80 16 | 17 | // flags for display entry mode 18 | #define LCD_ENTRYRIGHT 0x00 19 | #define LCD_ENTRYLEFT 0x02 20 | #define LCD_ENTRYSHIFTINCREMENT 0x01 21 | #define LCD_ENTRYSHIFTDECREMENT 0x00 22 | 23 | // flags for display on/off control 24 | #define LCD_DISPLAYON 0x04 25 | #define LCD_DISPLAYOFF 0x00 26 | #define LCD_CURSORON 0x02 27 | #define LCD_CURSOROFF 0x00 28 | #define LCD_BLINKON 0x01 29 | #define LCD_BLINKOFF 0x00 30 | 31 | // flags for display/cursor shift 32 | #define LCD_DISPLAYMOVE 0x08 33 | #define LCD_CURSORMOVE 0x00 34 | #define LCD_MOVERIGHT 0x04 35 | #define LCD_MOVELEFT 0x00 36 | 37 | // flags for function set 38 | #define LCD_8BITMODE 0x10 39 | #define LCD_4BITMODE 0x00 40 | #define LCD_2LINE 0x08 41 | #define LCD_1LINE 0x00 42 | #define LCD_5x10DOTS 0x04 43 | #define LCD_5x8DOTS 0x00 44 | 45 | class LiquidCrystal : public Print { 46 | public: 47 | LiquidCrystal(uint8_t rs, uint8_t enable, 48 | uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, 49 | uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7); 50 | LiquidCrystal(uint8_t rs, uint8_t rw, uint8_t enable, 51 | uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, 52 | uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7); 53 | LiquidCrystal(uint8_t rs, uint8_t rw, uint8_t enable, 54 | uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3); 55 | LiquidCrystal(uint8_t rs, uint8_t enable, 56 | uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3); 57 | 58 | void init(uint8_t fourbitmode, uint8_t rs, uint8_t rw, uint8_t enable, 59 | uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, 60 | uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7); 61 | 62 | void begin(uint8_t cols, uint8_t rows, uint8_t charsize = LCD_5x8DOTS); 63 | 64 | void clear(); 65 | void home(); 66 | 67 | void noDisplay(); 68 | void display(); 69 | void noBlink(); 70 | void blink(); 71 | void noCursor(); 72 | void cursor(); 73 | void scrollDisplayLeft(); 74 | void scrollDisplayRight(); 75 | void leftToRight(); 76 | void rightToLeft(); 77 | void autoscroll(); 78 | void noAutoscroll(); 79 | 80 | void setRowOffsets(int row1, int row2, int row3, int row4); 81 | void createChar(uint8_t, uint8_t[]); 82 | void setCursor(uint8_t, uint8_t); 83 | virtual size_t write(uint8_t); 84 | void command(uint8_t); 85 | 86 | using Print::write; 87 | private: 88 | void send(uint8_t, uint8_t); 89 | void write4bits(uint8_t); 90 | void write8bits(uint8_t); 91 | void pulseEnable(); 92 | 93 | uint8_t _rs_pin; // LOW: command. HIGH: character. 94 | uint8_t _rw_pin; // LOW: write to LCD. HIGH: read from LCD. 95 | uint8_t _enable_pin; // activated by a HIGH pulse. 96 | uint8_t _data_pins[8]; 97 | 98 | uint8_t _displayfunction; 99 | uint8_t _displaycontrol; 100 | uint8_t _displaymode; 101 | 102 | uint8_t _initialized; 103 | 104 | uint8_t _numlines; 105 | uint8_t _row_offsets[4]; 106 | }; 107 | 108 | #endif 109 | -------------------------------------------------------------------------------- /libraries/SD/src/File.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | SD - a slightly more friendly wrapper for sdfatlib 4 | 5 | This library aims to expose a subset of SD card functionality 6 | in the form of a higher level "wrapper" object. 7 | 8 | License: GNU General Public License V3 9 | (Because sdfatlib is licensed with this.) 10 | 11 | (C) Copyright 2010 SparkFun Electronics 12 | 13 | */ 14 | 15 | #include 16 | 17 | /* for debugging file open/close leaks 18 | uint8_t nfilecount=0; 19 | */ 20 | 21 | File::File(SdFile f, const char *n) { 22 | // oh man you are kidding me, new() doesnt exist? Ok we do it by hand! 23 | _file = (SdFile *)malloc(sizeof(SdFile)); 24 | if (_file) { 25 | memcpy(_file, &f, sizeof(SdFile)); 26 | 27 | strncpy(_name, n, 12); 28 | _name[12] = 0; 29 | 30 | /* for debugging file open/close leaks 31 | nfilecount++; 32 | Serial.print("Created \""); 33 | Serial.print(n); 34 | Serial.print("\": "); 35 | Serial.println(nfilecount, DEC); 36 | */ 37 | } 38 | } 39 | 40 | File::File(void) { 41 | _file = 0; 42 | _name[0] = 0; 43 | //Serial.print("Created empty file object"); 44 | } 45 | 46 | // returns a pointer to the file name 47 | char *File::name(void) { 48 | return _name; 49 | } 50 | 51 | // a directory is a special type of file 52 | boolean File::isDirectory(void) { 53 | return (_file && _file->isDir()); 54 | } 55 | 56 | 57 | size_t File::write(uint8_t val) { 58 | return write(&val, 1); 59 | } 60 | 61 | size_t File::write(const uint8_t *buf, size_t size) { 62 | size_t t; 63 | if (!_file) { 64 | setWriteError(); 65 | return 0; 66 | } 67 | _file->clearWriteError(); 68 | t = _file->write(buf, size); 69 | if (_file->getWriteError()) { 70 | setWriteError(); 71 | return 0; 72 | } 73 | return t; 74 | } 75 | 76 | int File::peek() { 77 | if (! _file) 78 | return 0; 79 | 80 | int c = _file->read(); 81 | if (c != -1) _file->seekCur(-1); 82 | return c; 83 | } 84 | 85 | int File::read() { 86 | if (_file) 87 | return _file->read(); 88 | return -1; 89 | } 90 | 91 | // buffered read for more efficient, high speed reading 92 | int File::read(void *buf, uint16_t nbyte) { 93 | if (_file) 94 | return _file->read(buf, nbyte); 95 | return 0; 96 | } 97 | 98 | int File::available() { 99 | if (! _file) return 0; 100 | 101 | uint32_t n = size() - position(); 102 | 103 | return n > 0X7FFF ? 0X7FFF : n; 104 | } 105 | 106 | void File::flush() { 107 | if (_file) 108 | _file->sync(); 109 | } 110 | 111 | boolean File::seek(uint32_t pos) { 112 | if (! _file) return false; 113 | 114 | return _file->seekSet(pos); 115 | } 116 | 117 | uint32_t File::position() { 118 | if (! _file) return -1; 119 | return _file->curPosition(); 120 | } 121 | 122 | uint32_t File::size() { 123 | if (! _file) return 0; 124 | return _file->fileSize(); 125 | } 126 | 127 | void File::close() { 128 | if (_file) { 129 | _file->close(); 130 | free(_file); 131 | _file = 0; 132 | 133 | /* for debugging file open/close leaks 134 | nfilecount--; 135 | Serial.print("Deleted "); 136 | Serial.println(nfilecount, DEC); 137 | */ 138 | } 139 | } 140 | 141 | File::operator bool() { 142 | if (_file) 143 | return _file->isOpen(); 144 | return false; 145 | } 146 | 147 | -------------------------------------------------------------------------------- /libraries/StandardCplusplus/cwctype: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- forwarding header. 2 | 3 | // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 4 | // Free Software Foundation, Inc. 5 | // 6 | // This file is part of the GNU ISO C++ Library. This library is free 7 | // software; you can redistribute it and/or modify it under the 8 | // terms of the GNU General Public License as published by the 9 | // Free Software Foundation; either version 2, or (at your option) 10 | // any later version. 11 | 12 | // This library is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | // GNU General Public License for more details. 16 | 17 | // You should have received a copy of the GNU General Public License along 18 | // with this library; see the file COPYING. If not, write to the Free 19 | // Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, 20 | // USA. 21 | 22 | // As a special exception, you may use this file as part of a free software 23 | // library without restriction. Specifically, if other files instantiate 24 | // templates or use macros or inline functions from this file, or you compile 25 | // this file and link it with other files to produce an executable, this 26 | // file does not by itself cause the resulting executable to be covered by 27 | // the GNU General Public License. This exception does not however 28 | // invalidate any other reasons why the executable file might be covered by 29 | // the GNU General Public License. 30 | 31 | // 32 | // ISO C++ 14882: 33 | // 34 | 35 | /** @file cwctype 36 | * This is a Standard C++ Library file. You should @c #include this file 37 | * in your programs, rather than any of the "*.h" implementation files. 38 | * 39 | * This is the C++ version of the Standard C Library header @c wctype.h, 40 | * and its contents are (mostly) the same as that header, but are all 41 | * contained in the namespace @c std. 42 | */ 43 | 44 | #ifndef _CPP_CWCTYPE 45 | #define _CPP_CWCTYPE 1 46 | 47 | #pragma GCC system_header 48 | 49 | //#include 50 | 51 | #ifdef __UCLIBCXX_HAS_WCHAR__ 52 | #include 53 | #endif 54 | 55 | // Get rid of those macros defined in in lieu of real functions. 56 | #undef iswalnum 57 | #undef iswalpha 58 | #undef iswblank 59 | #undef iswcntrl 60 | #undef iswdigit 61 | #undef iswgraph 62 | #undef iswlower 63 | #undef iswprint 64 | #undef iswprint 65 | #undef iswpunct 66 | #undef iswspace 67 | #undef iswupper 68 | #undef iswxdigit 69 | #undef iswctype 70 | #undef towlower 71 | #undef towupper 72 | #undef towctrans 73 | #undef wctrans 74 | #undef wctype 75 | 76 | #if __UCLIBCXX_HAS_WCHAR__ 77 | namespace std 78 | { 79 | using ::wint_t; // cwchar 80 | 81 | using ::wctype_t; 82 | using ::wctrans_t; 83 | 84 | using ::iswalnum; 85 | using ::iswalpha; 86 | using ::iswblank; 87 | using ::iswcntrl; 88 | using ::iswdigit; 89 | using ::iswgraph; 90 | using ::iswlower; 91 | using ::iswprint; 92 | using ::iswprint; 93 | using ::iswpunct; 94 | using ::iswspace; 95 | using ::iswupper; 96 | using ::iswxdigit; 97 | using ::iswctype; 98 | using ::towlower; 99 | using ::towupper; 100 | using ::towctrans; 101 | using ::wctrans; 102 | using ::wctype; 103 | } 104 | #endif //__ULIBCXX_HAS_WCHAR__ 105 | 106 | #endif 107 | --------------------------------------------------------------------------------