Calls to Serial.printf are quite different timing with the same application code between Argon and p2. I looked in the documentation for clues as to difference without luck. Can you point me in the right direction? The p2 code 'appears' to be slower (20x). Maybe the blocking behavior is different?
Detail:
example print statement:
unsigned long then = micros();
double cTime;
if ( sp.tweak_test() ) cTime = double(now)/1000.;
else cTime = control_time;
sprintf(cp.buffer, "unit_sel,%13.3f, %d, %d, %10.7f, %7.5f,%7.5f,%7.5f,%7.5f,%7.5f, %7.5f,%7.5f, ",
cTime, reset, sp.ib_select(),
Flt->cc_diff(),
ib_amp_hdwe(), ib_noa_hdwe(), ib_amp_model(), ib_noa_model(), ib_model(),
Flt->ib_diff(), Flt->ib_diff_f());
Serial.print(cp.buffer);
sprintf(cp.buffer, " %7.5f,%7.5f,%7.5f, %d, %7.5f,%7.5f, %d, %7.5f, %d, %7.5f,%7.5f, %d, %7.5f, %5.2f,%5.2f, %d, %5.2f, ",
Mon->voc_soc(), Flt->e_wrap(), Flt->e_wrap_filt(),
Flt->ib_sel_stat(), ib_hdwe(), ib_hdwe_model(), sp.mod_ib(), ib(),
Flt->vb_sel_stat(), vb_hdwe(), vb_model(), sp.mod_vb(), vb(),
Tb_hdwe, Tb, sp.mod_tb(), Tb_filt);
Serial.print(cp.buffer);
sprintf(cp.buffer, "%d, %d, %7.3f, %7.3f, %d, %7.3f,%7.3f,%7.3f,%7.3f,%7.3f,%d,",
Flt->fltw(), Flt->falw(), Flt->ib_rate(), Flt->ib_quiet(), Flt->tb_sel_status(),
Flt->cc_diff_thr(), Flt->ewhi_thr(), Flt->ewlo_thr(), Flt->ib_diff_thr(), Flt->ib_quiet_thr(), Flt->preserving());
Serial.print(cp.buffer);
Serial.printlnf("%c,", '\0');
Serial.printf("print_sel %10.6f\n", float(micros() - then)/1.e6);
result:
argon: print_sel 0.003500
p2 : print_sel 0.071000