Corrected effeciency of state machine in load control object.
This commit is contained in:
@@ -377,6 +377,8 @@ void Load_Control_State_Machine(int object_index)
|
||||
|
||||
switch (Load_Control_State[object_index]) {
|
||||
case SHED_REQUEST_PENDING:
|
||||
if (Load_Control_Request_Written[object_index]) {
|
||||
Load_Control_Request_Written[object_index] = false;
|
||||
/* request to cancel using default values? */
|
||||
switch (Requested_Shed_Level[object_index].type) {
|
||||
case BACNET_SHED_TYPE_PERCENT:
|
||||
@@ -398,11 +400,15 @@ void Load_Control_State_Machine(int object_index)
|
||||
}
|
||||
if (Load_Control_State[object_index] == SHED_INACTIVE)
|
||||
break;
|
||||
}
|
||||
if (Start_Time_Property_Written[object_index]) {
|
||||
Start_Time_Property_Written[object_index] = false;
|
||||
/* request to cancel using wildcards in start time? */
|
||||
if (datetime_wildcard(&Start_Time[object_index])) {
|
||||
Load_Control_State[object_index] = SHED_INACTIVE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* cancel because current time is after start time + duration? */
|
||||
Update_Current_Time(&Current_Time);
|
||||
datetime_copy(&End_Time[object_index], &Start_Time[object_index]);
|
||||
|
||||
Reference in New Issue
Block a user