Commit 98a05aa4 authored by Daan Vreeken's avatar Daan Vreeken
Browse files

Add debug log lines for changes of the output state.

	modified:   block/block_oneshot.c
parent d067dc6b
......@@ -78,8 +78,10 @@ struct controller_block_private {
static void calculate(struct controller_block *block)
{
struct controller_block_private *priv;
bool last_out;
priv = block->private;
last_out = OUTPUT(out);
if (INPUT(reset) == true) {
OUTPUT(out) = false;
......@@ -89,9 +91,16 @@ static void calculate(struct controller_block *block)
OUTPUT(out) = true;
priv->ticks_left = priv->period;
} else {
if ((priv->ticks_left) && (--priv->ticks_left == 0))
if ((priv->ticks_left) && (--priv->ticks_left == 0)) {
OUTPUT(out) = false;
}
}
#ifdef DEBUG
if (OUTPUT(out) != last_out)
log_send(LOG_T_DEBUG, "%s: turned %s", block->name,
OUTPUT(out) ? "on" : "off");
#endif
}
static struct controller_block_interm_list interms[] = {
......
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