Skip to content

Commit

Permalink
update app
Browse files Browse the repository at this point in the history
  • Loading branch information
davideschiavone committed Jul 22, 2024
1 parent 0cac18a commit f2abe44
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions sw/applications/example_spidma_powergate/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,21 @@ int main(int argc, char *argv[])
CSR_CLEAR_BITS(CSR_REG_MSTATUS, 0x8);
if (dma_is_ready(0) == 0)
{
PRINTF("Going to sleep...\r\n");
if (power_gate_core(&power_manager, kDma_pm_e, &power_manager_counters) != kPowerManagerOk_e)
{
PRINTF("Error: power manager fail.\n\r");
return EXIT_FAILURE;
}
PRINTF("Woken up...\r\n");

}
CSR_SET_BITS(CSR_REG_MSTATUS, 0x8);
}


PRINTF("Check results...\r\n");

// Check if what we read is correct (i.e. on_chip_buffer == flash_only_buffer_golden_value)
for(int i = 0; i < FLASH_ONLY_WORDS; i++) {
if (on_chip_buffer[i] != flash_only_buffer_golden_value[i]) {
Expand All @@ -180,5 +186,7 @@ int main(int argc, char *argv[])
}
}

if(errors==0) PRINTF("TEST RUN SUCCEFFULLY\r\n");

return errors;
}

0 comments on commit f2abe44

Please sign in to comment.