#include "MRI_Hooks.h"
-TemperatureControl::TemperatureControl(){}
-
-TemperatureControl::TemperatureControl(uint16_t name){
- this->name_checksum = name;
-// this->error_count = 0;
- this->waiting = false;
-}
+TemperatureControl::TemperatureControl(uint16_t name) :
+ name_checksum(name), waiting(false), min_temp_violated(false) {}
void TemperatureControl::on_module_loaded(){
}
-void TemperatureControl::on_main_loop(void* argument){ }
+void TemperatureControl::on_main_loop(void* argument){
+ if (this->min_temp_violated) {
+ kernel->streams->printf("MINTEMP triggered on P%d.%d! check your thermistors!\n", this->thermistor_pin.port_number, this->thermistor_pin.pin);
+ this->min_temp_violated = false;
+ }
+}
// Get configuration from the config file
void TemperatureControl::on_config_reload(void* argument){
{
if ((r <= 1) || (r >= 4094))
{
- kernel->streams->printf("MINTEMP triggered on P%d.%d! check your thermistors!\n", this->thermistor_pin.port_number, this->thermistor_pin.pin);
+ this->min_temp_violated = true;
target_temperature = UNDEFINED;
heater_pin.set(0);
}