Commit Graph

3547 Commits

Author SHA1 Message Date
Maxim Prokhorov
8bfc0c4882 hw: fix basic & basic-rf extra pin switch actions
https://gitter.im/tinkerman-cat/espurna?at=6302c2f2cf6cfd27af20f01b
should be toggle, same as the others

tnx to @luismaranesi
2022-09-01 04:55:54 +03:00
Maxim Prokhorov
d2e0bd9ac5 pio: update formatting 2022-08-31 03:08:30 +03:00
Maxim Prokhorov
5527441d36 pio: cppcheck works with pio-check
https://docs.platformio.org/en/latest/core/userguide/cmd_check.html
2022-08-31 03:08:30 +03:00
Maxim Prokhorov
246364470c ci: compress debug symbols a bit more 2022-08-31 03:08:30 +03:00
Maxim Prokhorov
038f1ffec3 pio: firmware.bin.gz builder 2022-08-31 03:08:30 +03:00
Maxim Prokhorov
d17316f78c pio: fix .bin size check script dependency
cannot depend on checkprogsize, since it depends on .elf and not .bin

also, compare with the block-aligned size
add notes about reserved space

warning might become annoying, though :)
2022-08-31 03:08:06 +03:00
Maxim Prokhorov
e8e9c152e7 pio: missing scripts 2022-08-30 03:22:47 +03:00
Maxim Prokhorov
a6df38e807 pio: stack dump decoder script
from the pending ESP8266 Core PR
2022-08-30 03:18:11 +03:00
Maxim Prokhorov
74ce4d974d pio: update formatting 2022-08-30 03:18:11 +03:00
Maxim Prokhorov
c0e74e431d pio: prettier file size output 2022-08-30 03:18:07 +03:00
Maxim Prokhorov
fd249c8055 pio: also hide raw putc function in postmortem
updates scripts to be a post action
rename redefined symbols to stubs
2022-08-30 02:06:30 +03:00
Maxim Prokhorov
6f122f5ecb pio: debug info in distributed builds and build-and-copy fixes
store objcopy of these extra symbols and .map from the linker
distribution will have an extra debug .zip file that could be used with
the exception decoder

also fixes relative paths in the build-and-copy
(although, yet again loses the pio target in the gui)
2022-08-30 01:33:55 +03:00
Maxim Prokhorov
25f6b021f5 system: convert is not inline 2022-08-29 22:51:31 +03:00
Maxim Prokhorov
59c4246c68 system: hwdt reset should start the check
in case rare errors sneak up, do not force into unstable mode
previously removed rtcmem special case allows us to continue
2022-08-29 21:28:22 +03:00
Maxim Prokhorov
93da96ca25 settings: todo 2022-08-29 06:04:38 +03:00
Maxim Prokhorov
ff19c0889d test: fix namespaces 2022-08-29 06:01:21 +03:00
Maxim Prokhorov
98584aecc4 settings: clean up after namespace update
missing stringview key checks
fix template specialization order when building single source
update left-over modules that werent using espurna { ... }
2022-08-29 05:52:50 +03:00
Maxim Prokhorov
cc16c36736 light: experimental sequence support
execute multiple transition-initiating functions
when we don't do any transitions or have value changes queued

main application for right now is a simple notification
routine that consists of N single channel on->off transitions
2022-08-29 05:52:47 +03:00
Maxim Prokhorov
3e36438748 settings: key check with string view
make our string comparisons nicer
also clean-up namespaces for storage access
2022-08-29 04:37:58 +03:00
Maxim Prokhorov
deffe551ed emon: fix missing terminal output for energy 2022-08-29 03:13:29 +03:00
Maxim Prokhorov
3f7d832267 sns: dummy sensor energy counter 2022-08-29 03:10:40 +03:00
Maxim Prokhorov
f4951d7228 system: set unstable flag when hwdt reset happens
- reduce number of resets that triggers unstable mode
- introduce a reboot reason for stability counter
  which only gets handled on soft-reset
- allow to forcibly change to either stable or unstable mode
  more explicit terminal comands to leave or enter either mode
2022-08-29 03:09:12 +03:00
Maxim Prokhorov
7659a63441 board: hwdt still keeps valid rtcmem contents 2022-08-29 00:45:39 +03:00
Maxim Prokhorov
b9427de5c0 board: do not reset sdk when already reset 2022-08-29 00:43:09 +03:00
Maxim Prokhorov
e704efffb4 emon: fix infinite recursion 2022-08-28 23:35:40 +03:00
Maxim Prokhorov
16fcee1786 Fix namespacing scope, export StringView
rework more namespaces to use `espurna` root
makes internal references much easier (and shorter)

