diff --git a/src/shared/sensors/MAX31855/MAX31855.cpp b/src/shared/sensors/MAX31855/MAX31855.cpp index f79eec3a4a8731a92d0a31301a4f781c74cb455e..955f2fbdc56389f158a72a042b5de215156c1a3b 100644 --- a/src/shared/sensors/MAX31855/MAX31855.cpp +++ b/src/shared/sensors/MAX31855/MAX31855.cpp @@ -43,7 +43,9 @@ SPIBusConfig MAX31855::getDefaultSPIConfig() bool MAX31855::init() { return true; } -bool MAX31855::selfTest() +bool MAX31855::selfTest() { return true; } + +bool MAX31855::checkConnected() { uint16_t sample[2]; diff --git a/src/shared/sensors/MAX31855/MAX31855.h b/src/shared/sensors/MAX31855/MAX31855.h index 62be42ab10eabb7c66a507c9d67449cbc92eec01..fcfcd412d6234e325489f2f61fbfab244ce01dec 100644 --- a/src/shared/sensors/MAX31855/MAX31855.h +++ b/src/shared/sensors/MAX31855/MAX31855.h @@ -50,12 +50,14 @@ public: bool init(); + bool selfTest(); + /** * @brief Checks whether the thermocouple is connected or not. * * @return True if the thermocouple is connected. */ - bool selfTest(); + bool checkConnected(); /** * @brief Read the device internal temperature (cold junction). diff --git a/src/shared/sensors/MAX31856/MAX31856.cpp b/src/shared/sensors/MAX31856/MAX31856.cpp index ad1d5475980f62eea2eb31e4df99e49778081b53..c10636068ed7443d5b50c8100cf733517c0de311 100644 --- a/src/shared/sensors/MAX31856/MAX31856.cpp +++ b/src/shared/sensors/MAX31856/MAX31856.cpp @@ -58,7 +58,9 @@ bool MAX31856::init() return true; } -bool MAX31856::selfTest() +bool MAX31856::selfTest() { return true; } + +bool MAX31856::checkConnected() { SPITransaction spi{slave}; diff --git a/src/shared/sensors/MAX31856/MAX31856.h b/src/shared/sensors/MAX31856/MAX31856.h index 7e04e481a5b820ccc2fb37597419cea2b341394a..7e329e28222d1b0c46a049bba3580f2604bb4843 100644 --- a/src/shared/sensors/MAX31856/MAX31856.h +++ b/src/shared/sensors/MAX31856/MAX31856.h @@ -69,12 +69,14 @@ public: bool init(); + bool selfTest(); + /** * @brief Checks whether the thermocouple is connected or not. * * @return True if the thermocouple is connected. */ - bool selfTest(); + bool checkConnected(); void setThermocoupleType(ThermocoupleType type); diff --git a/src/tests/sensors/test-max31855.cpp b/src/tests/sensors/test-max31855.cpp index 00171ebab0da1cb58c04885821dc96e0b7526754..71e9022d4e7f2b26a2a53fb52726f57829d3b622 100644 --- a/src/tests/sensors/test-max31855.cpp +++ b/src/tests/sensors/test-max31855.cpp @@ -56,9 +56,9 @@ int main() printf("Starting process verification!\n"); - if (!sensor.selfTest()) + if (!sensor.checkConnected()) { - printf("Sensor self test failed!\n"); + printf("Sensor not connected!\n"); } while (true) diff --git a/src/tests/sensors/test-max31856.cpp b/src/tests/sensors/test-max31856.cpp index 6d4a3edd655e93480c365ce5f258f72d7be9fa82..11908d34b89f421be5486656c23c0578960c3a7d 100644 --- a/src/tests/sensors/test-max31856.cpp +++ b/src/tests/sensors/test-max31856.cpp @@ -51,7 +51,7 @@ int main() sensor.init(); - if (!sensor.selfTest()) + if (!sensor.checkConnected()) { printf("The thermocouple is not connected\n"); }