diff --git a/src/shared/sensors/MAX6675/MAX6675.cpp b/src/shared/sensors/MAX6675/MAX6675.cpp index 847d0065650b41456c9362b544240f3ec26a788e..08ca8e3016c3b32b8f33f7a57938419db8c90141 100644 --- a/src/shared/sensors/MAX6675/MAX6675.cpp +++ b/src/shared/sensors/MAX6675/MAX6675.cpp @@ -42,7 +42,9 @@ SPIBusConfig MAX6675::getDefaultSPIConfig() bool MAX6675::init() { return true; } -bool MAX6675::selfTest() +bool MAX6675::selfTest() { return true; } + +bool MAX6675::checkConnection() { uint16_t sample; @@ -51,7 +53,7 @@ bool MAX6675::selfTest() sample = spi.read16(); } - // The third bit (D2) indicates wheter the termocouple is connected or not. + // The third bit (D2) indicates wheter the termocouple is connected or not // It is high if open if ((sample % 0x2) != 0) { diff --git a/src/shared/sensors/MAX6675/MAX6675.h b/src/shared/sensors/MAX6675/MAX6675.h index ad1245190f20614f87c32ea93f7e58c5d22f1b7b..1276549318e5caa0a479faddf02b46b2b3661d45 100644 --- a/src/shared/sensors/MAX6675/MAX6675.h +++ b/src/shared/sensors/MAX6675/MAX6675.h @@ -62,6 +62,11 @@ public: */ bool selfTest(); + /** + * @brief Checks whether the thermocouple is connected or not. + */ + bool checkConnection(); + private: TemperatureData sampleImpl() override;