From e9374dbe3cd13e59b2c87ee7404ed57e87130247 Mon Sep 17 00:00:00 2001 From: Brian Park Date: Fri, 1 Oct 2021 13:27:30 -0700 Subject: [PATCH 01/13] cores/epoxy/main.cpp: Simplify disableRawMode() to handle normal and Ctrl-C exit --- cores/epoxy/main.cpp | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/cores/epoxy/main.cpp b/cores/epoxy/main.cpp index cd19d2b..6c9cdc8 100644 --- a/cores/epoxy/main.cpp +++ b/cores/epoxy/main.cpp @@ -45,13 +45,14 @@ static void disableRawMode() { if (inRawMode) { if (tcsetattr(STDIN_FILENO, TCSAFLUSH, &orig_termios) == -1) { inRawMode = false; // prevent exit(1) from being called twice - die("disableRawMode(): tcsetattr() failure"); + perror("disableRawMode(): tcsetattr() failure"); } } if (inNonBlockingMode) { if (fcntl(STDIN_FILENO, F_SETFL, orig_stdin_flags) == -1) { - die("enableRawMode(): fcntl() failure"); + inNonBlockingMode = false; // prevent exit(1) from being called twice + perror("enableRawMode(): fcntl() failure"); } } } @@ -105,28 +106,6 @@ static void enableRawMode() { inNonBlockingMode = true; } -static void handleControlC(int /*sig*/) { - if (inRawMode) { - // If this returns an error, don't call die() because it will call exit(), - // which may call this again, causing an infinite recursion. - if (tcsetattr(STDIN_FILENO, TCSAFLUSH, &orig_termios) == -1) { - perror("handleControlC(): tcsetattr() failure"); - } - inRawMode = false; - } - - if (inNonBlockingMode) { - // If this returns an error, don't call die() because it will call exit(), - // which may call this again, causing an infinite recursion. - if (fcntl(STDIN_FILENO, F_SETFL, orig_stdin_flags) == -1) { - perror("handleControlC(): fcntl() failure"); - } - inNonBlockingMode = false; - } - - exit(1); -} - // ----------------------------------------------------------------------- // Main loop. User code will provide setup() and loop(). // ----------------------------------------------------------------------- @@ -141,7 +120,6 @@ int unixhostduino_main(int argc, char** argv) { epoxy_argc = argc; epoxy_argv = argv; - signal(SIGINT, handleControlC); atexit(disableRawMode); enableRawMode(); From 86dddc6587b6fe29bce18f07bbc5c58b66a68e43 Mon Sep 17 00:00:00 2001 From: Brian Park Date: Fri, 1 Oct 2021 13:34:42 -0700 Subject: [PATCH 02/13] EpoxyDuino.mk: Add DEPS parameter to list additional files that the *.ino file depends on --- CHANGELOG.md | 2 ++ EpoxyDuino.mk | 6 +++++- README.md | 14 ++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3217ae3..21994c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # Changelog * Unreleased + * Add optional `DEPS` variable containing header files that the `*.ino` + depends on. * 1.0 (2021-09-30) * Add `epoxy_argc` and `epoxy_argv` as extern global variables which are set to the `argc` and `argv` parameters passed into the global diff --git a/EpoxyDuino.mk b/EpoxyDuino.mk index 95b6a8b..aba4e3f 100644 --- a/EpoxyDuino.mk +++ b/EpoxyDuino.mk @@ -29,6 +29,10 @@ # EpoxyDuino.mk.) # * OBJS # * Additional object (*.o) files needed by the binary +# * DEPS +# * Additional source (*.h, *.cpp) files required by the final executable. +# * These are additional source files which should trigger a recompile +# when they are modified. # * GENERATED # * A list of files which are generated by a script, and therefore can be # deleted by 'make clean' @@ -177,7 +181,7 @@ $(APP_NAME).out: $(OBJS) $(CXX) $(CPPFLAGS) $(CXXFLAGS) -o $@ $^ $(LDFLAGS) # We need to add a rule to treat .ino file as just a normal .cpp. -$(APP_NAME).o: $(APP_NAME).ino +$(APP_NAME).o: $(APP_NAME).ino $(DEPS) $(CXX) $(CPPFLAGS) $(CXXFLAGS) -x c++ -c $< %.o: %.cpp diff --git a/README.md b/README.md index 864c5f0..e50b74c 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,7 @@ The disadvantages are: * [Alternate C++ Compiler](#AlternateCompiler) * [Generated Source Code](#GeneratedSourceCode) * [Additional Clean Up](#AdditionalCleanUp) + * [Additional Dependencies](#AdditionalDependencies) * [Alternate Arduino Core](#AlternateArduinoCore) * [PlatformIO](#PlatformIO) * [Command Line Flags and Arguments](#CommandLineFlagsAndArguments) @@ -488,6 +489,19 @@ more_clean: rm -f epoxyeepromdata ``` + +### Additional Dependencies + +Sometimes the `*.ino` file depend on additional header files within the same +directory. When these header files are modified, the `*.ino` file must be +recompiled. These additional header files can be listed in the `DEPS` variable: + +``` +DEPS := header1.h header2.h +... +include {path/to/EpoxyDuino.mk} +``` + ### Alternate Arduino Core From d5ad74341fc2135d6f06979719cd05ef51af6ab4 Mon Sep 17 00:00:00 2001 From: Brian Park Date: Thu, 21 Oct 2021 19:33:33 -0700 Subject: [PATCH 03/13] README.md: Update Feedback and Support, feature requests should go into Discussions first --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index e50b74c..c6593b0 100644 --- a/README.md +++ b/README.md @@ -867,14 +867,14 @@ None that I am aware of. ## Feedback and Support -If you have any questions, comments and other support questions about how to -use this library, please use the -[GitHub Discussions](https://github.com/bxparks/EpoxyDuino/discussions) -for this project. If you have bug reports or feature requests, please file a -ticket in [GitHub Issues](https://github.com/bxparks/EpoxyDuino/issues). -I'd love to hear about how this software and its documentation can be improved. -I can't promise that I will incorporate everything, but I will give your ideas -serious consideration. +If you have any questions, comments, or feature requests for this library, +please use the [GitHub +Discussions](https://github.com/bxparks/EpoxyDuino/discussions) for this +project. If you have bug reports, please file a ticket in [GitHub +Issues](https://github.com/bxparks/EpoxyDuino/issues). Feature requests should +go into Discussions first because they often have alternative solutions which +are useful to remain visible, instead of disappearing from the default view of +the Issue tracker after the ticket is closed. Please refrain from emailing me directly unless the content is sensitive. The problem with email is that I cannot reference the email conversation when other From 432e3046abd7ebd421497678d29ff8d9f57e2251 Mon Sep 17 00:00:00 2001 From: Brian Park Date: Sun, 5 Dec 2021 10:03:10 -0800 Subject: [PATCH 04/13] cores/epoxy/Print.cpp: Change println() to print just \n instead of \r\n --- CHANGELOG.md | 2 ++ cores/epoxy/Print.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 21994c1..f9eb1af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ * Unreleased * Add optional `DEPS` variable containing header files that the `*.ino` depends on. + * Change `Print::println()` to print just a `\n` instead of `\r\n`, which + is more compatible on Unix where the line terminator is a single `\n`. * 1.0 (2021-09-30) * Add `epoxy_argc` and `epoxy_argv` as extern global variables which are set to the `argc` and `argv` parameters passed into the global diff --git a/cores/epoxy/Print.cpp b/cores/epoxy/Print.cpp index ffd3040..30d6cb9 100644 --- a/cores/epoxy/Print.cpp +++ b/cores/epoxy/Print.cpp @@ -129,7 +129,7 @@ size_t Print::print(const Printable& x) size_t Print::println(void) { - return write("\r\n"); + return write('\n'); } size_t Print::println(const String &s) From 01ec6c5374c124bcac8c5cb33c5b5762537db1ae Mon Sep 17 00:00:00 2001 From: Brian Park Date: Sun, 5 Dec 2021 10:04:40 -0800 Subject: [PATCH 05/13] cores/epoxy/pgmspace.h: Add macros for pgm_read_*_near() and pgm_read_*_far() --- CHANGELOG.md | 2 ++ cores/epoxy/pgmspace.h | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f9eb1af..6061416 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ depends on. * Change `Print::println()` to print just a `\n` instead of `\r\n`, which is more compatible on Unix where the line terminator is a single `\n`. + * Add `pgm_read_XXX_near()` and `pgm_read_XXX_far()` macros which + simply delegate to the `pgm_read_XXX()` macros. * 1.0 (2021-09-30) * Add `epoxy_argc` and `epoxy_argv` as extern global variables which are set to the `argc` and `argv` parameters passed into the global diff --git a/cores/epoxy/pgmspace.h b/cores/epoxy/pgmspace.h index 0e69f2d..8e859e6 100644 --- a/cores/epoxy/pgmspace.h +++ b/cores/epoxy/pgmspace.h @@ -27,6 +27,18 @@ #define pgm_read_float(p) (* (const float*) (p)) #define pgm_read_ptr(p) (* (const void* const*) (p)) +#define pgm_read_byte_near(addr) pgm_read_byte(addr) +#define pgm_read_word_near(addr) pgm_read_word(addr) +#define pgm_read_dword_near(addr) pgm_read_dword(addr) +#define pgm_read_float_near(addr) pgm_read_float(addr) +#define pgm_read_ptr_near(addr) pgm_read_ptr(addr) + +#define pgm_read_byte_far(addr) pgm_read_byte(addr) +#define pgm_read_word_far(addr) pgm_read_word(addr) +#define pgm_read_dword_far(addr) pgm_read_dword(addr) +#define pgm_read_float_far(addr) pgm_read_float(addr) +#define pgm_read_ptr_far(addr) pgm_read_ptr(addr) + #define strlen_P strlen #define strcat_P strcat #define strcpy_P strcpy From 8b44fa89e29d4c3c615591c29deddf3d7cd54ceb Mon Sep 17 00:00:00 2001 From: Brian Park Date: Sun, 5 Dec 2021 13:20:25 -0800 Subject: [PATCH 06/13] cores/epoxy/Arduino.h: Add clockCyclesPerMicrosecond(), clockCyclesToMicroseconds(), microsecondsToClockCycles(), and fake F_CPU macros --- CHANGELOG.md | 3 +++ cores/epoxy/Arduino.h | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6061416..5cf0a01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ is more compatible on Unix where the line terminator is a single `\n`. * Add `pgm_read_XXX_near()` and `pgm_read_XXX_far()` macros which simply delegate to the `pgm_read_XXX()` macros. + * Add `clockCyclesPerMicrosecond()`, `clockCyclesToMicroseconds(a)`, + and `microsecondsToClockCycles(a)` macros. Set a fake `F_CPU` to 16MHz + on Unix machines. * 1.0 (2021-09-30) * Add `epoxy_argc` and `epoxy_argv` as extern global variables which are set to the `argc` and `argv` parameters passed into the global diff --git a/cores/epoxy/Arduino.h b/cores/epoxy/Arduino.h index 77c4cfe..2ab0408 100644 --- a/cores/epoxy/Arduino.h +++ b/cores/epoxy/Arduino.h @@ -148,6 +148,12 @@ #define interrupts() #define noInterrupts() +// Fake the CPU clock to 16MHz on Linxu or MacOS. +#define F_CPU 16000000 +#define clockCyclesPerMicrosecond() ( F_CPU / 1000000L ) +#define clockCyclesToMicroseconds(a) ( (a) / clockCyclesPerMicrosecond() ) +#define microsecondsToClockCycles(a) ( (a) * clockCyclesPerMicrosecond() ) + #define bit(b) (1UL << (b)) #if defined(EPOXY_CORE_ESP8266) #define _BV(b) (1UL << (b)) From 71a24b278c84c98639d857b08ed1ab8d5361e911 Mon Sep 17 00:00:00 2001 From: Brian Park Date: Sun, 5 Dec 2021 13:23:49 -0800 Subject: [PATCH 07/13] cores/epoxy/Arduino.h: Add bitRead(), bitSet(), bitClear(), bitWrite(), and bitToggle() --- CHANGELOG.md | 3 +++ cores/epoxy/Arduino.h | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5cf0a01..087bd79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,9 @@ * Add `clockCyclesPerMicrosecond()`, `clockCyclesToMicroseconds(a)`, and `microsecondsToClockCycles(a)` macros. Set a fake `F_CPU` to 16MHz on Unix machines. + * Add `bitRead()`, `bitSet()`, `bitClear()`, `bitWrite()` macros. Add + `bitToggle()` macro as well, which seems to be defined only on the + Arduino AVR core. * 1.0 (2021-09-30) * Add `epoxy_argc` and `epoxy_argv` as extern global variables which are set to the `argc` and `argv` parameters passed into the global diff --git a/cores/epoxy/Arduino.h b/cores/epoxy/Arduino.h index 2ab0408..ec596ce 100644 --- a/cores/epoxy/Arduino.h +++ b/cores/epoxy/Arduino.h @@ -162,6 +162,13 @@ #define lowByte(w) ((uint8_t) ((w) & 0xff)) #define highByte(w) ((uint8_t) ((w) >> 8)) +// bitToggle() is defined only on Arduino AVR as far as I can tell. +#define bitRead(value, bit) (((value) >> (bit)) & 0x01) +#define bitSet(value, bit) ((value) |= (1UL << (bit))) +#define bitClear(value, bit) ((value) &= ~(1UL << (bit))) +#define bitToggle(value, bit) ((value) ^= (1UL << (bit))) +#define bitWrite(value, bit, bitvalue) ((bitvalue) ? bitSet(value, bit) : bitClear(value, bit)) + extern "C" { typedef bool boolean; From 33561a19e261c505aab8320e044051756a19a3b7 Mon Sep 17 00:00:00 2001 From: Brian Park Date: Tue, 7 Dec 2021 18:52:35 -0800 Subject: [PATCH 08/13] libraries/EpoxyMockTimerOne: Fix typos --- libraries/EpoxyMockTimerOne/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/EpoxyMockTimerOne/README.md b/libraries/EpoxyMockTimerOne/README.md index e179a7e..cc676a6 100644 --- a/libraries/EpoxyMockTimerOne/README.md +++ b/libraries/EpoxyMockTimerOne/README.md @@ -1,4 +1,4 @@ -# EpocyMockTimerOne Library +# EpoxyMockTimerOne Library A mock implementation of the `TimerOne` library (https://github.com/PaulStoffregen/TimerOne) to allow code written against @@ -35,6 +35,6 @@ Then add `EpoxyMockTimerOne` to the `ARDUINO_LIBS` in the EpoxyDuino `Makefile`: ```make APP_NAME := MyApp -ARDUINO_LIBS := EpocyMockTimerOne ... +ARDUINO_LIBS := EpoxyMockTimerOne ... include ../../../../EpoxyDuino.mk ``` From 241527896332cb582affe277e909e94e09125cd3 Mon Sep 17 00:00:00 2001 From: Brian Park Date: Tue, 7 Dec 2021 19:01:09 -0800 Subject: [PATCH 09/13] Arduino.h: Add min(), max(), abs(), etc --- CHANGELOG.md | 3 +++ cores/epoxy/Arduino.h | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 087bd79..7485b9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,9 @@ * Add `bitRead()`, `bitSet()`, `bitClear()`, `bitWrite()` macros. Add `bitToggle()` macro as well, which seems to be defined only on the Arduino AVR core. + * Add `min()`, `max()`, `abs()`, etc. I don't normally use these Arduino + macros in my libraries, but many other 3rd party libraries do. To compile + those libraries under EpoxyDuino, we have to define them. * 1.0 (2021-09-30) * Add `epoxy_argc` and `epoxy_argv` as extern global variables which are set to the `argc` and `argv` parameters passed into the global diff --git a/cores/epoxy/Arduino.h b/cores/epoxy/Arduino.h index ec596ce..3fa5466 100644 --- a/cores/epoxy/Arduino.h +++ b/cores/epoxy/Arduino.h @@ -144,6 +144,15 @@ #define NOT_AN_INTERRUPT -1 #define NOT_ON_TIMER 0 +#define min(a,b) ((a)<(b)?(a):(b)) +#define max(a,b) ((a)>(b)?(a):(b)) +#define abs(x) ((x)>0?(x):-(x)) +#define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt))) +#define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5)) +#define radians(deg) ((deg)*DEG_TO_RAD) +#define degrees(rad) ((rad)*RAD_TO_DEG) +#define sq(x) ((x)*(x)) + // Stub implementations #define interrupts() #define noInterrupts() From 6b2eeea07da40f1aec5004ff33f767ad22c61923 Mon Sep 17 00:00:00 2001 From: Brian Park Date: Tue, 7 Dec 2021 19:05:19 -0800 Subject: [PATCH 10/13] libraries/EpoxyMockFastLED: Add mock version of FastLED library --- CHANGELOG.md | 3 + libraries/EpoxyMockFastLED/FastLED.cpp | 16 + libraries/EpoxyMockFastLED/FastLED.h | 618 +++++++++++++++++++++++++ libraries/EpoxyMockFastLED/README.md | 41 ++ 4 files changed, 678 insertions(+) create mode 100644 libraries/EpoxyMockFastLED/FastLED.cpp create mode 100644 libraries/EpoxyMockFastLED/FastLED.h create mode 100644 libraries/EpoxyMockFastLED/README.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 7485b9a..1907c18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,9 @@ * Add `min()`, `max()`, `abs()`, etc. I don't normally use these Arduino macros in my libraries, but many other 3rd party libraries do. To compile those libraries under EpoxyDuino, we have to define them. + * Add a minimal mock implementation of + [FastLED](https://github.com/FastLED/FastLED) sufficient for my personal + project. * 1.0 (2021-09-30) * Add `epoxy_argc` and `epoxy_argv` as extern global variables which are set to the `argc` and `argv` parameters passed into the global diff --git a/libraries/EpoxyMockFastLED/FastLED.cpp b/libraries/EpoxyMockFastLED/FastLED.cpp new file mode 100644 index 0000000..be42d68 --- /dev/null +++ b/libraries/EpoxyMockFastLED/FastLED.cpp @@ -0,0 +1,16 @@ +/* + * MIT License + * Copyright (c) 2013 FastLED + * Copyright (c) 2021 Brian T. Park + */ + +#include "FastLED.h" + +CFastLED FastLED; + +const TProgmemRGBPalette16 PartyColors_p = { + 0x5500AB, 0x84007C, 0xB5004B, 0xE5001B, + 0xE81700, 0xB84700, 0xAB7700, 0xABAB00, + 0xAB5500, 0xDD2200, 0xF2000E, 0xC2003E, + 0x8F0071, 0x5F00A1, 0x2F00D0, 0x0007F9 +}; diff --git a/libraries/EpoxyMockFastLED/FastLED.h b/libraries/EpoxyMockFastLED/FastLED.h new file mode 100644 index 0000000..e0d1a53 --- /dev/null +++ b/libraries/EpoxyMockFastLED/FastLED.h @@ -0,0 +1,618 @@ +/* + * MIT License + * Copyright (c) 2013 FastLED + * Copyright (c) 2021 Brian T. Park + */ + +/** + * @file Simple mock implementation of the FastLED library + * (https://github.com/FastLED/FastLED) to allow code written against + * that library to compile under EpoxyDuino. + */ + +#ifndef EPOXY_MOCK_FAST_LED_H +#define EPOXY_MOCK_FAST_LED_H + +#include // uint8_t + +//----------------------------------------------------------------------------- +// From FastLED/src/led_sysdefs.h +//----------------------------------------------------------------------------- + +#define FASTLED_USING_NAMESPACE + +//----------------------------------------------------------------------------- +// From FastLED/src/pixeltypes.h +//----------------------------------------------------------------------------- + +struct CHSV { + union { + struct { + union { + uint8_t hue; + uint8_t h; + }; + union { + uint8_t saturation; + uint8_t sat; + uint8_t s; + }; + union { + uint8_t value; + uint8_t val; + uint8_t v; + }; + }; + uint8_t raw[3]; + }; + + // constructor + CHSV(uint8_t ih, uint8_t is, uint8_t iv) + : h(ih), s(is), v(iv) + {} + + // copy constructor + CHSV(const CHSV& rhs) = default; + + // assignment operator + CHSV& operator=(const CHSV& rhs) = default; +}; + +struct CRGB { + union { + struct { + union { + uint8_t r; + uint8_t red; + }; + union { + uint8_t g; + uint8_t green; + }; + union { + uint8_t b; + uint8_t blue; + }; + }; + uint8_t raw[3]; + }; + + CRGB() { + r = g = b = 0; + } + + // constructor + CRGB(uint8_t ir, uint8_t ig, uint8_t ib) + : r(ir), g(ig), b(ib) + {} + + // copy constructor + CRGB(const CRGB& rhs) = default; + + CRGB(uint32_t colorcode) : + r((colorcode >> 16) & 0xFF), + g((colorcode >> 8) & 0xFF), + b((colorcode >> 0) & 0xFF) + {} + + // assignment operator + CRGB& operator= (const CRGB& rhs) = default; + + /// allow construction from HSV color + CRGB(const CHSV& rhs) { + // This does not perform the correct conversion. Defined only for mocking. + r = rhs.h; + g = rhs.s; + b = rhs.v; + } + + CRGB& operator+= (const CRGB& rhs) { + r += rhs.r; + g += rhs.g; + b += rhs.b; + return *this; + } + + CRGB& operator%= (uint8_t scaledown) { + (void) scaledown; + return *this; + } + + CRGB& operator|= (const CRGB& rhs) { + if (rhs.r > r) r = rhs.r; + if (rhs.g > g) g = rhs.g; + if (rhs.b > b) b = rhs.b; + return *this; + } + + /// Predefined RGB colors + typedef enum { + AliceBlue=0xF0F8FF, + Amethyst=0x9966CC, + AntiqueWhite=0xFAEBD7, + Aqua=0x00FFFF, + Aquamarine=0x7FFFD4, + Azure=0xF0FFFF, + Beige=0xF5F5DC, + Bisque=0xFFE4C4, + Black=0x000000, + BlanchedAlmond=0xFFEBCD, + Blue=0x0000FF, + BlueViolet=0x8A2BE2, + Brown=0xA52A2A, + BurlyWood=0xDEB887, + CadetBlue=0x5F9EA0, + Chartreuse=0x7FFF00, + Chocolate=0xD2691E, + Coral=0xFF7F50, + CornflowerBlue=0x6495ED, + Cornsilk=0xFFF8DC, + Crimson=0xDC143C, + Cyan=0x00FFFF, + DarkBlue=0x00008B, + DarkCyan=0x008B8B, + DarkGoldenrod=0xB8860B, + DarkGray=0xA9A9A9, + DarkGrey=0xA9A9A9, + DarkGreen=0x006400, + DarkKhaki=0xBDB76B, + DarkMagenta=0x8B008B, + DarkOliveGreen=0x556B2F, + DarkOrange=0xFF8C00, + DarkOrchid=0x9932CC, + DarkRed=0x8B0000, + DarkSalmon=0xE9967A, + DarkSeaGreen=0x8FBC8F, + DarkSlateBlue=0x483D8B, + DarkSlateGray=0x2F4F4F, + DarkSlateGrey=0x2F4F4F, + DarkTurquoise=0x00CED1, + DarkViolet=0x9400D3, + DeepPink=0xFF1493, + DeepSkyBlue=0x00BFFF, + DimGray=0x696969, + DimGrey=0x696969, + DodgerBlue=0x1E90FF, + FireBrick=0xB22222, + FloralWhite=0xFFFAF0, + ForestGreen=0x228B22, + Fuchsia=0xFF00FF, + Gainsboro=0xDCDCDC, + GhostWhite=0xF8F8FF, + Gold=0xFFD700, + Goldenrod=0xDAA520, + Gray=0x808080, + Grey=0x808080, + Green=0x008000, + GreenYellow=0xADFF2F, + Honeydew=0xF0FFF0, + HotPink=0xFF69B4, + IndianRed=0xCD5C5C, + Indigo=0x4B0082, + Ivory=0xFFFFF0, + Khaki=0xF0E68C, + Lavender=0xE6E6FA, + LavenderBlush=0xFFF0F5, + LawnGreen=0x7CFC00, + LemonChiffon=0xFFFACD, + LightBlue=0xADD8E6, + LightCoral=0xF08080, + LightCyan=0xE0FFFF, + LightGoldenrodYellow=0xFAFAD2, + LightGreen=0x90EE90, + LightGrey=0xD3D3D3, + LightPink=0xFFB6C1, + LightSalmon=0xFFA07A, + LightSeaGreen=0x20B2AA, + LightSkyBlue=0x87CEFA, + LightSlateGray=0x778899, + LightSlateGrey=0x778899, + LightSteelBlue=0xB0C4DE, + LightYellow=0xFFFFE0, + Lime=0x00FF00, + LimeGreen=0x32CD32, + Linen=0xFAF0E6, + Magenta=0xFF00FF, + Maroon=0x800000, + MediumAquamarine=0x66CDAA, + MediumBlue=0x0000CD, + MediumOrchid=0xBA55D3, + MediumPurple=0x9370DB, + MediumSeaGreen=0x3CB371, + MediumSlateBlue=0x7B68EE, + MediumSpringGreen=0x00FA9A, + MediumTurquoise=0x48D1CC, + MediumVioletRed=0xC71585, + MidnightBlue=0x191970, + MintCream=0xF5FFFA, + MistyRose=0xFFE4E1, + Moccasin=0xFFE4B5, + NavajoWhite=0xFFDEAD, + Navy=0x000080, + OldLace=0xFDF5E6, + Olive=0x808000, + OliveDrab=0x6B8E23, + Orange=0xFFA500, + OrangeRed=0xFF4500, + Orchid=0xDA70D6, + PaleGoldenrod=0xEEE8AA, + PaleGreen=0x98FB98, + PaleTurquoise=0xAFEEEE, + PaleVioletRed=0xDB7093, + PapayaWhip=0xFFEFD5, + PeachPuff=0xFFDAB9, + Peru=0xCD853F, + Pink=0xFFC0CB, + Plaid=0xCC5533, + Plum=0xDDA0DD, + PowderBlue=0xB0E0E6, + Purple=0x800080, + Red=0xFF0000, + RosyBrown=0xBC8F8F, + RoyalBlue=0x4169E1, + SaddleBrown=0x8B4513, + Salmon=0xFA8072, + SandyBrown=0xF4A460, + SeaGreen=0x2E8B57, + Seashell=0xFFF5EE, + Sienna=0xA0522D, + Silver=0xC0C0C0, + SkyBlue=0x87CEEB, + SlateBlue=0x6A5ACD, + SlateGray=0x708090, + SlateGrey=0x708090, + Snow=0xFFFAFA, + SpringGreen=0x00FF7F, + SteelBlue=0x4682B4, + Tan=0xD2B48C, + Teal=0x008080, + Thistle=0xD8BFD8, + Tomato=0xFF6347, + Turquoise=0x40E0D0, + Violet=0xEE82EE, + Wheat=0xF5DEB3, + White=0xFFFFFF, + WhiteSmoke=0xF5F5F5, + Yellow=0xFFFF00, + YellowGreen=0x9ACD32, + + // LED RGB color that roughly approximates + // the color of incandescent fairy lights, + // assuming that you're using FastLED + // color correction on your LEDs (recommended). + FairyLight=0xFFE42D, + // If you are using no color correction, use this + FairyLightNCC=0xFF9D2A + + } HTMLColorCode; +}; + +//----------------------------------------------------------------------------- +// From FastLED/src/lib8tion.h +//----------------------------------------------------------------------------- + +typedef uint8_t fract8; +typedef int8_t sfract7; +typedef uint16_t fract16; +typedef int16_t sfract15; + +typedef uint16_t accum88; +typedef int16_t saccum78; +typedef uint32_t accum1616; +typedef int32_t saccum1516; +typedef uint16_t accum124; +typedef int32_t saccum114; + +extern "C" { +inline void * memmove8(void * dst, const void * src, uint16_t num) { + (void) dst; + (void) src; + (void) num; + return nullptr; +} + +inline void * memcpy8(void * dst, const void * src, uint16_t num) { + (void) dst; + (void) src; + (void) num; + return nullptr; +} + +inline void * memset8(void * ptr, uint8_t value, uint16_t num) { + (void) ptr; + (void) value; + (void) num; + return nullptr; +} +} + +inline uint8_t random8() { return 0; } + +inline uint8_t random8(uint8_t lim) { + (void) lim; + return 0; +} + +inline uint8_t random8(uint8_t min, uint8_t lim) { + (void) min; + (void) lim; + return 0; +} + +inline uint16_t random16() { return 0; } + +inline uint16_t random16( uint16_t lim) { + (void) lim; + return 0; +} + +inline uint16_t random16( uint16_t min, uint16_t lim) { + (void) min; + (void) lim; + return 0; +} + +inline uint8_t beatsin8( + accum88 beats_per_minute, + uint8_t lowest = 0, + uint8_t highest = 255, + uint32_t timebase = 0, + uint8_t phase_offset = 0) { + (void) beats_per_minute; + (void) lowest; + (void) highest; + (void) timebase; + (void) phase_offset; + return 0; +} + +inline uint16_t beatsin16( + accum88 beats_per_minute, + uint16_t lowest = 0, + uint16_t highest = 65535, + uint32_t timebase = 0, + uint16_t phase_offset = 0) { + (void) beats_per_minute; + (void) lowest; + (void) highest; + (void) timebase; + (void) phase_offset; + return 0; +} + +inline uint16_t beat16(accum88 beats_per_minute, uint32_t timebase = 0) { + (void) beats_per_minute; + (void) timebase; + return 0; +} + +#define EVERY_N_MILLISECONDS(N) while (false) + +//----------------------------------------------------------------------------- +// FastLED/src/lib8tion/trig8.h, +//----------------------------------------------------------------------------- + +inline uint8_t sin8(uint8_t theta) { + (void) theta; + return 0; +} + +inline uint8_t cos8(uint8_t theta) { + (void) theta; + return 0; +} + +//----------------------------------------------------------------------------- +// FastLED/src/lib8tion/scale8.h +//----------------------------------------------------------------------------- + +inline uint8_t scale8(uint8_t i, fract8 scale) { + return ((uint16_t) i * (uint16_t) scale) >> 8; +} + +inline uint16_t scale16( uint16_t i, fract16 scale) { + return ((uint32_t) i * (uint32_t) scale) / 65536; +} + +//----------------------------------------------------------------------------- +// From FastLED/src/colorutils.h +//----------------------------------------------------------------------------- + +typedef uint32_t TProgmemRGBPalette16[16]; + +class CRGBPalette16 { + public: + CRGB entries[16]; + + CRGBPalette16(const TProgmemRGBPalette16& rhs) { + for(uint8_t i = 0; i < 16; ++i) { + entries[i] = rhs[i]; + } + } +}; + +typedef enum { NOBLEND=0, LINEARBLEND=1 } TBlendType; + +inline CRGB ColorFromPalette( + const CRGBPalette16& pal, + uint8_t index, + uint8_t brightness=255, + TBlendType blendType=LINEARBLEND) { + (void) pal; + (void) index; + (void) brightness; + (void) blendType; + return CRGB(); +} + +inline void fadeToBlackBy(CRGB* leds, uint16_t num_leds, uint8_t fadeBy) { + (void) leds; + (void) num_leds; + (void) fadeBy; +} + +inline void fill_solid( + struct CRGB * leds, + int numToFill, + const struct CRGB& color) { + (void) leds; + (void) numToFill; + (void) color; +} + +//----------------------------------------------------------------------------- +// From FastLED/src/colorpalettes.h +//----------------------------------------------------------------------------- + +extern const TProgmemRGBPalette16 PartyColors_p; + +//----------------------------------------------------------------------------- +// From FastLED/src/controller.h +//----------------------------------------------------------------------------- + +#define DISABLE_DITHER 0x00 +#define BINARY_DITHER 0x01 + +//----------------------------------------------------------------------------- +// From FastLED/src/FastLED.h +//----------------------------------------------------------------------------- + +class CFastLED { + // int m_nControllers; + uint8_t m_Scale; ///< The current global brightness scale setting + uint16_t m_nFPS; ///< Tracking for current FPS value + +public: + CFastLED() {} + + /// Set the global brightness scaling + /// @param scale a 0-255 value for how much to scale all leds before writing them out + void setBrightness(uint8_t scale) { m_Scale = scale; } + + /// Get the current global brightness setting + /// @returns the current global brightness value + uint8_t getBrightness() { return m_Scale; } + + /// Set the maximum power to be used, given in volts and milliamps. + /// @param volts - how many volts the leds are being driven at (usually 5) + /// @param milliamps - the maximum milliamps of power draw you want + void setMaxPowerInVoltsAndMilliamps(uint8_t volts, uint32_t milliamps) { + (void) volts; + (void) milliamps; + } + + /// Set the maximum power to be used, given in milliwatts + /// @param milliwatts - the max power draw desired, in milliwatts + void setMaxPowerInMilliWatts(uint32_t milliwatts) { + (void) milliwatts; + } + + /// Update all our controllers with the current led colors, using the passed in brightness + /// @param scale temporarily override the scale + void show(uint8_t scale) { + (void) scale; + } + + /// Update all our controllers with the current led colors + void show() { show(m_Scale); } + + /// clear the leds, wiping the local array of data, optionally black out the leds as well + /// @param writeData whether or not to write out to the leds as well + void clear(bool writeData = false) { + (void) writeData; + } + + /// clear out the local data array + void clearData() {} + + /// Set all leds on all controllers to the given color/scale + /// @param color what color to set the leds to + /// @param scale what brightness scale to show at + void showColor(const struct CRGB & color, uint8_t scale) { + (void) color; + (void) scale; + } + + /// Set all leds on all controllers to the given color + /// @param color what color to set the leds to + void showColor(const struct CRGB & color) { showColor(color, m_Scale); } + + /// Delay for the given number of milliseconds. Provided to allow the library to be used on platforms + /// that don't have a delay function (to allow code to be more portable). Note: this will call show + /// constantly to drive the dithering engine (and will call show at least once). + /// @param ms the number of milliseconds to pause for + void delay(unsigned long ms) { + (void) ms; + } + + /// Set a global color temperature. Sets the color temperature for all added led strips, overriding whatever + /// previous color temperature those controllers may have had + /// @param temp A CRGB structure describing the color temperature + void setTemperature(const struct CRGB & temp) { + (void) temp; + } + + /// Set a global color correction. Sets the color correction for all added led strips, + /// overriding whatever previous color correction those controllers may have had. + /// @param correction A CRGB structure describin the color correction. + void setCorrection(const struct CRGB & correction) { + (void) correction; + } + + /// Set the dithering mode. Sets the dithering mode for all added led strips, overriding + /// whatever previous dithering option those controllers may have had. + /// @param ditherMode - what type of dithering to use, either BINARY_DITHER or DISABLE_DITHER + void setDither(uint8_t ditherMode = BINARY_DITHER) { + (void) ditherMode; + } + + /// Set the maximum refresh rate. This is global for all leds. Attempts to + /// call show faster than this rate will simply wait. Note that the refresh rate + /// defaults to the slowest refresh rate of all the leds added through addLeds. If + /// you wish to set/override this rate, be sure to call setMaxRefreshRate _after_ + /// adding all of your leds. + /// @param refresh - maximum refresh rate in hz + /// @param constrain - constrain refresh rate to the slowest speed yet set + void setMaxRefreshRate(uint16_t refresh, bool constrain=false) { + (void) refresh; + (void) constrain; + } + + /// for debugging, will keep track of time between calls to countFPS, and every + /// nFrames calls, it will update an internal counter for the current FPS. + /// @todo make this a rolling counter + /// @param nFrames - how many frames to time for determining FPS + void countFPS(int nFrames=25) { + (void) nFrames; + } + + /// Get the number of frames/second being written out + /// @returns the most recently computed FPS value + uint16_t getFPS() { return m_nFPS; } + + /// Get how many controllers have been registered + /// @returns the number of controllers (strips) that have been added with addLeds + int count() { return 0; } + + /// Get the number of leds in the first controller + /// @returns the number of LEDs in the first controller + int size() { return 0; } + + /// Get a pointer to led data for the first controller + /// @returns pointer to the CRGB buffer for the first controller + CRGB *leds() { return nullptr; } +}; + +extern CFastLED FastLED; + +//----------------------------------------------------------------------------- +// From FastLED/src/power_mgt.h +//----------------------------------------------------------------------------- + +inline void set_max_power_in_volts_and_milliamps( + uint8_t volts, uint32_t milliamps) { + (void) volts; + (void) milliamps; +} + +#endif diff --git a/libraries/EpoxyMockFastLED/README.md b/libraries/EpoxyMockFastLED/README.md new file mode 100644 index 0000000..088703f --- /dev/null +++ b/libraries/EpoxyMockFastLED/README.md @@ -0,0 +1,41 @@ +# EpoxyMockFastLED Library + +A mock implementation of the [FastLED +library](https://github.com/FastLED/FastLED) to allow code written against that +library to compile under EpoxyDuino. This library implements just enough +functionality to allow the `ledstrips/LedController` application to compile. + +## Usage + +### Code Changes + +Code written against `FastLED` should compile mostly without change with this +mock library. Most methods are stubbed out with empty function bodies. + +```C++ +#include +#include +... +``` + +The `FastLED.addLeds()` is a very complex, templatized, and overloaded set +of methods. They are not mocked out in this library. The code that calls +`addLeds()` should be conditionally commented out using something like: + +```C++ +#if ! defined(EPOXY_DUINO) + FastLED.addLeds(leds, NUM_LEDS) + .setCorrection(TypicalLEDStrip); +#endif +``` + +### Makefile + +Add `EpoxyMockFastLED` to the `ARDUINO_LIBS` in the EpoxyDuino `Makefile`: + +```make +APP_NAME := MyApp +ARDUINO_LIBS := EpoxyMockFastLED ... +include ../../../../EpoxyDuino.mk +``` + From 656695e3d0cb85c118eef3af129c92d86d2c4b93 Mon Sep 17 00:00:00 2001 From: Brian Park Date: Tue, 7 Dec 2021 19:32:46 -0800 Subject: [PATCH 11/13] Arduino.h: Replace min(), max(), abs() and round() with std:: versions, to allow overloading --- cores/epoxy/Arduino.h | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/cores/epoxy/Arduino.h b/cores/epoxy/Arduino.h index 3fa5466..61becc3 100644 --- a/cores/epoxy/Arduino.h +++ b/cores/epoxy/Arduino.h @@ -17,6 +17,8 @@ #define EPOXY_DUINO_VERSION 10000 #define EPOXY_DUINO_VERSION_STRING "1.0.0" +#include // min(), max() +#include // abs() #include #include #include @@ -144,11 +146,22 @@ #define NOT_AN_INTERRUPT -1 #define NOT_ON_TIMER 0 -#define min(a,b) ((a)<(b)?(a):(b)) -#define max(a,b) ((a)>(b)?(a):(b)) -#define abs(x) ((x)>0?(x):-(x)) +// Arduino defines min(), max(), abs(), and round() using c-preprocessor macros +// in the global namespace. But this breaks the EpoxyFS library, which depends +// on 3rd party Unix libraries, which in turn assume that these are functions +// that can be overloaded. For EpoxyDuino, instead of macros, let's use the +// versions defined by and in the std:: namespace and lift +// them into the global namespace. +// +// #define min(a,b) ((a)<(b)?(a):(b)) +// #define max(a,b) ((a)>(b)?(a):(b)) +// #define abs(x) ((x)>0?(x):-(x)) +// #define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5)) +using std::min; +using std::max; +using std::abs; +using std::round; #define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt))) -#define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5)) #define radians(deg) ((deg)*DEG_TO_RAD) #define degrees(rad) ((rad)*RAD_TO_DEG) #define sq(x) ((x)*(x)) From 4d2571c226dfb616dab651ec5212a7ec46ebdc7d Mon Sep 17 00:00:00 2001 From: Brian Park Date: Wed, 8 Dec 2021 08:21:02 -0800 Subject: [PATCH 12/13] README.md: Add EpoxyMockFastLED; add additional functions from Arduino.h --- README.md | 46 +++++++++++++++++++++++++++++++++++----------- 1 file changed, 35 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index c6593b0..350c740 100644 --- a/README.md +++ b/README.md @@ -23,8 +23,21 @@ produces an executable with a `.out` extension, for example, `SampleTest.out`. The `Serial` port object sends the output to the `STDOUT` and reads from the `STDIN` of the Unix host environment. Most other hardware dependent features (e.g. I2C, SPI, GPIO) are stubbed out (defined but don't do anything) -to allow the Arduino programs to compile. This may be sufficient for a CI -pipeline. For actual application development, I have started to build a set of +to allow the Arduino programs to compile. Mock versions of various libraries are +also provided: + +* ``: mock I2C library +* ``: mock SPI library +* [EpoxyMockDigitalWriteFast](libraries/EpoxyMockDigitalWriteFast): mock + version of the `digitalWriteFast` libraries +* [EpoxyMockTimerOne](libraries/EpoxyMockTimerOne): mock version of the + TimerOne (https://github.com/PaulStoffregen/TimerOne) library +* [EpoxyMockFastLED](libraries/EpoxyMockFastLED/): mock version of the + FastLED (https://github.com/FastLED/FastLED) library + +These mock libraries may be sufficient for a CI pipeline. + +For actual application development, I have started to build a set of libraries within EpoxyDuino which emulate the versions that run the actual hardware: @@ -620,7 +633,8 @@ A more advanced example can be seen in ### Arduino Functions -The following functions and features of the Arduino framework are implemented: +The following is an incomplete list of Arduino functions and features +which are implemented: * `Arduino.h` * `setup()`, `loop()` @@ -629,6 +643,12 @@ The following functions and features of the Arduino framework are implemented: * `digitalWrite()`, `digitalRead()`, `pinMode()` (empty stubs) * `analogRead()`, `analogWrite()` (empty stubs) * `pulseIn()`, `pulseInLong()`, `shiftIn()`, `shiftOut()` (empty stubs) + * `min()`, `max()`, `abs()`, `round()`, etc + * `bit()`, `bitRead()`, `bitSet()`, `bitClear()`, `bitWrite()` + * `random()`, `randomSeed()`, `map()` + * `makeWord()` + * `F_CPU`, `clockCyclesPerMicrosecond(), `clockCyclesToMicroseconds(), + `microsecondsToClockCycles()` * `HIGH`, `LOW`, `INPUT`, `OUTPUT`, `INPUT_PULLUP` * I2C and SPI pins: `SS`, `MOSI`, `MISO`, `SCK`, `SDA`, `SCL` * typedefs: `boolean`, `byte`, `word` @@ -658,14 +678,13 @@ The following functions and features of the Arduino framework are implemented: * `Wire.h` (stub implementation) * `SPI.h` (stub implementation) -See -[Arduino.h](https://github.com/bxparks/EpoxyDuino/blob/develop/cores/epoxy/Arduino.h) +See [Arduino.h](cores/epoxy/Arduino.h) for the latest list. Most of the header files included by this `Arduino.h` file were copied and modified from the [arduino:avr core](https://github.com/arduino/ArduinoCore-avr/tree/master/cores/arduino), -versions 1.8.2 (if I recall) or 1.8.3. A number of tweaks have been made to -support slight variations in the API of other platforms, particularly the -ESP8266 and ESP32 cores. +v1.8.2 or v1.8.3. A number of tweaks have been made to support slight variations +in the API of other platforms, particularly the ESP8266 v2.7.4 and ESP32 v1.0.6 +cores. The `Print.printf()` function is an extension to the `Print` class that is provided by many Arduino-compatible microcontrollers (but not the AVR @@ -743,7 +762,7 @@ These 3 types are described in more detail below. ### Inherently Compatible Libraries Almost all libraries that I write will be inherently compatible with EpoxyDuino -because EpoxyDuino is what I use to my libraries. +because EpoxyDuino is what I use to develop and test my libraries. * AUnit (https://github.com/bxparks/AUnit) * AceButton (https://github.com/bxparks/AceButton) @@ -816,6 +835,8 @@ intended. This limitation may be sufficient for Continous Integration purposes. * [EpoxyMockTimerOne](libraries/EpoxyMockTimerOne) * A simple mock of the TimerOne (https://github.com/PaulStoffregen/TimerOne) library. +* [EpoxyMockFastLED](libraries/EpoxyMockFastLED/) + * Mock version of the FastLED (https://github.com/FastLED/FastLED) library. * EspMock (https://github.com/hsaturn/EspMock) * This is a separate project that provides various mocks for functions and libraries included with the ESP8266 and the ESP32 processors. @@ -825,7 +846,7 @@ intended. This limitation may be sufficient for Continous Integration purposes. ## System Requirements -This library has been tested on: +This library has Tier 1 support on: * Ubuntu 18.04 * g++ (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 @@ -836,6 +857,9 @@ This library has been tested on: * g++ (Ubuntu 9.3.0-10ubuntu2) 9.3.0 * clang++ version 10.0.0-4ubuntu1 * GNU Make 4.2.1 + +The following environments are Tier 2 because I do not test them often enough: + * Raspbian GNU/Linux 10 (buster) * On Raspberry Pi Model 3B * g++ (Raspbian 8.3.0-6+rpi1) 8.3.0 @@ -889,5 +913,5 @@ people ask similar questions later. * Add `delayMicroSeconds()`, `WCharacter.h`, and stub implementations of `IPAddress.h`, `SPI.h`, by Erik Tideman (@ramboerik), see [PR #18](https://github.com/bxparks/EpoxyDuino/pull/18). -* Add `memcpy_P()` and `vsnprintf_P()` by @pmp-p, +* Add `memcpy_P()` and `vsnprintf_P()` by @pmp-p, [PR #28](https://github.com/bxparks/EpoxyDuino/pull/28). From 26ac365516fda2f087f09a01b98eb52fe504316a Mon Sep 17 00:00:00 2001 From: Brian Park Date: Thu, 9 Dec 2021 13:41:54 -0800 Subject: [PATCH 13/13] Bump version to 1.1.0 --- CHANGELOG.md | 17 ++++++++++++++--- README.md | 2 +- cores/epoxy/Arduino.h | 4 ++-- library.json | 2 +- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1907c18..f7c6279 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,21 @@ # Changelog * Unreleased +* 1.1.0 (2021-12-09) * Add optional `DEPS` variable containing header files that the `*.ino` depends on. - * Change `Print::println()` to print just a `\n` instead of `\r\n`, which - is more compatible on Unix where the line terminator is a single `\n`. + * **Potential Breaking** Change `Print::println()` to print just a `\n` + instead of `\r\n`. + * This is more compatible on Unix where the line terminator is a single + `\n` + * This allows the text output of Arduino programs to be redirected to + a file or piped to another Unix program with the correct line + termination character. + * This change may break some programs (usually unit tests) which print + to a + [PrintStr](https://github.com/bxparks/AceCommon/tree/develop/src/print_str) + object (from my [AceCommon](https://github.com/bxparks/AceCommon) + library), and then expect `\r\n` instead of `\n`. * Add `pgm_read_XXX_near()` and `pgm_read_XXX_far()` macros which simply delegate to the `pgm_read_XXX()` macros. * Add `clockCyclesPerMicrosecond()`, `clockCyclesToMicroseconds(a)`, @@ -19,7 +30,7 @@ * Add a minimal mock implementation of [FastLED](https://github.com/FastLED/FastLED) sufficient for my personal project. -* 1.0 (2021-09-30) +* 1.0.0 (2021-09-30) * Add `epoxy_argc` and `epoxy_argv` as extern global variables which are set to the `argc` and `argv` parameters passed into the global `main()`. diff --git a/README.md b/README.md index 350c740..8710213 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ The disadvantages are: environments (e.g. 16-bit `int` versus 32-bit `int`, or 32-bit `long` versus 64-bit `long`). -**Version**: 1.0 (2021-09-30) +**Version**: 1.1.0 (2021-12-09) **Changelog**: See [CHANGELOG.md](CHANGELOG.md) diff --git a/cores/epoxy/Arduino.h b/cores/epoxy/Arduino.h index 61becc3..7a080bb 100644 --- a/cores/epoxy/Arduino.h +++ b/cores/epoxy/Arduino.h @@ -14,8 +14,8 @@ #define EPOXY_DUINO_EPOXY_ARDUINO_H // xx.yy.zz => xxyyzz (without leading 0) -#define EPOXY_DUINO_VERSION 10000 -#define EPOXY_DUINO_VERSION_STRING "1.0.0" +#define EPOXY_DUINO_VERSION 10100 +#define EPOXY_DUINO_VERSION_STRING "1.1.0" #include // min(), max() #include // abs() diff --git a/library.json b/library.json index fae32e0..eff297a 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "EpoxyDuino", - "version": "1.0.0", + "version": "1.1.0", "description": "Compile and run Arduino programs natively on Linux, MacOS and FreeBSD.", "keywords": [ "unit-test",