Don't introduce our callback to the type system, continue to bind the
ticker instance as the timer's arg and just use the lambda to pass the
argument to the reset function
```
libraries/Ticker/src/Ticker.h:136:41: warning: cast between incompatible function types from 'void (*)(CustomResetReason)' to 'Ticker::callback_with_arg_t' {aka 'void (*)(void*)'} [-Wcast-function-type]
136 | _attach_ms(milliseconds, false, reinterpret_cast<callback_with_arg_t>(callback), reinterpret_cast<void*>(arg));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
Attempt to either parse with newer syntax, or fallback to the floating
point seconds as default. Settings also return a 'result' instead of the
default zero, fallback to build value otherwise (which is still floating point, though)
Update /pulse API endpoint to report the actual pulse timer value that
is active right now, not just the value attached via the setting
Make sure we don't try to strlen some empty space or neighbouring
segments, that may or may not contain nulls
Also tweak the function to warn about large messages, since it is not
(yet) clear whether we actually want those. At least something to log.
Make sure to properly clamp delay times, as the recent issue had shown
it is possible to go below the update limit. SNTP app does not do any
runtime checks, so it's up to us to enforce these limits
Update internal random number generator from raw `secureRandom()` to a custom
'std::random_device'-look-alike, where we could also use it with STL functions
(current implementation is `os_random()` aka `esp_random()`)
Not as clean as other modules, but at least prepare for the further changes.
Implement settings for float duration conversion, and test it out with pulse
and flood window time values.
More safe-guards for an externally-defined pulse time, make sure it is
not either inf or nan and is an actual finite number
Also use EnumerableConfig for the WebUI output, and make sure to use
internal _relays.size() instead of doing a function call
Make sure it could be moved further along, and the values inside of it
can be safely moved as well.
Also fixup commands that were missing ctx in OK / Error.
Use internal duration types, store time in seconds and propogate as
uint32_t when it is necessary. Update tick values as well.
Instead of generic `toInt(), overload between `strtol` and `strtoll`.
Current implementation of `settimeofday` rejects `struct tz` pointer,
make sure it's nullptr.
Sync is a simple enough routine... But, expect an already synced system
before triggering the sntp restart.
For this, keep things as milliseconds (at least for now)
Make sure to use __builtin_strlen in constexpr context
Remove `has*()` functions that are no longer used
Update WebUI callback to use EnumerableConfig
There's no need to move a temporary which is already an rvalue
Clean-up some redundant attributes and function in settings.
Make sure C types are proxied to fixed-sized ones, not the other way around.
Clean-up webprint implementation
- use typed duration for the backlog
- don't duplicate members and types for config, just re-use the struct as-is
- don't go over-the-top with const members, just proxy through a method
(possibly) noticed in the gitter
https://gitter.im/tinkerman-cat/espurna?at=61abba5a76e37917551e4a2f
refactoring causality, as there's no longer an explicit Serial.begin
for RFB_PROVIDER_EFM8BB1 in the hardware setup in the system.cpp
(also, from not including wip serial changes that did serial port setup :/)
- BREAKING replace loadavg and system check from millis to seconds
- implement all available system clocks, make sure it is correctly
scaled with the origin type
- fix duration::{millis(),ccount(),seconds()} and return a respective
clock's time_point instead of duration. just like led sources, make
sure every module stores timestamps as time_point and intervals as
duration
- no need to track millis overflow on top of existing overflow counter
of the micros64 in getUptime
- remove class overhead in led static delays conversion, just try to
inline the required calculations and use NAME as unique id
also fix some non-apparent issues with heartbeat
- allow zero interval when it is also Mode::Once
- iterating runners to find the interval might return zero
* Add support for Yagusmart 1, 2 ad 3 gang switches
https://www.amazon.co.uk/gp/product/B086MV5MC8
These don't come with an esp8266 anymore, but can be trivially converted
as the new chip is pin compatible. Note, GPIO15 needs to be connected to
GND on 1 and 2 gang switches in order to enable the ESP to boot.
* Update code/platformio.ini
Co-authored-by: Max Prokhorov <prokhorov.max@outlook.com>
* Adjust build flags and name to be conformant to project culture and conventions
* changelog
* sorting
Co-authored-by: Max Prokhorov <prokhorov.max@outlook.com>
```
In file included from espurna\espurna_single_source.cpp:62:
espurna\wifi.cpp:282:38: error: specialization of 'T settings::internal::convert(const String&) [with T = IPAddress]' after instantiation
282 | IPAddress convert(const String& value) {
| ^
```
simplify isr code, since esp{8266,32} Cores allow to pass void* argument to the isr
also allows to seamlessly lock the gpio (but, outside does not yet check it's result)