main: tighten future qio state checking

This commit is contained in:
Thomas Schoebel-Theuer 2022-06-02 12:16:45 +02:00 committed by Thomas Schoebel-Theuer
parent 66c42718d7
commit 079c1a3224
1 changed files with 13 additions and 1 deletions

View File

@ -1176,13 +1176,25 @@ int _set_copy_params(struct mars_brick *_brick, void *private)
if (unlikely(!aio_brick)) {
MARS_WRN("'%s' uninitialized brick %d\n",
_brick->brick_path, i);
mars_trigger();
goto done;
}
if (!aio_brick->power.led_on) {
/* Have the target states been reached? */
if (unlikely(aio_brick->power.button &&
!aio_brick->power.led_on)) {
MARS_INF("'%s' brick %d not working\n",
_brick->brick_path, i);
mars_trigger();
goto done;
}
if (unlikely(!aio_brick->power.button &&
!aio_brick->power.led_off)) {
MARS_INF("'%s' brick %d not yet off\n",
_brick->brick_path, i);
mars_trigger();
goto done;
}
status = aio_output->ops->mars_get_info(
aio_output,
&cc->info[i]);