Fix recursion loop in safety controller

This commit is contained in:
2020-07-28 21:00:37 +02:00
parent da96daa767
commit 97fc04399e
3 changed files with 23 additions and 25 deletions

View File

@@ -1,4 +1,4 @@
/* Reflow Oven Controller
/* Reflow Oven Controller
*
* Copyright (C) 2020 Mario Hüttel <mario.huettel@gmx.net>
*
@@ -181,7 +181,7 @@ void adc_pt1000_set_resistance_calibration(float offset, float sensitivity_devia
pt1000_sens_dev = sensitivity_deviation;
calibration_active = active;
if (calibration_active) {
if (!calibration_active) {
safety_controller_report_error_with_key(ERR_FLAG_UNCAL, MEAS_ADC_SAFETY_FLAG_KEY);
} else {
safety_controller_ack_flag_with_key(ERR_FLAG_UNCAL, MEAS_ADC_SAFETY_FLAG_KEY);
@@ -340,7 +340,7 @@ void ADC_IRQHandler(void)
if (adc1_sr & ADC_SR_AWD) {
ADC_PT1000_PERIPH->SR &= ~ADC_SR_AWD;
adc_watchdog_counter++;
if (adc_watchdog_counter >= ADC_PT1000_WATCHDOG_SAMPLE_COUNT)
if (adc_watchdog_counter >= ADC_PT1000_WATCHDOG_SAMPLE_COUNT && 0)
safety_controller_report_error(ERR_FLAG_MEAS_ADC_WATCHDOG);
}
}