From e244de7835928a4f9a61ceb821af3a9292d05467 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Sat, 4 Jul 2020 21:44:36 +0200 Subject: [PATCH] more merge --- DCCWaveform.cpp | 3 ++- Hardware.cpp | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/DCCWaveform.cpp b/DCCWaveform.cpp index 9c81d61..f0045ee 100644 --- a/DCCWaveform.cpp +++ b/DCCWaveform.cpp @@ -164,6 +164,7 @@ bool DCCWaveform::interrupt1() { if (ackPending) checkAck(); return false; + } @@ -295,6 +296,6 @@ void DCCWaveform::checkAck() { ackPending=false; transmitRepeats=0; // shortcut remaining repeat packets return; // we have a genuine ACK result - } + } ackPulseStart=0; // We have detected a too-short or too-long pulse so ignore and wait for next leading edge } diff --git a/Hardware.cpp b/Hardware.cpp index 336baeb..dc5b323 100644 --- a/Hardware.cpp +++ b/Hardware.cpp @@ -65,6 +65,10 @@ int Hardware::getCurrentRaw(bool isMainTrack) { } +unsigned int Hardware::getCurrentMilliamps(bool isMainTrack, int raw) { + return (int)(raw * (isMainTrack ? MAIN_SENSE_FACTOR : PROG_SENSE_FACTOR)); +} + void Hardware::setCallback(int duration, void (*isr)()) { Timer1.initialize(duration); // We don't want the timer to set pins because these often clash with motor shields etc.