mirror of https://github.com/schoebel/mars
light: fix re-computation of todo_primary
This commit is contained in:
parent
94e28913b1
commit
79f7e6acd3
|
@ -2804,11 +2804,6 @@ int make_primary(void *buf, struct mars_dent *dent)
|
||||||
struct mars_rotate *rot;
|
struct mars_rotate *rot;
|
||||||
int status = -EINVAL;
|
int status = -EINVAL;
|
||||||
|
|
||||||
if (!global->global_power.button) {
|
|
||||||
status = 0;
|
|
||||||
goto done;
|
|
||||||
}
|
|
||||||
|
|
||||||
parent = dent->d_parent;
|
parent = dent->d_parent;
|
||||||
CHECK_PTR(parent, done);
|
CHECK_PTR(parent, done);
|
||||||
rot = parent->d_private;
|
rot = parent->d_private;
|
||||||
|
@ -2820,6 +2815,7 @@ int make_primary(void *buf, struct mars_dent *dent)
|
||||||
global->global_power.button && dent->new_link && !strcmp(dent->new_link, my_id());
|
global->global_power.button && dent->new_link && !strcmp(dent->new_link, my_id());
|
||||||
rot->is_primary =
|
rot->is_primary =
|
||||||
rot->if_brick && !rot->if_brick->power.led_off;
|
rot->if_brick && !rot->if_brick->power.led_off;
|
||||||
|
MARS_DBG("todo_primary = %d is_primary = %d\n", rot->todo_primary, rot->is_primary);
|
||||||
status = 0;
|
status = 0;
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
|
Loading…
Reference in New Issue