diff --git a/.arduino-ci.yml b/.arduino-ci.yml index b3e33db..572b108 100644 --- a/.arduino-ci.yml +++ b/.arduino-ci.yml @@ -1,14 +1,30 @@ +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: - uno - - due - - zero - - leonardo + # - due + # - zero + # - leonardo - m4 - esp32 - esp8266 - - mega2560 + # - mega2560 + - rpipico libraries: - "printHelpers" diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..4aa8211 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,38 @@ +# Change Log timing + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/) +and this project adheres to [Semantic Versioning](http://semver.org/). + + +## [0.2.4] - 2022-11-26 +- Add RP2040 support to build-CI. +- Add CHANGELOG.md +- update readme.md + + +## [0.2.3] - 2021-12-29 +- update library.json +- update license +- minor edits + +## [0.2.2] - 2021-05-27 +- added Arduino-lint + +## [0.2.1] - 2021-01-09 +- added Arduino-CI + unit test + +## [0.2.0] - 2020-07-07 +- renamed to timing.h + +---- + +## [0.1.02] - 2015-03-02 +- move all to mymillis.h file so compiler can optimize + +## [0.1.01] - 2011-07-19 +- add lib version + +## [0.1.00] - 2011-01-04 +- initial version diff --git a/README.md b/README.md index c81687a..06e1fae 100644 --- a/README.md +++ b/README.md @@ -24,11 +24,11 @@ Therefore they have the same restrictions as these functions with respect to overflow and accuracy. Depending on e.g. interrupts millis and micros can drift. -| class | overflow after | Notes | -|:-------------|:-------------------------|:--------------------| -| seconds | 49 days, 17:02:47 | based upon millis() | -| milliSeconds | 49 days, 17:02:47.297 | -| microSeconds | 00 days 01:11:34.967296 | +| class | overflow after | Notes | +|:---------------|:---------------------------|:----------------------| +| seconds | 49 days, 17:02:47 | based upon millis() | +| milliSeconds | 49 days, 17:02:47.297 | +| microSeconds | 00 days 01:11:34.967296 | ## Applications @@ -59,19 +59,26 @@ See examples. ## Future +#### must - test on ESP32 -- nanos() on ESP32 ? -- implement printable interface (add unit) - - ? -- implement toClock() + +#### should +- implement toClock() - idea to give it a clock print layout - seconds.toClock() -> DD 12:34:56 - milliSeconds.toClock(3) -> 12:23:45.123 (3) == 3 decimals.. - milliSeconds.toClock(1) -> 12:23:45.1 - microSeconds.toCLock() -> 12:23:45.123456 ??? + - printHelpers class? - implement toSeconds() - double milliSeconds.toSeconds() -> 45.123 - double microSeconds.toSeconds() -> 45.123456 + +#### could +- nanos() on ESP32 ? +- implement printable interface + - add unit (s, ms, us) + - what layout to use? - update documentation - rounding effect, describe diff --git a/library.json b/library.json index 3622925..9c1e68f 100644 --- a/library.json +++ b/library.json @@ -15,7 +15,7 @@ "type": "git", "url": "https://github.com/RobTillaart/timing" }, - "version": "0.2.3", + "version": "0.2.4", "license": "MIT", "frameworks": "arduino", "platforms": "*", diff --git a/library.properties b/library.properties index 266424e..0d21e45 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=timing -version=0.2.3 +version=0.2.4 author=Rob Tillaart maintainer=Rob Tillaart sentence=Arduino library with wrapper classes for seconds millis micros. diff --git a/timing.h b/timing.h index f122844..ad607ba 100644 --- a/timing.h +++ b/timing.h @@ -2,21 +2,12 @@ // // FILE: timing.h // AUTHOR: Rob Tillaart -// VERSION: 0.2.3 +// VERSION: 0.2.4 // PURPOSE: Arduino library with wrapper classes for seconds millis micros // URL: https://github.com/RobTillaart/timing -// -// HISTORY: -// 0.1.00 2011-01-04 initial version -// 0.1.01 2011-07-19 lib version -// 0.1.02 2015-03-02 move all to mymillis.h file so compiler can optimize -// 0.2.0 2020-07-07 renamed to timing.h -// 0.2.1 2021-01-09 added Arduino-CI + unit test -// 0.2.2 2021-05-27 added Arduino-lint -// 0.2.3 2021-12-29 update library.json, license, minor edits -#define TIMING_LIB_VERSION (F("0.2.3")) +#define TIMING_LIB_VERSION (F("0.2.4")) class microSeconds @@ -49,8 +40,8 @@ class seconds { public: seconds() { set(0); } - uint32_t now() { return millis()/1000UL - _offset; } - void set(uint32_t value = 0UL) { _offset = millis()/1000UL - value; } + uint32_t now() { return millis() / 1000UL - _offset; } + void set(uint32_t value = 0UL) { _offset = millis() / 1000UL - value; } uint32_t getOffset() { return _offset; }; private: