mueller_stopwatch #30

Merged
muellerr merged 18 commits from KSat/fsfw:mueller_stopwatch into master 2020-07-07 12:05:04 +02:00
Showing only changes of commit 684dd67f63 - Show all commits

View File

@ -8,7 +8,7 @@
#include <framework/globalfunctions/timevalOperations.h>
typedef uint32_t millis_t;

Where are does types used?

Where are does types used?

stopwatch. could also be used somewhere else, is more explicit in my opinion. maybe also use it instead of uint32_t for all milliseconds related stuff?

stopwatch. could also be used somewhere else, is more explicit in my opinion. maybe also use it instead of uint32_t for all milliseconds related stuff?

Hm I think we should stick with timeval and the types defined there. Someday this might be replaced by timespec and uint32_t will be to small anyway.

Hm I think we should stick with timeval and the types defined there. Someday this might be replaced by timespec and uint32_t will be to small anyway.
typedef float seconds_t;
typedef double seconds_t;

Seconds are converted to double in timevalOperations::toDouble(elapsedTime), this would not fit to the float type.

Seconds are converted to double in timevalOperations::toDouble(elapsedTime), this would not fit to the float type.

second is double now

second is double now

I still don't think that those typedefs are a good idea. Maybe we should stick to the types timeval or timespec uses or even use the types C++11 uses in duration Link.

I still don't think that those typedefs are a good idea. Maybe we should stick to the types timeval or timespec uses or even use the types C++11 uses in duration [Link](https://www.cplusplus.com/reference/chrono/duration/).

Hmmm.. it just makes it a bit mor explicit. I guess you mean for example time_t ?

These typedefs were inteded to explicitely be used everywhere uint32_t is used to pass around millisecond values.

The new C++ types are a bit more complicated but the clock library will become more powerful soon anyway. I started to play around with the chrono library.
Maybe continue using uint32_t for now?

Hmmm.. it just makes it a bit mor explicit. I guess you mean for example time_t ? These typedefs were inteded to explicitely be used everywhere uint32_t is used to pass around millisecond values. The new C++ types are a bit more complicated but the clock library will become more powerful soon anyway. I started to play around with the chrono library. Maybe continue using uint32_t for now?

instead of writing something like uint32_t lockTimeout, I could write millis_t lockTimeout for example

instead of writing something like uint32_t lockTimeout, I could write millis_t lockTimeout for example
class Clock {
public: