mirror of https://github.com/rusefi/rusefi.git
max3185x: show device type
This commit is contained in:
parent
53818045dc
commit
8972fedb41
|
@ -67,6 +67,7 @@ public:
|
||||||
auto& sensor = egtSensors[i];
|
auto& sensor = egtSensors[i];
|
||||||
|
|
||||||
m_cs[i] = Gpio::Invalid;
|
m_cs[i] = Gpio::Invalid;
|
||||||
|
types[i] = UNKNOWN_TYPE;
|
||||||
|
|
||||||
// If there's already another (CAN?) EGT sensor configured,
|
// If there's already another (CAN?) EGT sensor configured,
|
||||||
// don't configure this one.
|
// don't configure this one.
|
||||||
|
@ -152,7 +153,7 @@ public:
|
||||||
float temp, refTemp;
|
float temp, refTemp;
|
||||||
Max3185xState code = getMax3185xEgtValues(i, &temp, &refTemp);
|
Max3185xState code = getMax3185xEgtValues(i, &temp, &refTemp);
|
||||||
|
|
||||||
efiPrintf("egt%d: code=%d (%s)", i + 1, code, getMax3185xErrorCodeName(code));
|
efiPrintf("egt%d: type %s, code=%d (%s)", i + 1, getMax3185xTypeName(types[i]), code, getMax3185xErrorCodeName(code));
|
||||||
|
|
||||||
if (code == MAX3185X_OK) {
|
if (code == MAX3185X_OK) {
|
||||||
efiPrintf(" temperature %.4f reference temperature %.2f", temp, refTemp);
|
efiPrintf(" temperature %.4f reference temperature %.2f", temp, refTemp);
|
||||||
|
@ -205,6 +206,17 @@ private:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char *getMax3185xTypeName(Max3185xType type) {
|
||||||
|
switch (type) {
|
||||||
|
case MAX31855_TYPE:
|
||||||
|
return "max31855";
|
||||||
|
case MAX31856_TYPE:
|
||||||
|
return "max31856";
|
||||||
|
default:
|
||||||
|
return "unknown";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int spi_txrx(size_t ch, uint8_t tx[], uint8_t rx[], size_t n)
|
int spi_txrx(size_t ch, uint8_t tx[], uint8_t rx[], size_t n)
|
||||||
{
|
{
|
||||||
brain_pin_e cs = m_cs[ch];
|
brain_pin_e cs = m_cs[ch];
|
||||||
|
|
Loading…
Reference in New Issue