Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ColorControl] Split (Enhanced)Hue and Saturation transitions #25345

Merged

Conversation

jmartinez-silabs
Copy link
Member

@jmartinez-silabs jmartinez-silabs commented Feb 27, 2023

fixes #25040

Hue and Saturation are part of the same color schema (HSV). Previously, a command changing only the hue would stop any active saturation transition and vice versa.

This PR reworks the use of the ColorHueTransitionState and SaturationTransitionState so each transition can continue unaffected by a command only targeted to change one of the two.
Examples

move-to-hue
move-saturation
enhanced-step-hue
etc.

The following commands affect both at the same time:

move-to-hue-and-saturation
enhanced-move-to-hue-and-saturation
stop-move-step

Per spec move-hue, enhanced-move-hue and move-saturation stop (moveMode) will stop both transitions.
https://github.com/CHIP-Specifications/connectedhomeip-spec/blob/master/src/app_clusters/ColorControl.adoc#1184-effect-on-receipt

Some code clean up and changes in computeNewColor16uValue functions lead to some minor changes for XY and Temperature transition functions without affecting the behaviour.

Tested with chip-tool manually and with Test_TC_CC_X_Y (all of them) on EFR32 lighting-app

CI will also validate with the test suite.

@github-actions
Copy link

PR #25345: Size comparison from 4dd9eda to 1f89e1b

Decreases (1 build for cc32xx)
platform target config section 4dd9eda 1f89e1b change % change
cc32xx lock CC3235SF_LAUNCHXL .debug_info 20261984 20261983 -1 -0.0
Full report (1 build for cc32xx)
platform target config section 4dd9eda 1f89e1b change % change
cc32xx lock CC3235SF_LAUNCHXL 0 0 0 0.0
(read only) 643073 643073 0 0.0
(read/write) 203688 203688 0 0.0
.ARM.attributes 44 44 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 197088 197088 0 0.0
.comment 194 194 0 0.0
.data 1480 1480 0 0.0
.debug_abbrev 930155 930155 0 0.0
.debug_aranges 87280 87280 0 0.0
.debug_frame 299824 299824 0 0.0
.debug_info 20261984 20261983 -1 -0.0
.debug_line 2657104 2657104 0 0.0
.debug_loc 2799620 2799620 0 0.0
.debug_ranges 282184 282184 0 0.0
.debug_str 3023185 3023185 0 0.0
.ramVecs 780 780 0 0.0
.resetVecs 64 64 0 0.0
.rodata 105889 105889 0 0.0
.shstrtab 232 232 0 0.0
.stab 204 204 0 0.0
.stabstr 441 441 0 0.0
.stack 2048 2048 0 0.0
.strtab 377825 377825 0 0.0
.symtab 256240 256240 0 0.0
.text 535060 535060 0 0.0

@pullapprove pullapprove bot requested a review from cliffamzn February 28, 2023 23:36
jmartinez-silabs and others added 7 commits March 7, 2023 16:20
… doesn't stop the transition of the other. Some code clean up and changes in computeNewColor16uValue functions lead to some minor changes for XY and Temp transition functions
…is done. Update some return status to correct error codes
@pullapprove pullapprove bot requested a review from joonhaengHeo March 7, 2023 21:48
@github-actions
Copy link

github-actions bot commented Mar 7, 2023

PR #25345: Size comparison from c69e90d to ee681e4

Decreases (1 build for cc32xx)
platform target config section c69e90d ee681e4 change % change
cc32xx lock CC3235SF_LAUNCHXL .debug_info 20267387 20267386 -1 -0.0
Full report (1 build for cc32xx)
platform target config section c69e90d ee681e4 change % change
cc32xx lock CC3235SF_LAUNCHXL 0 0 0 0.0
(read only) 644425 644425 0 0.0
(read/write) 203688 203688 0 0.0
.ARM.attributes 44 44 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 197088 197088 0 0.0
.comment 194 194 0 0.0
.data 1480 1480 0 0.0
.debug_abbrev 930235 930235 0 0.0
.debug_aranges 87344 87344 0 0.0
.debug_frame 300044 300044 0 0.0
.debug_info 20267387 20267386 -1 -0.0
.debug_line 2659771 2659771 0 0.0
.debug_loc 2802807 2802807 0 0.0
.debug_ranges 282960 282960 0 0.0
.debug_str 3024017 3024017 0 0.0
.ramVecs 780 780 0 0.0
.resetVecs 64 64 0 0.0
.rodata 105929 105929 0 0.0
.shstrtab 232 232 0 0.0
.stab 204 204 0 0.0
.stabstr 441 441 0 0.0
.stack 2048 2048 0 0.0
.strtab 378514 378514 0 0.0
.symtab 256624 256624 0 0.0
.text 536372 536372 0 0.0

@pullapprove pullapprove bot requested a review from younghak-hwang March 7, 2023 23:35
@jmartinez-silabs jmartinez-silabs merged commit 82da16f into project-chip:master Mar 9, 2023
@jmartinez-silabs jmartinez-silabs deleted the split_CC_transitions branch March 9, 2023 13:07
lecndav pushed a commit to lecndav/connectedhomeip that referenced this pull request Mar 22, 2023
…t-chip#25345)

* Split (Enhanced)Hue and Saturation transition so a command changing 1 doesn't stop the transition of the other. Some code clean up and changes in computeNewColor16uValue functions lead to some minor changes for XY and Temp transition functions

* reset hue or saturation transtition state on moveHue or moveSaturation stop commands

* Restyled by clang-format

* Make sure RemainingTime is set to the longest time between two HSV transitions. Fix typos in comments

* A moveXYZ rate of 0 is a invalid command except for MoveMode Stop were the rate is ignored

* Restyled by clang-format

* Add check for command parameters or move them before any other logic is done. Update some return status to correct error codes

* Restyled by clang-format

---------

Co-authored-by: Restyled.io <[email protected]>
mwswartwout pushed a commit to mwswartwout/connectedhomeip that referenced this pull request Mar 27, 2023
…t-chip#25345)

* Split (Enhanced)Hue and Saturation transition so a command changing 1 doesn't stop the transition of the other. Some code clean up and changes in computeNewColor16uValue functions lead to some minor changes for XY and Temp transition functions

* reset hue or saturation transtition state on moveHue or moveSaturation stop commands

* Restyled by clang-format

* Make sure RemainingTime is set to the longest time between two HSV transitions. Fix typos in comments

* A moveXYZ rate of 0 is a invalid command except for MoveMode Stop were the rate is ignored

* Restyled by clang-format

* Add check for command parameters or move them before any other logic is done. Update some return status to correct error codes

* Restyled by clang-format

---------

Co-authored-by: Restyled.io <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use separate transitions for hue and saturation in color control
4 participants