Releases: bxparks/AceTime
Releases · bxparks/AceTime
v1.7.2 - add ZoneDateTime::normalize(); upgrade to AceRoutine v1.3.1; make clockMillis() non-virtual
v1.7.2 - add ZoneDateTime::normalize(); upgrade to AceRoutine v1.3.1; make clockMillis() non-virtual
- 1.7.2 (2021-06-02)
- Bug Fix: Add
ZonedDateTime::normalize(), which must be called by
the client code after calling aZonedDateTimemutation function.- See ZonedDateTime Normalization.
- Increases flash usage by 222 bytes by making this single call on an
AVR unfortunately.
- Migrate
PrintStr::getCstr()in AceCommon <=1.4.4 to the shorter
PrintStr::cstr()in AceCommon >= 1.4.5. - Migrate to AceRoutine v1.3.1, which changes
AceRoutine::coroutineMillis()into non-virtual. - Change
SystemClockto instantiate fromSystemClockTemplate, which
allowsSystemClock::clockMillis()to also become non-virtual. Saves
20-40 bytes of flash. No discernible changes in CPU time.
- Bug Fix: Add
v1.7.1 - simplify SystemClock getSeconds{Since,To}SyncAttempt() methods
- 1.7.1 (2021-04-02)
- Simplify calculation of
SystemClock::getSecondsSinceSyncAttempt()
andSystemClock::getSecondsToSyncAttempt(), which substantially
simplifies the implementation ofSystemClockLoopand
SystemClockCoroutine. - Update
tests/auniter.inito be consistent with my other libraries. Add
entries forenv:teensy32(which had been supported for a while) and
env:mkr1000(which I just received).
- Simplify calculation of
v1.7 - refactor USER_GUIDE.md; get SystemClock sync status; add Stm32F1Clock
- 1.7 (2021-03-24, TZ DB version 2021a)
- AceTime now has a
GitHub Discussion.- Use that for general questions and discussions.
- Reserve GitHub Issues
for bugs and feature requests.
- Add
tools/compare_nodato compare Noda Time against AceTime.- Add
--nzd_fileflag tocompare_nodato allow custom NodaZoneData
files. - Run the Noda Time
TzdbCompilermanually to generate custom
tzdata$(TZ_VERSION).nzdfor the specific TZDB version specified in
the Makefile. - Add
tests/validation/BasicNodaTestwhich matches AceTime completely
from year 2000 until 2050. - Add
tests/validation/ExtendedNodaTestwhich maches AceTime
completely from year 1974 until 2050. - Identical results to
BasicHinnantDateTestand
ExtendedHinnantDateTest.
- Add
- Add
ace_time::clock::Stm32F1Clockandace_time::hw::Stm32F1Rtc- Specialized classes for the STM32F1 chip, particularly the Blue Pill
board, using theLSE_CLOCK(low speed external clock).- Blue Pill already includes the external 32.768 kHz
crystal on pins C14 and C15.
- Blue Pill already includes the external 32.768 kHz
- Alternative to the
ace_time::clock::StmRtcClockclass, which uses
the genericSTM32RTClibrary, which does not fully work on the
STM32F1.STM32RTCforgets the date fields upon power reset, preserving
only the time fields.
- These classes write directly into the 32-bit RTC register on the F1,
allowing AceTime to preserve both date fields and time fields.
- Specialized classes for the STM32F1 chip, particularly the Blue Pill
- Massive refactoring of
USER_GUIDE.mdandREADME.mdfor clarity- Extract subsections of
USER_GUIDE.mdinto separate docs,
makingUSER_GUIDE.mdshorter and hopefully more digestable. - Rename most of
USER_GUIDE.mdintodocs/date_time_timezone.md. - Extract
Clockclasses intodocs/clock_system_clock.md - Extract Installation into
docs/installation.md. - Extract Validation and Testing into
docs/validation.md. - Extract Comparisons into
docs/comparisons.md. - Add documentation for
StmRtcClockandStm32F1Clock.
- Extract subsections of
- Remove virtual destructor from
ace_time::clock::Clockclass.- Saves 618 bytes of flash on 8-bit AVR processors, 328 bytes on SAMD21,
but only 50-60 bytes on other 32-bit processors.
- Saves 618 bytes of flash on 8-bit AVR processors, 328 bytes on SAMD21,
- Finish a working implementation of
acetz.py.- Includes support for
fold. - Create
BasicAcetzTestandExtendedAcetzTestand verify all zones
validate.
- Includes support for
- Time zone short names are printed with spaces instead of underscore.
- Various
printShortNameTo()andprintShortTo()methods now print
the short names with the underscore replaced with a space. Example,
instead of "Los_Angeles", it is now "Los Angeles". - It seems to be more reasonable for most time zones.
- The time zone full name continues to print the entire canonical
timezone identifier, e.g. "America/Los_Angeles". - Applications that need finer control will have to provide their own
rendering logic.
- Various
SystemClock- Fix
SystemClock::forceSync()that crashes if the referenceClock is
null.- Used mostly for debugging and testing, so I doubt anyone ran into
this.
- Used mostly for debugging and testing, so I doubt anyone ran into
- Add methods to retrieve the sync status of
SystemClock.getSecondsSinceSyncAttempt()getSecondsToSyncAttempt()- `getClockSlew()
getSyncStatusCode()- See System Clock
Status
for details.
- Potentially Breaking: Move various internal constants in
SystemClockLoopandSystemClockCoroutinetoprivate.- Examples
kStatusReady, kStatusSent,kStatusOk`k - These were all related to the internal finite state machine which
should not have been exposed publically. - The sync status of
SystemClockis now exposed through
documented public methods described above.
- Examples
- Fix
NtpClock- Add warning that calling
analogRead()too often (e.g. using buttons
on a resistor ladder using AceButton library) on ESP8266 causes the
WiFi connection to drop after 5-10 seconds.
- Add warning that calling
- AceTime now has a
v1.6 - implement Thin Links, a lighter weight version of Fat Links; fully templatize ZoneProcessors
- 1.6
- Remove
TimeZone::kTypeBasicManagedandTimeZone::kTypeExtendedManaged
and merge them into just regularTimeZone::kTypeBasicand
TimeZone::kTypeExtended.- Significantly simplifies the implementation of
TimeZone. TimeZoneno longer holds a reference to aZoneProcessorCache, it
holds only a reference toZoneProcessor.- The binding of
TimeZoneto itsBasicZoneProcessoror
ExtendedZoneProcessornow happens early, inside the
BasicZoneManageror theExtendedZoneManager, instead of delaying
it to various methods inside theTimeZonethrough the
ZoneProcessorCache. - This change should be invisible to library clients.
- Significantly simplifies the implementation of
- Large internal refactoring of ZoneProcessor, no external change
- Fully templatize
BasicZoneProcessorinto
BasicZoneProcessorTemplate, andExtendedZoneProcessorto
ExtendedZoneProcessorTemplate. - Remove sentinel static
ZoneEraanchor record which prevented
easy templatization. - Remove direct dependency to
const ZoneInfo*, replacing it with
genericuintptr_t zoneKey. - Insert
BrokerFactoryindirection layer to provide mapping from a
genericuintptr_t zoneKeyto the correspondingZoneInfoBroker. - Templatized classes now depend only on their respective
Zone*Brokerclasses. - This change should be invisible to library clients.
- Fully templatize
- Fix stale
ZoneProcessorbinding toTimeZone.- A dereferenced
nullptrcould crash the program if
TimeZone::toTimeZoneData() was called immediately after calling theTimeZone::forZoneInfo()` factory method. - Some accessor methods in
TimeZone(getZoneId(),printTo(),
printShortTo()) could return incorrect values if the number of
unique TimeZones used by an application is greater than the cache
SIZEtemplate parameter given to theZoneManager.- The problem occurs because the
ZoneProcessorCachewill rebind
a previously allocatedZoneProcessorto anotherTimeZonewhen
it runs out of available processors in the cache.
- The problem occurs because the
- A dereferenced
- Unlikely Breaking Change: Move
ZoneRegistrar.hintointernal/.- Rename
BasicZoneRegistrartobasic::ZoneRegistrar. - Rename
ExtendedZoneRegistrartoextended::ZoneRegistrar. - The class is an implementation detail which is used only by
BasicZoneManagerandExtendedZoneManager. It was not exposed to
the end user and should not cause any breaking changes.
- Rename
- Add support for Thin Links using optional
linkRegistry[]parameter in
the constructors ofBasicZoneManagerandExtendedZoneManager.- The
zonedb/zone_registry.handzonedbx/zone_registry.hfiles
now contain akLinkRegistrySizeand aLinkEntry kLinkRegistry[]
array. Each record in the array contains a mapping oflinkIdto its
zoneId. - The
ZoneManager::createForZoneId()method will search the Thin Link
registry if azoneIdis not found in the Zone registry. - See Zones and Links section in the
USER_GUIDE.md.
- The
- Breaking Change: Rename
ZoneManager::registrySize()to
zoneRegistrySize().- Add
ZoneManager::linkRegistrySize()method. - A
ZoneManagercan now hold 2 different registries: the Zone (and Fat
Link) registry, and the Thin Link registry. So we need to
distinguish between the 2 registries. - See the Default Registries section
in the USER_GUIDE.md for an explanation of the Zone
and Link registries.
- Add
- Remove
v1.5 - officially support STM32; upgrade to TZ DB 2021a; implement fat Links
- 1.5
- Use binary search for both
ZoneManager::createForZoneName()and
ZoneManager::createForZoneId().- Previously, the
zone_registry.cppwas sorted by zoneName, so only
thecreateForZoneName()could use the binary search. The new
solution sorts thezone_registry.cppentries byzoneIdinstead of
zoneName. ThecreateForZoneId()can use the binary search
algorith. - The
createForZoneName()can also use the binary search because
thezoneNameis converted dynamically to itszoneIdusing the same
djb2 hash algorithm used by thetzcompiler.py. If there is a match,
a final verification against the exactzoneNameis performed to make
sure that there was no hash collision. - Updated
AutoBenchmark.inoto determine that a binary search on the
266 zones inzonedb/zone_registry.cppis 9-10X faster (on average)
than a linear search through the same list. (Linear search takes ~190
iterations; binary search takes ~9 iterations.)
- Previously, the
- Upgrade Link entries to be "fat links".
- Links become essentially identical to Zone entries, with references to
the same underlyingZoneErarecords. - Add
kZoneAndLinkRegistry[]array inzone_registry.hthat contains
all Links as well as Zones. - Add "Zones and Links" section in
USER_GUIDE.md.
- Links become essentially identical to Zone entries, with references to
- Implement zoneName compression using
ace_common::KString.- Saves about 1500-2300 bytes for basic
zonedbinfo files, and
2500-3400 bytes for extendedzonedbxinfo files.
- Saves about 1500-2300 bytes for basic
- Potentially Breaking Change: Remove
transitionBufSizefrom
ZoneInfostruct, and migrate tokZoneBufSize{xxx}constants in the
zone_infos.hfiles.- This was used only in validation tests under
tests/validationand
only forExtended{xxx}tests. Saves 1 byte per Zone on 8-bit
processors, but none on 32-bit processors due to 4-byte alignment. - This should have no impact on client code since this field was used
only for validation testing.
- This was used only in validation tests under
- API Breaking Change: Replace
BasicZone::name()andshortName()
withprintNameTo()andprintShortNameTo(). Same with
ExtendedZone::name()andshortName(), replaced withprintNameTo()
andprintShortNameTo().- After implementing zoneName compression, it was no longer possible to
return a simple pointer to thenameandshortNamewithout using
static memory buffers. - I expect almost no one to be using the
BasicZoneandExtendedZone
classes, since they are mostly useful for internal algorithms. - Client code that needs the old functionality can use
BasicZone::printNameTo(Print&),
BasicZone::printShortNameTo(Print&)(similarly forExtendedZone)
to print to aace_common::PrintStr<>object, then extract the
c-string usingPrintStr::getCstr().
- After implementing zoneName compression, it was no longer possible to
- Update UnixHostDuino 0.4 to EpoxyDuino 0.5.
- Explicitly blacklist megaAVR boards, and SAMD21 boards using
arduino:samdCore >= 1.8.10.- This allows a helpful message to be shown to the user, instead of the
pages and pages of compiler errors.
- This allows a helpful message to be shown to the user, instead of the
- Update TZ Database to 2021a.
- https://mm.icann.org/pipermail/tz-announce/2021-January/000065.html
- "South Sudan changes from +03 to +02 on 2021-02-01 at 00:00."
- Officially support STM32 and STM32duino after testing on STM32 Blue Pill.
- Use binary search for both
v1.4.1 - actually upgrade zonedb and zonedbx files to 2020f
- 1.4.1 (2020-12-30, TZDB version 2020f for real)
- Actually update
src/ace_time/zonedbandsrc/ace_time/zonedbx
zone info files to 2020f. Oops.
- Actually update
v1.4 - upgrade to tzdata 2020f; prelim support for STM32; huge refactoring of tools
- 1.4 (2020-12-30, TZ DB version 2020f)
- Add entry for
ManualZoneManagerin
examples/MemoryBenchmark. It seems to need
between 0'ish to 250 bytes of flash. - Add support for creating and handling a
TimePerioderror object.- Add
kMaxPeriodSecondsandkInvalidPeriodSecondsconstants. - Add
forError()factory method. - Add error checking to
toSeconds()andTimePeriod(seconds)
constructor. - Printing an error object prints
<Invalid TimePeriod>.
- Add
- Add support for the STM32RTC clock on an STM32 through the
ace_time::clock::StmRtcClockclass.- Currently experimental and untested.
- I do not have any STM32 boards right now, so I cannot test this code.
- See #39 for details.
- Thanks to Anatoli Arkhipenko (arkhipenko@).
- Add convenience factory methods for creating manual
TimeZoneobjects.
Saves a lot of typing by avoiding theTimeOffsetobjects:TimeZone::forHours()TimeZone::forMinutes()TimeZone::forHourMinute()
- Fix incorrect
kTypeXxxconstants inZoneManager.h. Fortunately, the
numerical values overlapped perfectly, so didn't cause any bugs in actual
code. USER_GUIDE.md- Add documentation about accessing the meta information about the
zonedbandzonedbxdatabases:zonedb::kTzDatabaseVersionzonedb::kZoneContext.startYearzonedb::kZoneContext.untilYearzonedbx::kTzDatabaseVersionzonedbx::kZoneContext.startYearzonedbx::kZoneContext.untilYear
- Add documentation that the
ZonedDateTimemust always be within
startYearanduntilYear. An error object will be returned outside
of that range.
- Add documentation about accessing the meta information about the
- Update TZ Database from 2020d to version 2020f
- 2020e
- https://mm.icann.org/pipermail/tz-announce/2020-December/000063.html
- "Volgograd switches to Moscow time on 2020-12-27 at 02:00."
- 2020f
- https://mm.icann.org/pipermail/tz-announce/2020-December/000064.html
- "'make rearguard_tarballs' no longer generates a bad rearguard.zi,
fixing a 2020e bug. (Problem reported by Deborah Goldsmith.)"
- AceTime skips 2020e
- 2020e
- Update
examples/AutoBenchmarkto allow auto-generation of ASCII tables,
which allows auto-generation of theREADME.mdfile. Update CPU
benchmarks for v1.4 from v0.8, since it is much easier to update these
numbers now. No significant performance change from v0.8. - Huge amounts of Python
toolsrefactoring- Convert all remaining
%string formatting to f-strings. - Convert all internal camelCase dictionary keys to snake_case for
consistency. - Finish adding typing info to pass strict mypy checking.
- Centralize most typing info into
data_types/at_types.py. - Move various global constants into
data_types/at_types.py. - Migrate most Arduino specific transformations into
artransformer.py. - Move offsetCode, deltaCode, atTimeCode, untilTimeCode, rulesDeltaCode
calculations and various bit-packing rules (e.g.at_time_modifier,
ntil_time_modifier) intoartransformer.pyinstead of the
argenerator.py. - Include general and platform specific transformations in
the JSON (zonedb.jsonorzonedbx.json) files. - Make
argenerator.pyuse only the JSON output instead of making
its own transformations. - Produce both
LettersMapandLettersPerPolicyin the JSON file. - Unify
CommentsCollectionintoCommentsMapusing anIterable
inDict[str, Iterable[str]]. - Unify all transformer results into
TransformerResult. - Check hash collisions for Link names, in addition to Zone names.
- Rename test data generator executables to
generate_data.*or some
variations of it, to avoid confusion with unit tests which are often
namedtest_xxx.py. - Add
--input_dirflag togenerate_data.cppto allow the TZ database
directory to be specified. - Add
--ignore_buf_size_too_bigto workaround a mismatch between
the estimated Transition buffer size calculated bybufestimator.py
and the actual buffer size required byExtendedZoneProcessor.cpp. - Add
--skip_checkoutflag totzcompiler.pyto allow local
modifications of the TZ database files to be used for code generation. - Add
--delta_granularityflag totransformer.pyto decouple it
from--offset_granularity, so that theSAVEandRULES
granularity can be controlled independently from theSTDOFF
granularity. The--until_at_granularitycontinues to controlAT
andUNTIL. - Make output of
zinfo.py --debugto be more readable. - Remove
--generate_zone_stringsfromtzcompiler.pywhich removes
the ability to createzone_strings.{h,cpp}. The storage and
optimization of strings are implementation details which seem to be
better handled later in the pipeline. - Increase the range of
zonedbpydatabase from the default
[2000,2050)to[1974, 2050)to allowzinfo.pyto handle a larger
range of queries. - Merge
--actionand--languageflags fortzcompiler.py; only
--languageflag needed right now. - Rename
RulesMaptoPoliciesMap,rules_maptopolicies_map,
rule_nametopolicy_nameetc. For consistency withZonesMap,
zones_map, andzone_name. - Add
ZoneIdhashes to JSON output files.
- Convert all remaining
- Add entry for
v1.3 - better ZoneId support using ZoneManager interface
- 1.3 (2020-11-30, TZ DB version 2020d)
- Minor tweaks to silence clang++ warnings.
- Create new
ZoneManagerinterface (pure virtual) which is now the
non-templatized parent to bothBasicZoneManagerand
ExtendedZoneManager. AllowsZoneManagerto be passed around
poloymorphically as a pointer or reference. - Fix broken
ZoneManager::indexForZoneName()and
ZoneManager::indexForZoneId()caused by incorrect implementations in
BasicZoneRegistrarandExtendedZoneRegistrar. - Generate compile-time zoneIds for all zones in the form of
zonedb::kZoneId{Zone_Name}andzonedbx::kZoneId{Zone_Name}(e.g.
zonedb::kZoneIdAmerica_Los_Angeles). Can be given directly to
ZoneManager::createForZoneId(). - Add constructors to
TimeZoneDatato allow initializers to set
union members. Useful for initializing arrays ofTimeZoneData. - Add
ManualZoneManagerimplementation ofZoneManagerwhich implements
onlycreateForTimeZoneData(). Useful in applications which support only
TimeZone::kTypeManual(fixed std and dst offsets) due to memory
constaints. - Add documentation of
TimeZoneData,TimeZone::toTimeZoneData(), and
ZoneManager::createFromTimeZoneData()toUSER_GUIDE.md. Looks like I
added the class in v0.5 but forgot to document it. - Implement
LocalDateTime::compareTo()using only its components instead
of internally converting to epochSeconds. Not allLocalDateTimecan be
represented by an epochSeconds, so this change makes the algorithm more
robust. The semantics of the method should remain unchanged. - Update the doxygen docs of the
compareTo()methods ofLocalDateTime,
LocalTime,LocalDate,OffsetDateTimeandZonedDateTimeto clarify
the semantics of those operations.
v1.2.1 - add Table of Contents to USER_GUIDE.md
- 1.2.1 (2020-11-12, TZ DB version 2020d)
- No functional change in this release. Mostly documentation.
- Update
examples/MemoryBenchmarknumbers from v0.8 to v1.2 with
new auto-generator scripts. - Add Table of Contents to
USER_GUIDE.mdto help navigate the long
document.
v1.2 - migrate low-level common code to AceCommon library
- 1.2 (2020-10-31, TZ DB version 2020d)
- Potentially Breaking: AceTime library now depends on the AceCommon
library (https://github.com/bxparks/AceCommon) to avoid having to maintain
multiple copies of various utility functions and classes. The API for most
(if not all) public classes have not changed. A number of internal helper
classes have moved to the AceCommon library. If you happen to directly use
some of these, you need to use the AceCommon library instead.- Add dependency to AceCommon to all Makefiles.
- Add a
dependsattribute tolibrary.properties.
- Replace various utlity functions and class with those from AceCommon:
class TimingStatsincrementMod(),incrementModOffset(),printPad2To(),
printPad3To()strcmp_PP()strchr_P(),strrchr_P()for ESP8266 and ESP32PrintStr
- Move
common/CrcEeprom.hto AceUtils
(https://github.com/bxparks/AceUtils) library.
- Potentially Breaking: AceTime library now depends on the AceCommon