diff options
-rw-r--r-- | include/object/ptalog.h | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/include/object/ptalog.h b/include/object/ptalog.h index 6b00e78..f53dcc5 100644 --- a/include/object/ptalog.h +++ b/include/object/ptalog.h @@ -13,25 +13,26 @@ class PTALog { log_entry log[32]; uint8_t log_index; - PTALog() : log_index(0) {} + PTALog(uint8_t pin_number) : log_index(0), sync_pin(pin_number) {} - void passTransition(uint8_t transition_id) + inline void passTransition(uint8_t transition_id) { log[log_index].transition_id = transition_id; log_index++; } - void reset() + inline void reset() { log_index = 0; } - void startBenchmark(uint8_t id) + inline void startBenchmark(uint8_t id) { kout << "[PTA] benchmark start, id=" << dec << id << endl; + gpio.output(sync_pin); } - void stopBenchmark() + inline void stopBenchmark() { kout << "[PTA] benchmark stop" << endl; } @@ -44,8 +45,19 @@ class PTALog { } } + inline void startTransition() + { + gpio.write(sync_pin, 1); + } + + inline void stopTransition() + { + gpio.write(sync_pin, 0); + } + private: PTALog(const PTALog& copy); + uint8_t sync_pin; }; #endif |