Skip to content

Commit

Permalink
WindowCovering: fixes + simplification (project-chip#16841)
Browse files Browse the repository at this point in the history
* DEV: Add ComputePercent100thsStep function to server

* DEV: Simplify/Factorize OperationalStatus Scheduling update

* Fix: Compilator ask for cast

* Fix: Bug with GoTos wrong parameter

* DEV: App possibility to SetNull to all Position attributes

* DEV: Factorize SchedulePositionSet for Tilt/Lift

* FIX: Bug where all attribute weren't updated properly

* FIX: Missing prototype updates

* DEV: Simplify/Factorize Up and Down for Tilt/Lift

* DEV: Add Small comments about NVM

* Restyled by clang-format

* Fix: Conversion mistake lift tilt

Co-authored-by: Restyled.io <commits@restyled.io>
  • Loading branch information
jmeg-sfy and restyled-commits authored Mar 31, 2022
1 parent 910d2bf commit 98294c9
Show file tree
Hide file tree
Showing 4 changed files with 157 additions and 182 deletions.
18 changes: 11 additions & 7 deletions examples/window-app/common/include/WindowApp.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,16 @@ class WindowApp
void LiftUpdate(bool newTarget);
void LiftGoToTarget() { LiftUpdate(true); }
void LiftContinueToTarget() { LiftUpdate(false); }
void LiftUp();
void LiftDown();
void LiftStepToward(OperationalState direction);
void LiftSchedulePositionSet(chip::Percent100ths position) { SchedulePositionSet(position, false); }

void TiltUpdate(bool newTarget);
void TiltGoToTarget() { TiltUpdate(true); }
void TiltContinueToTarget() { TiltUpdate(false); }
void TiltUp();
void TiltDown();
void TiltStepToward(OperationalState direction);
void TiltSchedulePositionSet(chip::Percent100ths position) { SchedulePositionSet(position, true); }

void StepToward(OperationalState direction, bool isTilt);

EmberAfWcType CycleType();

Expand All @@ -139,6 +141,7 @@ class WindowApp
struct CoverWorkData
{
chip::EndpointId mEndpointId;
bool isTilt;

union
{
Expand All @@ -147,9 +150,10 @@ class WindowApp
};
};

static void ScheduleTiltPositionSet(intptr_t arg);
static void ScheduleLiftPositionSet(intptr_t arg);
static void ScheduleOperationalStatusSetWithGlobalUpdate(intptr_t arg);
void SchedulePositionSet(chip::Percent100ths position, bool isTilt);
static void CallbackPositionSet(intptr_t arg);
void ScheduleOperationalStatusSetWithGlobalUpdate(OperationalStatus opStatus);
static void CallbackOperationalStatusSetWithGlobalUpdate(intptr_t arg);
};

static WindowApp & Instance();
Expand Down
Loading

0 comments on commit 98294c9

Please sign in to comment.