Skip to content

Commit

Permalink
Fix re-enabling power LED after memory test
Browse files Browse the repository at this point in the history
It should be done in normal thread context, rather than the IRQ
handler. Since do_cancel is lazily cleared, the LED flag was being
endlessly reset in the IRQ handler and affecting the audio test.

This fixes commit 87e8b82
  • Loading branch information
keirf committed Oct 3, 2024
1 parent 87e8b82 commit b4d8081
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions testkit/testkit.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,8 @@ void call_cancellable_test(int (*fn)(void *), void *arg)
call_cancellable_fn(&test_cancellation, fn, arg);
/* We can't be in any blitter or menu-option-update critical section. */
assert(cust->intenar & INT_SOFT);
/* Memory test may mess with power LED / audio filter: Reset it. */
ciaa->pra &= ~CIAAPRA_LED;
}

/* Allocate chip memory. Automatically freed when sub-test exits. */
Expand Down Expand Up @@ -1167,11 +1169,8 @@ static void c_SOFT_IRQ(struct c_exception_frame *frame)
prev_ciaapra = ciaapra;

/* Perform an asynchronous function cancellation if so instructed. */
if (do_cancel) {
if (do_cancel)
cancel_call(&test_cancellation, frame);
/* Memory test may mess with power LED / audio filter: Reset it. */
ciaa->pra &= ~CIAAPRA_LED;
}

IRQ_RESET(INT_SOFT);
}
Expand Down

0 comments on commit b4d8081

Please sign in to comment.