From 2fb485847fa5a9522b97963e6976c98ac402c4ec Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Mon, 20 Mar 2023 10:03:02 +0100 Subject: [PATCH] exchange pin number to track letter --- GITHUB_SHA.h | 2 +- MotorDriver.cpp | 5 ++--- MotorDriver.h | 2 ++ 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/GITHUB_SHA.h b/GITHUB_SHA.h index 4d37765..a35bfaa 100644 --- a/GITHUB_SHA.h +++ b/GITHUB_SHA.h @@ -1 +1 @@ -#define GITHUB_SHA "devel-202303151539Z" +#define GITHUB_SHA "devel-202303200902Z" diff --git a/MotorDriver.cpp b/MotorDriver.cpp index 0236215..a62dc9c 100644 --- a/MotorDriver.cpp +++ b/MotorDriver.cpp @@ -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); diff --git a/MotorDriver.h b/MotorDriver.h index 51f7654..77b2ec8 100644 --- a/MotorDriver.h +++ b/MotorDriver.h @@ -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) {