parent
10e2ab9277
commit
a302c624d2
@ -0,0 +1,20 @@
|
||||
#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];
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
#ifndef __OFFSET_H
|
||||
#define __OFFSET_H
|
||||
|
||||
#include "main.h"
|
||||
#include <stdint.h>
|
||||
|
||||
extern int16_t offset_measure[4];
|
||||
extern int16_t offset_count[4];
|
||||
extern int16_t offset_val[4];
|
||||
extern int16_t offsets[4];
|
||||
|
||||
int16_t offset_measure_start(int16_t channel);
|
||||
int16_t offset_measure_stop(int16_t channel);
|
||||
|
||||
#endif
|
||||
Loading…
Reference in new issue