Issue #21: Adapt calibration routine to new calibration format

This commit is contained in:
Mario Hüttel 2020-11-15 23:36:52 +01:00
parent 11b84afca0
commit c02d988350
2 changed files with 4 additions and 4 deletions

View File

@ -30,9 +30,9 @@
enum calibration_shell_state {CAL_START = 0, CAL_WAIT_RES1, CAL_MEAS_RES1, CAL_WAIT_RES2, CAL_MEAS_RES2};
void calibration_calculate(float low_measured, float low_setpoint, float high_measured, float high_setpoint,
float *sens_deviation, float *sens_corrected_offset)
float *sens_deviation, float *offset)
{
if (!sens_deviation || !sens_corrected_offset)
if (!sens_deviation || !offset)
return;
float delta_y;
@ -45,7 +45,7 @@ void calibration_calculate(float low_measured, float low_setpoint, float high_me
sens_corr_mult = delta_x / delta_y;
*sens_deviation = sens_corr_mult - 1.0f;
*sens_corrected_offset = low_setpoint - low_measured * sens_corr_mult;
*offset = (high_setpoint * low_measured - low_setpoint * high_measured) / (high_setpoint - low_setpoint);
}

View File

@ -27,7 +27,7 @@
#include <shellmatta.h>
void calibration_calculate(float low_measured, float low_setpoint, float high_measured, float high_setpoint,
float *sens_deviation, float *sens_corrected_offset);
float *sens_deviation, float *offset);
float *calibration_acquire_data_start(uint32_t count, volatile int *flag);