Fix #50: Enable core cycle counter

This commit is contained in:
2023-01-01 20:01:04 +01:00
parent fd12faff75
commit d48ccf1612
4 changed files with 52 additions and 8 deletions

View File

@@ -892,7 +892,7 @@ shellmatta_retCode_t shell_cmd_cycle_count(const shellmatta_handle_t handle, con
counter = main_cycle_counter_get();
core_cycle_count = DWT->CYCCNT;
core_cycle_count = core_cycle_counter_get();
if (hex) {
shellmatta_printf(handle, "Main loop: 0x%016"PRIX64"\r\n", counter);
shellmatta_printf(handle, "CPU cycles: 0x%08"PRIX32"\r\n", core_cycle_count);
@@ -901,8 +901,8 @@ shellmatta_retCode_t shell_cmd_cycle_count(const shellmatta_handle_t handle, con
shellmatta_printf(handle, "CPU cycles: %"PRIu32"\r\n", core_cycle_count);
}
if (clear) {
main_cycle_counter_init();
DWT->CYCCNT = 0UL;
main_cycle_counter_reset();
core_cycle_counter_reset();
}
return SHELLMATTA_OK;
}