|
|
|
@ -53,17 +53,7 @@ void __attribute__((__no_instrument_function__)) __cyg_profile_func_enter (void
|
|
|
|
|
if (!profiling) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
/*
|
|
|
|
|
uint8_t i;
|
|
|
|
|
int16_t idx = -1;
|
|
|
|
|
for (i = 0; i < MAX_TRACED_FUNCTIONS; i++) {
|
|
|
|
|
if (functions[i].address == (uint32_t) func) {
|
|
|
|
|
idx = i;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
uint8_t idx = get_function_index((uint32_t) func);
|
|
|
|
|
int16_t idx = get_function_index((uint32_t) func);
|
|
|
|
|
if ((idx < 0) && (traced_functions < MAX_TRACED_FUNCTIONS)) {
|
|
|
|
|
idx = traced_functions++;
|
|
|
|
|
functions[idx].address = (uint32_t) func;
|
|
|
|
@ -81,17 +71,7 @@ void __attribute__((__no_instrument_function__)) __cyg_profile_func_exit (void *
|
|
|
|
|
if (!profiling) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
/*
|
|
|
|
|
uint8_t i;
|
|
|
|
|
int16_t idx = -1;
|
|
|
|
|
for (i = 0; i < MAX_TRACED_FUNCTIONS; i++) {
|
|
|
|
|
if (functions[i].address == (uint32_t) func) {
|
|
|
|
|
idx = i;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
uint8_t idx = get_function_index((uint32_t) func);
|
|
|
|
|
int16_t idx = get_function_index((uint32_t) func);
|
|
|
|
|
if (idx >= 0) {
|
|
|
|
|
functions[idx].time += T0TC - functions[idx].start_time;
|
|
|
|
|
//functions[idx].consumption += ltc4150_get_intcount() - functions[idx].consumption_start;
|
|
|
|
|