#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]; }