From da31e9cbc519f965366fa3e3ec342ab75b632a16 Mon Sep 17 00:00:00 2001 From: SteveT Date: Wed, 6 Jan 2021 16:13:58 -0500 Subject: [PATCH] send milliAmps and meter setup for new JMRI Meter function --- DCCWaveform.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/DCCWaveform.h b/DCCWaveform.h index 50362e0..f8b2536 100644 --- a/DCCWaveform.h +++ b/DCCWaveform.h @@ -58,20 +58,20 @@ class DCCWaveform { void checkPowerOverload(); int getLastCurrent(); inline int get1024Current() { - if (powerMode == POWERMODE::ON) - return (int)(lastCurrent*(long int)1024/motorDriver->getRawCurrentTripValue()); - return 0; + if (powerMode == POWERMODE::ON) + return (int)(lastCurrent*(long int)1024/motorDriver->getRawCurrentTripValue()); + return 0; } inline int getCurrentmA() { - if (powerMode == POWERMODE::ON) - return motorDriver->raw2mA(lastCurrent); - return 0; + if (powerMode == POWERMODE::ON) + return motorDriver->raw2mA(lastCurrent); + return 0; } inline int getMaxmA() { - if (maxmA == 0) { //only calculate this for first request, it doesn't change - maxmA = motorDriver->raw2mA(motorDriver->getRawCurrentTripValue()); - } - return maxmA; + if (maxmA == 0) { //only calculate this for first request, it doesn't change + maxmA = motorDriver->raw2mA(motorDriver->getRawCurrentTripValue()); + } + return maxmA; } void schedulePacket(const byte buffer[], byte byteCount, byte repeats); volatile bool packetPending;