mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2026-10-31 13:52:15 +01:00
refactor: share the shade travel maths in ShadeMotion.cpp
checkMovement worked out the position four times, nearly copy-pasted, for lift down, lift up, tilt down and tilt up. All four now call travelPosition(), which keeps the same arithmetic, including how the elapsed time wraps with millis(). Tilt up with no tilt time still stops the tilt direction in the caller. transformPosition and transformCommand keep their behaviour through the new displayPosition() and flipCommand() helpers. The native env builds ShadeMotion.cpp so all of this can be unit tested on the PC. No behaviour change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
8881289b1d
commit
3a8736f4d4
6 changed files with 76 additions and 127 deletions
|
|
@ -101,7 +101,7 @@ lib_deps =
|
|||
platform = native
|
||||
test_framework = unity
|
||||
test_build_src = yes
|
||||
build_src_filter = -<*> +<Utils.cpp> +<SomfyFrame.cpp> +<JsonFormatter.cpp>
|
||||
build_src_filter = -<*> +<Utils.cpp> +<SomfyFrame.cpp> +<JsonFormatter.cpp> +<ShadeMotion.cpp>
|
||||
build_flags =
|
||||
-std=gnu++17
|
||||
-Isrc
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue