From bbb852a8dca9e9337ec5585f37ca241210f04688 Mon Sep 17 00:00:00 2001 From: Thomas Schoebel-Theuer Date: Sun, 10 May 2020 19:05:24 +0200 Subject: [PATCH] main: new response gate-{on,queued} --- kernel/sy_old/mars_main.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/kernel/sy_old/mars_main.c b/kernel/sy_old/mars_main.c index 2baa422c..26c8d0ab 100644 --- a/kernel/sy_old/mars_main.c +++ b/kernel/sy_old/mars_main.c @@ -890,6 +890,7 @@ struct mars_rotate { int replay_code; int avoid_count; int old_open_count; + __s32 old_inhibit_mask; bool is_attached; bool res_shutdown; bool has_error; @@ -5840,6 +5841,17 @@ done: return status; } +static +void _show_gate(struct mars_rotate *rot) +{ + if (!rot->gate_brick) + return; + __show_actual(rot->parent_path, "gate-on", + rot->gate_brick->power.led_on); + __show_actual(rot->parent_path, "gate-queued", + rot->gate_brick->gate_queued); +} + static bool allow_dev(struct mars_rotate *rot) { @@ -5873,7 +5885,9 @@ int make_gate(struct mars_rotate *rot, struct mars_dent *dent) MARS_DBG("todo_gate=%d\n", rot->todo_gate); - if (!_gate_brick && !rot->todo_gate) + if (_gate_brick) + _show_gate(rot); + else if (!rot->todo_gate) goto done; switch_on = @@ -5914,6 +5928,12 @@ int make_gate(struct mars_rotate *rot, struct mars_dent *dent) _gate_brick->rewire = true; inhibit_mask = _check_allow(rot->parent_path, "gate-mask"); rot->gate_brick->inhibit_mask = inhibit_mask; + /* early reporting when gate has changed */ + if (inhibit_mask != rot->old_inhibit_mask) { + _show_gate(rot); + mars_remote_trigger(MARS_TRIGGER_LOCAL | MARS_TRIGGER_TO_REMOTE); + } + rot->old_inhibit_mask = inhibit_mask; done: return 0;