Issue #21: Adapt calibration routine to new calibration format
This commit is contained in:
parent
11b84afca0
commit
c02d988350
@ -30,9 +30,9 @@
|
|||||||
enum calibration_shell_state {CAL_START = 0, CAL_WAIT_RES1, CAL_MEAS_RES1, CAL_WAIT_RES2, CAL_MEAS_RES2};
|
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,
|
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;
|
return;
|
||||||
|
|
||||||
float delta_y;
|
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_corr_mult = delta_x / delta_y;
|
||||||
*sens_deviation = sens_corr_mult - 1.0f;
|
*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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
#include <shellmatta.h>
|
#include <shellmatta.h>
|
||||||
|
|
||||||
void calibration_calculate(float low_measured, float low_setpoint, float high_measured, float high_setpoint,
|
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);
|
float *calibration_acquire_data_start(uint32_t count, volatile int *flag);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user