gui: Add option to set timezone minutes offset & Fix wrong timezone hour offset & Add timezone dst support #3570
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes the wrong timezone hour offset range (did include only +12 but not up to +14 hours) and also introduces a timezone minutes option to select a timezone offset in minutes (0 min, 30 min and 45 min).
This addresses the issues #3550, #1779 and #3141.
As the timezone eeprom storage value is only uint8_t, the data could be further optimized and compressed into a bitstream as it also saves space, which would be possible.
My recommendation for storing the timezone data compressed in a uint8_t:
struct tz_offset{
uint8_t hours:4; // 0..14 hours offset
uint8_t mins:2; // 0=0, 1=30, 2=45 minutes offset
uint8_t summertime:1; // 0=wintertime, 1=summertime
uint8_t signed:1; // 0=negative gmt hour offset, 1=positive gmt hour offset
};
If that is wanted/needed, I can also add these needed eeprom changes as well to use a compressed structure instead.