Commit Graph

9 Commits

Author SHA1 Message Date
Maxim Prokhorov
d85ddad6da system: de-dup progmem strings
c/p PSTR attribute from Core files
dostring declaration with a macro instead of a scary looking boilerplate

saves varying amount of code space, mostly deals with our key and cmd strings
2022-10-23 03:19:07 +03:00
Maxim Prokhorov
3d580f3577 terminal: __FlashStringHelper -> StringView
- clean-up comparison routines and get rid of most of the casts
- reduces total number of calls to terminalRegisterCommand
  replace with a func accepting list of commands, which in
  turn get instantiated as constexpr PROGMEM arrays
- reduce ram fragmentation, since we don't need to alloc as much
- reduce flash consumption b/c of lambda -> standalone func conversion
2022-09-25 06:14:54 +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
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
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
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