mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-11-22 23:56:13 +01:00
exchange pin number to track letter
This commit is contained in:
parent
43c7baf8f5
commit
2fb485847f
|
@ -1 +1 @@
|
|||
#define GITHUB_SHA "devel-202303151539Z"
|
||||
#define GITHUB_SHA "devel-202303200902Z"
|
||||
|
|
|
@ -137,8 +137,7 @@ MotorDriver::MotorDriver(int16_t power_pin, byte signal_pin, byte signal_pin2, i
|
|||
if (currentPin==UNUSED_PIN)
|
||||
DIAG(F("** WARNING ** No current or short detection"));
|
||||
else {
|
||||
DIAG(F("CurrentPin=A%d, TripValue=%d"),
|
||||
currentPin-A0, rawCurrentTripValue);
|
||||
DIAG(F("Track %c, TripValue=%d"), trackLetter, rawCurrentTripValue);
|
||||
|
||||
// self testing diagnostic for the non-float converters... may be removed when happy
|
||||
// DIAG(F("senseFactorInternal=%d raw2mA(1000)=%d mA2Raw(1000)=%d"),
|
||||
|
@ -163,7 +162,7 @@ void MotorDriver::setPower(POWERMODE mode) {
|
|||
// when switching a track On, we need to check the crrentOffset with the pin OFF
|
||||
if (powerMode==POWERMODE::OFF && currentPin!=UNUSED_PIN) {
|
||||
senseOffset = ADCee::read(currentPin);
|
||||
DIAG(F("CurrentPin A%d sensOffset=%d"),currentPin-A0,senseOffset);
|
||||
DIAG(F("Track %c sensOffset=%d"),trackLetter,senseOffset);
|
||||
}
|
||||
|
||||
IODevice::write(powerPin,invertPower ? LOW : HIGH);
|
||||
|
|
|
@ -182,11 +182,13 @@ class MotorDriver {
|
|||
isProgTrack = on;
|
||||
}
|
||||
void checkPowerOverload(bool useProgLimit, byte trackno);
|
||||
void setTrackLetter(char c);
|
||||
#ifdef ANALOG_READ_INTERRUPT
|
||||
bool sampleCurrentFromHW();
|
||||
void startCurrentFromHW();
|
||||
#endif
|
||||
private:
|
||||
char trackLetter = '?';
|
||||
bool isProgTrack = false; // tells us if this is a prog track
|
||||
void getFastPin(const FSH* type,int pin, bool input, FASTPIN & result);
|
||||
void getFastPin(const FSH* type,int pin, FASTPIN & result) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user