diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2019-11-03 19:44:40 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2019-11-03 19:44:40 +0100 |
commit | 17628af1e4f7da4931286fa47cc2057e2c7cbfdd (patch) | |
tree | f813298bec625a7b7539ef9f3199c47b91f3d285 /sw/relays.cpp | |
parent | 4193ec1618230f7bbc927e1d2280976a9d5dd464 (diff) | |
download | glutte-batteries-17628af1e4f7da4931286fa47cc2057e2c7cbfdd.tar.gz glutte-batteries-17628af1e4f7da4931286fa47cc2057e2c7cbfdd.tar.bz2 glutte-batteries-17628af1e4f7da4931286fa47cc2057e2c7cbfdd.zip |
Rework timer_t to use microseconds
Diffstat (limited to 'sw/relays.cpp')
-rw-r--r-- | sw/relays.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sw/relays.cpp b/sw/relays.cpp index cb83626..d06395f 100644 --- a/sw/relays.cpp +++ b/sw/relays.cpp @@ -35,7 +35,7 @@ struct pending_event_t { bool pending; }; -static constexpr int RELAY_SIGNAL_HOLD_TIME_MS = 400; +static constexpr int RELAY_SIGNAL_HOLD_TIME_US = 400000uL; static constexpr size_t PENDING_EVENTS_SIZE = 8; @@ -119,7 +119,7 @@ bool relays_toggle(relay_id_t relay, bool set_not_reset, const timer_t& when) pending_events[i].pending = true; pending_events[i].relay = relay; pending_events[i].when = when + - timer_t{0, timer_t::ms_to_ticks(RELAY_SIGNAL_HOLD_TIME_MS)}; + timer_t{0, RELAY_SIGNAL_HOLD_TIME_US}; pending_events[i].level = false; pending_events[i].set_not_reset = set_not_reset; |