diff --git a/libraries/ANSI/.arduino-ci.yml b/libraries/ANSI/.arduino-ci.yml index e7cb4633..77a333f9 100644 --- a/libraries/ANSI/.arduino-ci.yml +++ b/libraries/ANSI/.arduino-ci.yml @@ -1,3 +1,18 @@ +platforms: + rpipico: + board: rp2040:rp2040:rpipico + package: rp2040:rp2040 + gcc: + features: + defines: + - ARDUINO_ARCH_RP2040 + warnings: + flags: + +packages: + rp2040:rp2040: + url: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json + compile: # Choosing to run compilation tests on 2 different Arduino platforms platforms: @@ -7,5 +22,7 @@ compile: # - leonardo - m4 - esp32 - # - esp8266 - # - mega2560 \ No newline at end of file + - esp8266 + # - mega2560 + - rpipico + diff --git a/libraries/ANSI/CHANGELOG.md b/libraries/ANSI/CHANGELOG.md index 425571c7..8b2824fb 100644 --- a/libraries/ANSI/CHANGELOG.md +++ b/libraries/ANSI/CHANGELOG.md @@ -1,4 +1,4 @@ -# Change Log bitHelpers +# Change Log ANSI All notable changes to this project will be documented in this file. @@ -6,57 +6,39 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). -## [0.1.6] - 2022-04-11 +## [0.1.7] - 2022-110-28 +- add RP2040 to build-CI +- minor edits +- start simplifying changelog +- minor change unit test -### Added + +## [0.1.6] - 2022-04-11 - add CHANGELOG.md - add **int deviceType()** - -### Changed - edit README.md -### Fixed - - ## [0.1.5] - 2021-12-13 - -### Added - add write(array, length) - -### Changed - update library.json, license, minor edits - ## [0.1.4] - 2021-10-18 - -### Changed - update build-CI (e.g. ESP32) - update examples - ## [0.1.3] - 2020-12-11 - -### Added - add Arduino-CI - add unit test (minimal) - ## [0.1.2] - 2020-07-08 - -### Added - add clearLine = add color support (thanks to airbornemint) - ## [0.1.1] - 2020-05-27 - -### Changed - update library.json ## [0.1.0] - 2020-04-28 - -### Added - initial release diff --git a/libraries/ANSI/ansi.cpp b/libraries/ANSI/ansi.cpp index daf2b42b..4e962d85 100644 --- a/libraries/ANSI/ansi.cpp +++ b/libraries/ANSI/ansi.cpp @@ -1,7 +1,7 @@ // // FILE: ansi.cpp // AUTHOR: Rob Tillaart -// VERSION: 0.1.6 +// VERSION: 0.1.7 // PURPOSE: Arduino library to send ANSI escape sequences // DATE: 2020-04-28 // URL: https://github.com/RobTillaart/ANSI @@ -50,9 +50,9 @@ void ANSI::clearLine(uint8_t clear) } -// ANSI has three different color spaces: 4-bit color, 8-bit color, and 24-bit color -// The are rendered with SGR 30-37,90-97/40-47,100-107, SGR 38;5/48;5, and SGR 38;2/48;2, respectively -// The 4-bit color space is the most widely compatible and the most compactly transmitted +// ANSI has three different color spaces: 4-bit color, 8-bit color, and 24-bit color +// These are rendered with SGR 30-37,90-97/40-47,100-107, SGR 38;5/48;5, and SGR 38;2/48;2, respectively +// The 4-bit color space is the most widely compatible and the most compactly transmitted enum { fg_normal = 30, bg_normal = 40, @@ -147,7 +147,7 @@ void ANSI::cursorBack(uint8_t x) int ANSI::deviceType(uint32_t timeout) { - int type = -1; // -1 = unknown + int type = -1; // -1 = unknown print("\033[0c"); uint32_t start = millis(); @@ -174,7 +174,7 @@ int ANSI::deviceType(uint32_t timeout) // size_t ANSI::write(uint8_t c) { - // TODO add line buffer? - interference with write(array, length) !? + // TODO add line buffer? - interference with write(array, length) !? return _stream->write(c); } @@ -221,5 +221,6 @@ void ANSI::color8(uint8_t base, uint8_t color) { print("m"); } + // -- END OF FILE -- diff --git a/libraries/ANSI/ansi.h b/libraries/ANSI/ansi.h index d063d3b0..efe3c927 100644 --- a/libraries/ANSI/ansi.h +++ b/libraries/ANSI/ansi.h @@ -2,7 +2,7 @@ // // FILE: ansi.h // AUTHOR: Rob Tillaart -// VERSION: 0.1.6 +// VERSION: 0.1.7 // PURPOSE: Arduino library to send ANSI escape sequences // DATE: 2020-04-28 // URL: https://github.com/RobTillaart/ANSI @@ -11,7 +11,7 @@ #include "Arduino.h" -#define ANSI_LIB_VERSION (F("0.1.6")) +#define ANSI_LIB_VERSION (F("0.1.7")) class ANSI : public Stream @@ -23,7 +23,7 @@ public: int available(); int read(); int peek(); - void flush() { return; }; // placeholder to keep CI happy + void flush() { return; }; // placeholder to keep CI happy // CHAR MODES @@ -45,28 +45,29 @@ public: magenta, cyan, white, - bright, // Add this to any of the previous 8 to get a bright color + bright, // Add this to any of the previous 8 to get a bright color }; - // foreground, background, and color accept one of the following colors: - // * color name from above: ANSI::red - // * bright color name from above: ANSI::red + ANSI::bright - // * gray color: ANSI::gray2color(gray) - // * RGB color: ANSI::rgb2color(r, g, b) + // foreground, background, and color accept one of the following colors: + // * color name from above: ANSI::red + // * bright color name from above: ANSI::red + ANSI::bright + // * gray color: ANSI::gray2color(gray) + // * RGB color: ANSI::rgb2color(r, g, b) - // Set foreground color + // Set foreground color void foreground(uint8_t fgcolor); - // Set background color + // Set background color void background(uint8_t bgcolor); - // Set foreground and background color (for named colors, this is 25% faster than setting one then the other) + // Set foreground and background color + // (for named colors, this is 25% faster than setting one then the other) void color(uint8_t fgcolor, uint8_t bgcolor); - // Convert gray to ANSI 24-level gray in 4-bit colorspace - // Pass in a gray level from 0 (black) to 255 (white) + // Convert gray to ANSI 24-level gray in 4-bit colorspace + // Pass in a gray level from 0 (black) to 255 (white) uint8_t gray2color(uint8_t gray) { return 232 + uint16_t(gray) * 24 / 256; } uint8_t grey2color(uint8_t grey) { return this->gray2color(grey); } - // Convert RGB color to ANSI color in 4-bit colorspace - // Pass in a RGB level from 0 (dark) to 255 (light) + // Convert RGB color to ANSI color in 4-bit colorspace + // Pass in a RGB level from 0 (dark) to 255 (light) uint8_t rgb2color(uint8_t r, uint8_t g, uint8_t b); @@ -136,4 +137,6 @@ private: }; + // -- END OF FILE -- + diff --git a/libraries/ANSI/library.json b/libraries/ANSI/library.json index b76ff727..316a34d5 100644 --- a/libraries/ANSI/library.json +++ b/libraries/ANSI/library.json @@ -15,7 +15,7 @@ "type": "git", "url": "https://github.com/RobTillaart/ANSI.git" }, - "version": "0.1.6", + "version": "0.1.7", "license": "MIT", "frameworks": "arduino", "platforms": "*", diff --git a/libraries/ANSI/library.properties b/libraries/ANSI/library.properties index b652c659..2a342ee5 100644 --- a/libraries/ANSI/library.properties +++ b/libraries/ANSI/library.properties @@ -1,5 +1,5 @@ name=ANSI -version=0.1.6 +version=0.1.7 author=Rob Tillaart maintainer=Rob Tillaart sentence=Arduino library to send ANSI escape sequences diff --git a/libraries/ANSI/test/unit_test_001.cpp b/libraries/ANSI/test/unit_test_001.cpp index 7d996012..401f54cf 100644 --- a/libraries/ANSI/test/unit_test_001.cpp +++ b/libraries/ANSI/test/unit_test_001.cpp @@ -27,6 +27,7 @@ unittest_setup() { + fprintf(stderr, "ANSI_LIB_VERSION: %s\n", (char *) ANSI_LIB_VERSION); } @@ -38,7 +39,6 @@ unittest_teardown() unittest(test_constructor) { ANSI ansi(&Serial); - fprintf(stderr, "ANSI_LIB_VERSION: %s\n", (char *) ANSI_LIB_VERSION); assertEqual(12, ansi.println("1234567890") ); } @@ -47,7 +47,6 @@ unittest(test_constructor) unittest(test_gray2color) { ANSI ansi(&Serial); - fprintf(stderr, "ANSI_LIB_VERSION: %s\n", (char *) ANSI_LIB_VERSION); for (int gray = 0; gray < 255; gray += 31) {