Skip to content
Snippets Groups Projects
Commit 23da22ef authored by Matteo Pignataro's avatar Matteo Pignataro
Browse files

[MAX3185] Removed from self test the thermocouple check feature and added new method to do so

parent fd2cabf2
Branches
No related tags found
No related merge requests found
...@@ -43,7 +43,9 @@ SPIBusConfig MAX31855::getDefaultSPIConfig() ...@@ -43,7 +43,9 @@ SPIBusConfig MAX31855::getDefaultSPIConfig()
bool MAX31855::init() { return true; } bool MAX31855::init() { return true; }
bool MAX31855::selfTest() bool MAX31855::selfTest() { return true; }
bool MAX31855::checkConnected()
{ {
uint16_t sample[2]; uint16_t sample[2];
......
...@@ -50,12 +50,14 @@ public: ...@@ -50,12 +50,14 @@ public:
bool init(); bool init();
bool selfTest();
/** /**
* @brief Checks whether the thermocouple is connected or not. * @brief Checks whether the thermocouple is connected or not.
* *
* @return True if the thermocouple is connected. * @return True if the thermocouple is connected.
*/ */
bool selfTest(); bool checkConnected();
/** /**
* @brief Read the device internal temperature (cold junction). * @brief Read the device internal temperature (cold junction).
......
...@@ -58,7 +58,9 @@ bool MAX31856::init() ...@@ -58,7 +58,9 @@ bool MAX31856::init()
return true; return true;
} }
bool MAX31856::selfTest() bool MAX31856::selfTest() { return true; }
bool MAX31856::checkConnected()
{ {
SPITransaction spi{slave}; SPITransaction spi{slave};
......
...@@ -69,12 +69,14 @@ public: ...@@ -69,12 +69,14 @@ public:
bool init(); bool init();
bool selfTest();
/** /**
* @brief Checks whether the thermocouple is connected or not. * @brief Checks whether the thermocouple is connected or not.
* *
* @return True if the thermocouple is connected. * @return True if the thermocouple is connected.
*/ */
bool selfTest(); bool checkConnected();
void setThermocoupleType(ThermocoupleType type); void setThermocoupleType(ThermocoupleType type);
......
...@@ -56,9 +56,9 @@ int main() ...@@ -56,9 +56,9 @@ int main()
printf("Starting process verification!\n"); printf("Starting process verification!\n");
if (!sensor.selfTest()) if (!sensor.checkConnected())
{ {
printf("Sensor self test failed!\n"); printf("Sensor not connected!\n");
} }
while (true) while (true)
......
...@@ -51,7 +51,7 @@ int main() ...@@ -51,7 +51,7 @@ int main()
sensor.init(); sensor.init();
if (!sensor.selfTest()) if (!sensor.checkConnected())
{ {
printf("The thermocouple is not connected\n"); printf("The thermocouple is not connected\n");
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment