add wait for both spn interrupts

This commit is contained in:
Stanislaw Kaushanski 2021-05-17 11:54:37 +02:00
parent 1b09899d2a
commit a70f5bb09c
3 changed files with 12 additions and 2 deletions

Binary file not shown.

View File

@ -66,6 +66,17 @@ void wait_for_spn2_interrupt() {
spn2_hw_interrupt=true; spn2_hw_interrupt=true;
} }
void wait_for_spn_interrupts() {
if(spn1_hw_interrupt || spn2_hw_interrupt) {
do{
asm("wfi");
asm("nop");
}while(spn1_hw_interrupt || spn2_hw_interrupt);
}
spn1_hw_interrupt=true;
spn2_hw_interrupt=true;
}
/*!\brief initializes platform /*!\brief initializes platform
* *
*/ */

View File

@ -97,8 +97,7 @@ int main() {
for (int k = 0; k < iterations*step; k+=step) { for (int k = 0; k < iterations*step; k+=step) {
run_xspn1(in_addr, out_addr1, step, in_beats, out_beats); run_xspn1(in_addr, out_addr1, step, in_beats, out_beats);
run_xspn2(in_addr, out_addr2, step, in_beats, out_beats); run_xspn2(in_addr, out_addr2, step, in_beats, out_beats);
wait_for_spn1_interrupt(); wait_for_spn_interrupts();
wait_for_spn2_interrupt();
printf("XSPN finished\n"); printf("XSPN finished\n");
spn_checker::offset_reg() = k; spn_checker::offset_reg() = k;
spn_checker::length_reg() = step; spn_checker::length_reg() = step;