1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-12-25 13:41:23 +01:00

send milliAmps and meter setup for new JMRI Meter function

This commit is contained in:
SteveT 2021-01-06 16:13:58 -05:00
parent 7f27cfc9cb
commit da31e9cbc5

View File

@ -58,20 +58,20 @@ class DCCWaveform {
void checkPowerOverload(); void checkPowerOverload();
int getLastCurrent(); int getLastCurrent();
inline int get1024Current() { inline int get1024Current() {
if (powerMode == POWERMODE::ON) if (powerMode == POWERMODE::ON)
return (int)(lastCurrent*(long int)1024/motorDriver->getRawCurrentTripValue()); return (int)(lastCurrent*(long int)1024/motorDriver->getRawCurrentTripValue());
return 0; return 0;
} }
inline int getCurrentmA() { inline int getCurrentmA() {
if (powerMode == POWERMODE::ON) if (powerMode == POWERMODE::ON)
return motorDriver->raw2mA(lastCurrent); return motorDriver->raw2mA(lastCurrent);
return 0; return 0;
} }
inline int getMaxmA() { inline int getMaxmA() {
if (maxmA == 0) { //only calculate this for first request, it doesn't change if (maxmA == 0) { //only calculate this for first request, it doesn't change
maxmA = motorDriver->raw2mA(motorDriver->getRawCurrentTripValue()); maxmA = motorDriver->raw2mA(motorDriver->getRawCurrentTripValue());
} }
return maxmA; return maxmA;
} }
void schedulePacket(const byte buffer[], byte byteCount, byte repeats); void schedulePacket(const byte buffer[], byte byteCount, byte repeats);
volatile bool packetPending; volatile bool packetPending;