view class is not specific to settings, could use it across the app
remove duplicate code from IR
2022-08-25 00:41:26 +03:00
Maxim Prokhorov
037a76733c terminal: type ambiguity 2022-08-24 01:04:31 +03:00
Maxim Prokhorov
0e55397a4a sns: add missing sensor strings 2022-08-21 18:22:30 +03:00
Maxim Prokhorov
befa961a8e web: strict check for ap connection
also fix invalid header accessor, toString() returns the whole HTTP
request string as `Host: blabla\r\n`
2022-08-21 18:16:41 +03:00
Maxim Prokhorov
97a4e0a8fc pwm: default to 1kHz
new-lib does not appear to work very well with 2 kHz
2022-08-19 19:10:24 +03:00
Maxim Prokhorov
1bc0bcdbaa pwm: terminal command and new-lib clean-up
restore pinMode(..., OUTPUT)
manually set initial duty
2022-08-19 19:10:24 +03:00
Maxim Prokhorov
2365d08b88 pwm: also handle older Core versions
when target duty is either zero or at the driver limit, forcibly
stop the waveform / pwm driver via a sort-of private function call

resolve #2532
2022-08-19 19:07:30 +03:00
Maxim Prokhorov
16d61d5fc2 gpio: register access commands 2022-08-19 17:39:39 +03:00
Maxim Prokhorov
091c87ea45 gpio: fix not using provided mode in gpio16 case 2022-08-19 17:36:25 +03:00
Maxim Prokhorov
2868e0a481 pwm: arduino needs an explicit stop 2022-08-19 14:53:11 +03:00
Maxim Prokhorov
1cb841125f pwm: adjust for float precision loss 2022-08-19 13:27:52 +03:00
Maxim Prokhorov
08a31fcbf5 pwm: fix arduino pin init 2022-08-19 13:10:40 +03:00
Maxim Prokhorov
844f20003d pzem004tv30: convert to watt seconds just once 2022-08-18 22:09:59 +03:00
Maxim Prokhorov
49b616afbc emon: rollover happens on kwh limit 2022-08-18 22:09:59 +03:00
Maxim Prokhorov
c86b4c3778 pzem004tv30: actually ignore initial energy request
amend 037be9aa99
2022-08-18 17:03:20 +03:00
Maxim Prokhorov
fb511ef891 pzem004tv30: sensor string 2022-08-18 16:58:53 +03:00
Maxim Prokhorov
7adb804464 pzem004tv30: try to calculate energy delta
- store latest pzem reading and compare with the latest one each reading
- fix `Energy::Energy(double)` scale, it should be kWh and not Wh
- move watt-second accumulator to constructor, allow object addition
2022-08-18 16:47:24 +03:00
Maxim Prokhorov
037be9aa99 emon: separate initial and reset energy api
ignore energy reset on boot with pzem004t(v30), ref. #2530
(and continue to use its own internal energy persistance)
2022-08-18 14:48:30 +03:00
Maxim Prokhorov
7095cfffd7 pwm: missing header
missed when moving new-pwm includes
fix accidentally including sdk header
2022-08-16 13:01:11 +03:00
Maxim Prokhorov
2d38efcd6b pzem004tv30: fix debug 2022-08-15 16:44:31 +03:00
Maxim Prokhorov
c07310c974 pzem004tv30: correct magnitude index for energy reset 2022-08-15 16:25:21 +03:00
Maxim Prokhorov
7f15da59ee sns: fix swdt reset when parsing MQTT payload
This *must* use views, but that's something for another day
Tweak terminal command, also allow to view the energy value
2022-08-15 16:25:21 +03:00
Maxim Prokhorov
1e655cc921 system: fix Core flash API usage when assessing latest crash
amends 8fb1a49881

Core accepts address, not sector
Compare with partial data, not just one byte
2022-08-15 16:25:01 +03:00
Maxim Prokhorov
c9a3a6ed54 lib: fix fs_math include 2022-08-15 12:01:50 +03:00
Maxim Prokhorov
b0da3e8c7f light: external pwm support
- allow both new-pwm and analogWrite (Core) implementations
- rework new-pwm initialization, a bit more sane type for pin config
- remove pin setup from lights, everything is handled by provider already
Core prepares and initializes pins when updating duty, new-pwm does this
when pwm_init is called
- rework internals related to value scaling, allow percentage as pwm duty
and value limit (instead of absolute limit set by lights previously)
2022-08-15 12:01:20 +03:00