You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
455 B

#include "offset.h"
int16_t offset_measure[4];
int16_t offset_count[4];
int16_t offset_val[4];
int16_t offsets[4];
int16_t offset_measure_start(int16_t channel) {
offset_measure[channel] = 1;
offset_count[channel] = 1;
offset_val[channel] = 0;
return 1;
}
int16_t offset_measure_stop(int16_t channel) {
offset_measure[channel] = 0;
offsets[channel] = offset_val[channel] / offset_count[channel];
return offsets[channel];
}