#include "common.h"
#include "calibration.h"
- /* gyro defines */
+
+/* Gyro defines */
#define GYRO_MAX_ERR 0.05
#define GYRO_DS_SIZE 100
#define GYRO_CALIBRATION_PATH "/data/gyro.conf"
-static void reset (struct gyro_cal* cal_data)
+
+static void reset (struct gyro_cal_t* cal_data)
{
cal_data->count = 0;
void gyro_cal_init (struct sensor_info_t* info)
{
int ret;
- struct gyro_cal* cal_data = (struct gyro_cal*) info->cal_data;
+ struct gyro_cal_t* cal_data = (struct gyro_cal_t*) info->cal_data;
FILE* data_file;
info->cal_level = 0;
fclose(data_file);
}
+
void gyro_store_data (struct sensor_info_t* info)
{
int ret;
- struct gyro_cal* cal_data = (struct gyro_cal*) info->cal_data;
+ struct gyro_cal_t* cal_data = (struct gyro_cal_t*) info->cal_data;
FILE* data_file;
if (cal_data == NULL)
}
-static int gyro_collect (float x, float y, float z, struct gyro_cal* cal_data)
+static int gyro_collect (float x, float y, float z, struct gyro_cal_t* cal_data)
{
/* Analyze gyroscope data */
return 1; /* Calibrated! */
}
-void calibrate_gyro(struct sensors_event_t* event, struct sensor_info_t* info)
+
+void calibrate_gyro (struct sensors_event_t* event, struct sensor_info_t* info)
{
- struct gyro_cal* cal_data = (struct gyro_cal*) info->cal_data;
+ struct gyro_cal_t* cal_data = (struct gyro_cal_t*) info->cal_data;
if (cal_data == NULL)
return;