1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-29 12:50:28 +00:00

Use constexpr functions in preference to macros.

This commit is contained in:
Thomas Harte 2024-01-16 23:40:40 -05:00
parent a3d37640aa
commit 53d6d311a7

View File

@ -57,8 +57,8 @@ enum Line: BusState {
Request = 1 << 17, Request = 1 << 17,
}; };
#define us(x) (x) / 1000000.0 constexpr double us(double t) { return t / 1'000'000.0; }
#define ns(x) (x) / 1000000000.0 constexpr double ns(double t) { return t / 1'000'000'000.0; }
/// The minimum amount of time that reset must be held for. /// The minimum amount of time that reset must be held for.
constexpr double ResetHoldTime = us(25.0); constexpr double ResetHoldTime = us(25.0);