* It appears that the rf_pre_init is not called any more. Also cleaned up the code in
wifi_common.
* Log a message (at the right baud rate) if the hostname is invalid
* Updated the comment in the user_config.h file
* Don't adjust the clock until after we deal with rtctime...
* Switched to using START_OPTION_CPU_FREQ_MAX instead.
* Use setfield and add caching of the startup option
* Put the startupcounts warning into a warning box
* SoftUART fixes:
- Simplify code by using lua_L* functions and using userdata properly
- Fix some edge-cases
- Add more examples to documentation
* Don't de-register interrupt hook if there is more RX instances
* More bug fixes and registering simplification with luaL_reref and unref2
* Correct documentation of SoftUART module
* Change struct to use integers. This is slightly more complex as we have to deal with Unsigned 32-bit integers (that aren't lua integers)
* Use int64 in struct rather than double.
* Fix sjson to do the right things in LUA5.3 with integers and floats
I've not been able to get the mqtt `connfail` callback to work.
I'm consistently receiving `method not supported` errors:
```
application.lua:53: method not supported
stack traceback:
[C]: in function 'on'
application.lua:53: in main chunk
[C]: in function 'dofile'
init.lua:18: in function <init.lua:6>
```
Example code:
```
function on_connection_failed(client, reason)
print("mqtt connection failed: " .. reason)
end
m:on("connfail", on_connection_failed)
```
I believed this to be caused by the incorrect length comparison for `connfail`
that is updated here.
Once I changed that, the error went away, however the callback was never called.
I believe the callback was never called because of an incorrect assignment.
However, I saw this somewhat confusing description in the docs so this
assignment may be expected?
> The second (failure) callback aliases with the "connfail" callback available through :on(). (The "offline" callback is only called after an already established connection becomes closed. If the connect() call fails to establish a connection, the callback passed to :connect() is called and nothing else.)
* DHT module: fix the handling of negative temps.
The macro handling the conversion from the 2 bytes buffer to a double
was handling negative values by checking the sign bit and taking the
negative value of the number minus the sign bit.
Unfortunately this does not work as the negative values are represented
in 1's complement, so for instance -1 was becoming -32767
* +1 = b0000_0000_0000_ 0001
* -1 = 1111_1111_1111_1111
This replace the spacial code with a signed 16 bits value.
* Refactoring: removes some code duplication.
* Fixed the conversion of the 8/16 bits values
Co-authored-by: Marco Dondero <marco@dondero.eu>