diff --git a/include/object/ptalog.h b/include/object/ptalog.h index 70e96646ed2f6a50c87ce9b125a385170cb3e8cb..808eef8cf47c6591505e7deda3a4789715fa88fc 100644 --- a/include/object/ptalog.h +++ b/include/object/ptalog.h @@ -19,6 +19,9 @@ class PTALog { #ifdef PTALOG_TIMING counter_value_t timer; counter_overflow_t overflow; +#endif +#ifdef PTALOG_WITH_RETURNVALUES + uint16_t return_value; #endif } log_entry; @@ -70,12 +73,14 @@ class PTALog { { kout << "[PTA] trace=" << dec << trace_id << " count=" << log_index << endl; for (uint8_t i = 0; i < log_index; i++) { -#ifdef PTALOG_TIMING kout << "[PTA] transition=" << log[i].transition_id; - kout << " cycles=" << log[i].timer << "/" << log[i].overflow << endl; -#else - kout << "[PTA] transition=" << log[i].transition_id << endl; +#ifdef PTALOG_TIMING + kout << " cycles=" << log[i].timer << "/" << log[i].overflow; +#endif +#ifdef PTALOG_WITH_RETURNVALUES + kout << " return=" << log[i].return_value; #endif + kout << endl; } } @@ -84,6 +89,13 @@ class PTALog { gpio.write(sync_pin, 1); } +#ifdef PTALOG_WITH_RETURNVALUES + inline void logReturn(uint16_t ret) + { + log[log_index - 1].return_value = ret; + } +#endif + #ifdef PTALOG_TIMING inline void stopTransition(Counter& counter) #else