Skip to content

Commit

Permalink
some bugfixes from upstream 0.14.0
Browse files Browse the repository at this point in the history
- issue wled#2820 AEST Time Is Incorrect
- PR wled#2840 Add PKT time zone
- issue wled#2708 4LD unnecessary use of software I2C on ESP32
  • Loading branch information
softhack007 committed Oct 20, 2022
1 parent 406806f commit 07efa88
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,11 @@ class FourLineDisplayUsermod : public Usermod {
isHW = (ioPin[0]==HW_PIN_SCL && ioPin[1]==HW_PIN_SDA);
PinManagerPinType pins[2] = { { ioPin[0], true }, { ioPin[1], true } };
if (ioPin[0]==HW_PIN_SCL && ioPin[1]==HW_PIN_SDA) po = PinOwner::HW_I2C; // allow multiple allocations of HW I2C bus pins
#ifdef ARDUINO_ARCH_ESP32
isHW = true; // WLEDSR - always use hardware I2C in ESP32
po = PinOwner::HW_I2C;
#endif
if ((ioPin[0] < 0) || (ioPin[1] <0)) { type=NONE; return; } // WLEDSR bugfix: avoid crash due to invalid PINS
if (!pinManager.allocateMultiplePins(pins, 2, po)) { type=NONE; return; }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,11 @@ class FourLineDisplayUsermod : public Usermod {
isHW = (ioPin[0]==HW_PIN_SCL && ioPin[1]==HW_PIN_SDA);
PinManagerPinType pins[2] = { { ioPin[0], true }, { ioPin[1], true } };
if (ioPin[0]==HW_PIN_SCL && ioPin[1]==HW_PIN_SDA) po = PinOwner::HW_I2C; // allow multiple allocations of HW I2C bus pins
#ifdef ARDUINO_ARCH_ESP32
isHW = true; // WLEDSR - always use hardware I2C in ESP32
po = PinOwner::HW_I2C;
#endif
if ((ioPin[0] < 0) || (ioPin[1] <0)) { type=NONE; return; } // WLEDSR bugfix: avoid crash due to invalid PINS
if (!pinManager.allocateMultiplePins(pins, 2, po)) { type=NONE; return; }
}

Expand Down
1 change: 1 addition & 0 deletions wled00/data/settings_time.htm
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ <h2>Time setup</h2>
<option value="19">NOVT (Novosibirsk)</option>
<option value="20">AKST/AKDT (Anchorage)</option>
<option value="21">MX-CST/CDT</option>
<option value="22">PKT (Pakistan)</option>
</select><br>
UTC offset: <input name="UO" type="number" min="-65500" max="65500" required> seconds (max. 18 hours)<br>
Current local time is <span class="times">unknown</span>.<br>
Expand Down
49 changes: 25 additions & 24 deletions wled00/html_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -433,30 +433,31 @@ US-MST/MDT</option><option value="7">US-AZ</option><option value="8">US-PST/PDT
</option><option value="15">CA-Saskatchewan</option><option value="16">ACST
</option><option value="17">ACST/ACDT</option><option value="18">HST (Hawaii)
</option><option value="19">NOVT (Novosibirsk)</option><option value="20">
AKST/AKDT (Anchorage)</option><option value="21">MX-CST/CDT</option></select>
<br>UTC offset: <input name="UO" type="number" min="-65500" max="65500"
required> seconds (max. 18 hours)<br>Current local time is <span class="times">
unknown</span>.<br>Latitude: <select name="LTR"><option value="N">N</option>
<option value="S">S</option></select><input name="LT" type="number" class="xl"
min="0" max="66.6" step="0.01"><br>Longitude: <select name="LNR"><option
value="E">E</option><option value="W">W</option></select><input name="LN"
type="number" class="xl" min="0" max="180" step="0.01"><br><button
type="button" id="locbtn" onclick="getLoc()">Get location</button><div><i>
(opens new tab, only works in browser)</i></div><div id="sun" class="times">
</div><h3>Clock</h3>Analog Clock overlay: <input type="checkbox" name="OL"
onchange="Cs()"><br><div id="cac">First LED: <input name="O1" type="number"
min="0" max="255" required> Last LED: <input name="O2" type="number" min="0"
max="255" required><br>12h LED: <input name="OM" type="number" min="0"
max="255" required><br>Show 5min marks: <input type="checkbox" name="O5"><br>
Seconds (as trail): <input type="checkbox" name="OS"><br></div>Countdown Mode:
<input type="checkbox" name="CE"><br>Countdown Goal:<br>Date:&nbsp;<nowrap>20
<input name="CY" class="xs" type="number" min="0" max="99" required>-<input
name="CI" class="xs" type="number" min="1" max="12" required>-<input name="CD"
class="xs" type="number" min="1" max="31" required></nowrap><br>Time:<nowrap>
<input name="CH" class="xs" type="number" min="0" max="23" required>:<input
name="CM" class="xs" type="number" min="0" max="59" required>:<input name="CS"
class="xs" type="number" min="0" max="59" required></nowrap><br><h3>
Macro presets</h3><b>Macros have moved!</b><br><i>
AKST/AKDT (Anchorage)</option><option value="21">MX-CST/CDT</option><option
value="22">PKT (Pakistan)</option></select><br>UTC offset: <input name="UO"
type="number" min="-65500" max="65500" required> seconds (max. 18 hours)<br>
Current local time is <span class="times">unknown</span>.<br>Latitude: <select
name="LTR"><option value="N">N</option><option value="S">S</option></select>
<input name="LT" type="number" class="xl" min="0" max="66.6" step="0.01"><br>
Longitude: <select name="LNR"><option value="E">E</option><option value="W">W
</option></select><input name="LN" type="number" class="xl" min="0" max="180"
step="0.01"><br><button type="button" id="locbtn" onclick="getLoc()">
Get location</button><div><i>(opens new tab, only works in browser)</i></div>
<div id="sun" class="times"></div><h3>Clock</h3>Analog Clock overlay: <input
type="checkbox" name="OL" onchange="Cs()"><br><div id="cac">First LED: <input
name="O1" type="number" min="0" max="255" required> Last LED: <input name="O2"
type="number" min="0" max="255" required><br>12h LED: <input name="OM"
type="number" min="0" max="255" required><br>Show 5min marks: <input
type="checkbox" name="O5"><br>Seconds (as trail): <input type="checkbox"
name="OS"><br></div>Countdown Mode: <input type="checkbox" name="CE"><br>
Countdown Goal:<br>Date:&nbsp;<nowrap>20<input name="CY" class="xs"
type="number" min="0" max="99" required>-<input name="CI" class="xs"
type="number" min="1" max="12" required>-<input name="CD" class="xs"
type="number" min="1" max="31" required></nowrap><br>Time:<nowrap><input
name="CH" class="xs" type="number" min="0" max="23" required>:<input name="CM"
class="xs" type="number" min="0" max="59" required>:<input name="CS" class="xs"
type="number" min="0" max="59" required></nowrap><br><h3>Macro presets</h3><b>
Macros have moved!</b><br><i>
Presets now also can be used as macros to save both JSON and HTTP API commands.
<br>Just enter the preset ID below!</i> <i>
Use 0 for the default action instead of a preset</i><br>Alexa On/Off Preset:
Expand Down
10 changes: 8 additions & 2 deletions wled00/ntp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Timezone* tz;
#define TZ_NOVOSIBIRSK 19
#define TZ_ANCHORAGE 20
#define TZ_MX_CENTRAL 21
#define TZ_PAKISTAN 22
#define TZ_INIT 255

byte tzCurrent = TZ_INIT; //uninitialized
Expand Down Expand Up @@ -93,12 +94,12 @@ void updateTimezone() {
break;
}
case TZ_AUSTRALIA_EASTERN : {
tcrDaylight = {Second, Sun, Oct, 2, 660}; //AEDT = UTC + 11 hours
tcrDaylight = {First, Sun, Oct, 2, 660}; //AEDT = UTC + 11 hours
tcrStandard = {First, Sun, Apr, 3, 600}; //AEST = UTC + 10 hours
break;
}
case TZ_NEW_ZEALAND : {
tcrDaylight = {Second, Sun, Sep, 2, 780}; //NZDT = UTC + 13 hours
tcrDaylight = {Last, Sun, Sep, 2, 780}; //NZDT = UTC + 13 hours
tcrStandard = {First, Sun, Apr, 3, 720}; //NZST = UTC + 12 hours
break;
}
Expand Down Expand Up @@ -147,6 +148,11 @@ void updateTimezone() {
tcrStandard = {Last, Sun, Oct, 2, -360}; //CST = UTC - 6 hours
break;
}
case TZ_PAKISTAN : {
tcrDaylight = {Last, Sun, Mar, 1, 300}; //Pakistan Standard Time = UTC + 5 hours
tcrStandard = tcrDaylight;
break;
}
}

tzCurrent = currentTimezone;
Expand Down
2 changes: 1 addition & 1 deletion wled00/wled.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

// version code in format yymmddb (b = daily build)
#define VERSION 2210203 // WLEDSR specific version
#define VERSION 2210204 // WLEDSR specific version
#define SR_VERSION_NAME "0.13.3-beta" // WLEDSR version name --> some files need manual updating: package.json, package-lock.json, improv.cpp

#define AC_VERSION 2208222 // AC WLED base version; last updated by PR CHANGE-> #217 Merge AC-main into SR-dev
Expand Down

0 comments on commit 07efa88

Please sign in to comment.