Corrected Analog Output setting of value which had priority off-by-one error.
This commit is contained in:
@@ -168,7 +168,7 @@ bool Analog_Output_Present_Value_Set(uint32_t object_instance,
|
|||||||
if (priority && (priority <= BACNET_MAX_PRIORITY) &&
|
if (priority && (priority <= BACNET_MAX_PRIORITY) &&
|
||||||
(priority != 6 /* reserved */ ) &&
|
(priority != 6 /* reserved */ ) &&
|
||||||
(value >= 0.0) && (value <= 100.0)) {
|
(value >= 0.0) && (value <= 100.0)) {
|
||||||
Analog_Output_Level[index][priority] = (uint8_t) value;
|
Analog_Output_Level[index][priority-1] = (uint8_t) value;
|
||||||
/* Note: you could set the physical output here to the next
|
/* Note: you could set the physical output here to the next
|
||||||
highest priority, or to the relinquish default if no
|
highest priority, or to the relinquish default if no
|
||||||
priorities are set.
|
priorities are set.
|
||||||
@@ -192,7 +192,7 @@ bool Analog_Output_Present_Value_Relinquish(uint32_t object_instance,
|
|||||||
if (index < MAX_ANALOG_OUTPUTS) {
|
if (index < MAX_ANALOG_OUTPUTS) {
|
||||||
if (priority && (priority <= BACNET_MAX_PRIORITY) &&
|
if (priority && (priority <= BACNET_MAX_PRIORITY) &&
|
||||||
(priority != 6 /* reserved */ )) {
|
(priority != 6 /* reserved */ )) {
|
||||||
Analog_Output_Level[index][priority] = AO_LEVEL_NULL;
|
Analog_Output_Level[index][priority-1] = AO_LEVEL_NULL;
|
||||||
/* Note: you could set the physical output here to the next
|
/* Note: you could set the physical output here to the next
|
||||||
highest priority, or to the relinquish default if no
|
highest priority, or to the relinquish default if no
|
||||||
priorities are set.
|
priorities are set.
|
||||||
|
|||||||
Reference in New Issue
Block a user