Commit d0cdc5c9 authored by Jeroen Vreeken's avatar Jeroen Vreeken
Browse files

Log when switches are closed. (not only when opened)

parent ae07c448
......@@ -154,7 +154,10 @@ static void dt_az_safety_calculate(struct controller_block *safety)
log_send(LOG_T_ERROR, "Azimuth HW positive safety switch is open.");
}
} else {
safety->private->err_hwsafe_positive = false;
if (safety->private->err_hwsafe_positive) {
safety->private->err_hwsafe_positive = false;
log_send(LOG_T_INFO, "Azimuth HW positive safety switch is closed.");
}
}
if (*safety->private->safety_in_negative == 0) {
safe = false;
......@@ -163,7 +166,10 @@ static void dt_az_safety_calculate(struct controller_block *safety)
log_send(LOG_T_ERROR, "Azimuth HW negative safety switch is open.");
}
} else {
safety->private->err_hwsafe_negative = false;
if (!safety->private->err_hwsafe_negative) {
safety->private->err_hwsafe_negative = false;
log_send(LOG_T_INFO, "Azimuth HW negative safety switch is closed.");
}
}
if (!safe) {
......
......@@ -326,7 +326,11 @@ static void dt_el_safety_calculate(struct controller_block *safety)
"Elevation HW top safety switch is open.");
}
} else {
safety->private->err_hwsafe_top = false;
if (safety->private->err_hwsafe_top) {
safety->private->err_hwsafe_top = false;
log_send(LOG_T_INFO,
"Elevation HW top safety switch is closed.");
}
}
/* bottom safety switch */
......@@ -338,7 +342,11 @@ static void dt_el_safety_calculate(struct controller_block *safety)
"Elevation HW bottom safety switch is open.");
}
} else {
safety->private->err_hwsafe_bottom = false;
if (safety->private->err_hwsafe_bottom) {
safety->private->err_hwsafe_bottom = false;
log_send(LOG_T_INFO,
"Elevation HW bottom safety switch is closed.");
}
}
if (!safe)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment