ADD measure time call

This commit is contained in:
fastium
2025-01-04 15:51:51 +01:00
parent 4fb09c690c
commit b9c129e872
6 changed files with 125 additions and 92 deletions

View File

@@ -31,9 +31,15 @@
namespace multi_tasking {
typedef struct gearMail {
uint8_t gear;
std::chrono::microseconds callTime;
} gearMail_t;
class GearDevice {
public:
explicit GearDevice(Mail<uint8_t, 16>* mailBox); // NOLINT(runtime/references)
explicit GearDevice(Mail<gearMail_t, 16>* mailBox,
Timer& timer); // NOLINT(runtime/references)
// make the class non copyable
GearDevice(GearDevice&) = delete;
@@ -48,7 +54,8 @@ class GearDevice {
private:
// data members
volatile uint8_t _currentGear = bike_computer::kMinGear;
Mail<uint8_t, 16>* _mailBox;
Mail<gearMail_t, 16>* _mailBox;
Timer& _timer;
};
} // namespace multi_tasking